From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01: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 1ZhSZV-0003xk-2S; Thu, 01 Oct 2015 01:22:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZT-0003xf-Rl
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:07 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	D6/BC-15765-FBA8C065; Thu, 01 Oct 2015 01:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1443662525!48459771!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18450 invoked from network); 1 Oct 2015 01:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:22:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZQ-0001iM-Kg
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZQ-0003aW-HS
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:04 +0000
Date: Thu, 01 Oct 2015 01:22:04 +0000
Message-Id: <E1ZhSZQ-0003aW-HS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Correctly emulate write
	when byte is used
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f214fea76acc6cbc1101fe1815cee795483a67d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 22 21:18:48 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:41:16 2015 +0100

    xen/arm: vgic: Correctly emulate write when byte is used
    
    When a guest is writing a byte, the value will be located in bits[7:0]
    of the register.
    
    Although the current implementation is expecting the byte at the Nth
    byte of the register where N = address & 4;
    
    When the address is not 4-byte aligned, the corresponding byte in the
    internal state will always be set to zero rather.
    
    Note that byte access are only used for GICD_IPRIORITYR and
    GICD_ITARGETSR. So the worst things that could happen is not setting the
    priority correctly and ignore the target vCPU written.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/vgic.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 41cadb1..96839f0 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -174,10 +174,10 @@ static inline void vgic_byte_write(uint32_t *reg, uint32_t var, int offset)
 {
     int byte = offset & 0x3;
 
-    var &= (0xff << (8*byte));
+    var &= 0xff;
 
     *reg &= ~(0xff << (8*byte));
-    *reg |= var;
+    *reg |= (var << (8*byte));
 }
 
 enum gic_sgi_mode;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01: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 1ZhSZV-0003xk-2S; Thu, 01 Oct 2015 01:22:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZT-0003xf-Rl
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:07 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	D6/BC-15765-FBA8C065; Thu, 01 Oct 2015 01:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1443662525!48459771!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18450 invoked from network); 1 Oct 2015 01:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:22:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZQ-0001iM-Kg
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZQ-0003aW-HS
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:04 +0000
Date: Thu, 01 Oct 2015 01:22:04 +0000
Message-Id: <E1ZhSZQ-0003aW-HS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Correctly emulate write
	when byte is used
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f214fea76acc6cbc1101fe1815cee795483a67d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 22 21:18:48 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:41:16 2015 +0100

    xen/arm: vgic: Correctly emulate write when byte is used
    
    When a guest is writing a byte, the value will be located in bits[7:0]
    of the register.
    
    Although the current implementation is expecting the byte at the Nth
    byte of the register where N = address & 4;
    
    When the address is not 4-byte aligned, the corresponding byte in the
    internal state will always be set to zero rather.
    
    Note that byte access are only used for GICD_IPRIORITYR and
    GICD_ITARGETSR. So the worst things that could happen is not setting the
    priority correctly and ignore the target vCPU written.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/vgic.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 41cadb1..96839f0 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -174,10 +174,10 @@ static inline void vgic_byte_write(uint32_t *reg, uint32_t var, int offset)
 {
     int byte = offset & 0x3;
 
-    var &= (0xff << (8*byte));
+    var &= 0xff;
 
     *reg &= ~(0xff << (8*byte));
-    *reg |= var;
+    *reg |= (var << (8*byte));
 }
 
 enum gic_sgi_mode;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:22:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhSZh-0003yJ-7T; Thu, 01 Oct 2015 01:22: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 1ZhSZf-0003y9-Is
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:19 +0000
Content-Length: 5426
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	02/56-02324-ACA8C065; Thu, 01 Oct 2015 01:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1443662536!23270432!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27948 invoked from network); 1 Oct 2015 01:22:17 -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;
	1 Oct 2015 01:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZc-0001iQ-NF
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZb-0003bE-MP
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:15 +0000
Date: Thu, 01 Oct 2015 01:22:15 +0000
Message-Id: <E1ZhSZb-0003bE-MP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix devd removal 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: multipart/mixed; boundary="===============5719902973096353945=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5719902973096353945==
Content-Length: 5094
Content-Transfer-Encoding: quoted-printable

commit 5c9a00c57172182652c432e80cc278bebc044dc4
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Sep 23 12:06:55 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:42:50 2015 +0100

    libxl: fix devd removal path
    
    The current flow of the devd helper (in charge of launching hotplug scripts
    inside of driver domains) is to wait for the device backend to switch to
    state 6  (XenbusStateClosed) and then remove it. This is not correct, since
    a domain can reconnect it's PV devices as many times as it wants.
    
    In order to fix this, introduce the following logic: the control domain will
    set the "online" backend node to 0 when it wants the driver domain to
    disconnect the device, so now the condition applied in devd is that "state"
    must be 6 and "online" 0 in order to proceed with the disconnection.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reported-by: Alex Velazquez <alex.j.velazquez@gmail.com>
    Cc: Alex Velazquez <alex.j.velazquez@gmail.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: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c        |   32 ++++++++++++++++++--------------
 tools/libxl/libxl_device.c |    9 ++++-----
 2 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4d27891..d38d0c7 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4421,32 +4421,36 @@ static void backend_watch_callback(libxl__egc *egc, libxl__ev_xswatch *watch,
     libxl__ao *nested_ao =3D libxl__nested_ao_create(ddomain->ao);
     STATE_AO_GC(nested_ao);
     char *p, *path;
-    const char *sstate;
-    int state, rc, num_devs;
+    const char *sstate, *sonline;
+    int state, online, rc, num_devs;
     libxl__device *dev =3D NULL;
     libxl__ddomain_device *ddev =3D NULL;
     libxl__ddomain_guest *dguest =3D NULL;
     bool free_ao =3D false;
 
-    /* Check if event_path ends with "state" and truncate it */
-    if (strlen(event_path) < strlen("state"))
-        goto skip;
-
+    /* Check if event_path ends with "state" or "online" and truncate it. */
     path =3D libxl__strdup(gc, event_path);
-    p =3D path + strlen(path) - strlen("state") - 1;
-    if (*p !=3D '/')
+    p =3D strrchr(path, '/');
+    if (p =3D=3D NULL)
         goto skip;
-    *p =3D '\0';
-    p++;
-    if (strcmp(p, "state") !=3D 0)
+    if (strcmp(p, "/state") !=3D 0 && strcmp(p, "/online") !=3D 0)
         goto skip;
+    /* Truncate the string so it points to the backend directory. */
+    *p =3D '\0';
 
-    /* Check if the state is 1 (XenbusStateInitialising) or greater */
-    rc =3D libxl__xs_read_checked(gc, XBT_NULL, event_path, &sstate);
+    /* Fetch the value of the state and online nodes. */
+    rc =3D libxl__xs_read_checked(gc, XBT_NULL, GCSPRINTF("%s/state", path),
+                                &sstate);
     if (rc || !sstate)
         goto skip;
     state =3D atoi(sstate);
 
+    rc =3D libxl__xs_read_checked(gc, XBT_NULL, GCSPRINTF("%s/online", path),
+                                &sonline);
+    if (rc || !sonline)
+        goto skip;
+    online =3D atoi(sonline);
+
     dev =3D libxl__zalloc(NOGC, sizeof(*dev));
     rc =3D libxl__parse_backend_path(gc, path, dev);
     if (rc)
@@ -4488,7 +4492,7 @@ static void backend_watch_callback(libxl__egc *egc, libxl__ev_xswatch *watch,
         rc =3D add_device(egc, nested_ao, dguest, ddev);
         if (rc > 0)
             free_ao =3D true;
-    } else if (state =3D=3D XenbusStateClosed) {
+    } else if (state =3D=3D XenbusStateClosed && online =3D=3D 0) {
         /*
          * Removal of an active device, remove it from the list and
          * free it's data structures if they are no longer needed.
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index bee5ed5..85a3662 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -837,16 +837,15 @@ void libxl__initiate_device_remove(libxl__egc *egc,
             goto out;
         }
 
+        rc =3D libxl__xs_write_checked(gc, t, online_path, "0");
+        if (rc)
+            goto out;
+
         /*
          * Check if device is already in "closed" state, in which case
          * it should not be changed.
          */
          if (state && atoi(state) !=3D XenbusStateClosed) {
-            rc =3D libxl__xs_write_checked(gc, t, online_path, "0");
-            if (rc) {
-                LOG(ERROR, "unable to write to xenstore path %s", online_path);
-                goto out;
-            }
             rc =3D libxl__xs_write_checked(gc, t, state_path, GCSPRINTF("%d", XenbusStateClosing));
             if (rc) {
                 LOG(ERROR, "unable to write to xenstore path %s", state_path);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:22:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhSZh-0003yJ-7T; Thu, 01 Oct 2015 01:22: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 1ZhSZf-0003y9-Is
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:19 +0000
Content-Length: 5426
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	02/56-02324-ACA8C065; Thu, 01 Oct 2015 01:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1443662536!23270432!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27948 invoked from network); 1 Oct 2015 01:22:17 -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;
	1 Oct 2015 01:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZc-0001iQ-NF
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZb-0003bE-MP
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:15 +0000
Date: Thu, 01 Oct 2015 01:22:15 +0000
Message-Id: <E1ZhSZb-0003bE-MP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix devd removal 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: multipart/mixed; boundary="===============5719902973096353945=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5719902973096353945==
Content-Length: 5094
Content-Transfer-Encoding: quoted-printable

commit 5c9a00c57172182652c432e80cc278bebc044dc4
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Sep 23 12:06:55 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:42:50 2015 +0100

    libxl: fix devd removal path
    
    The current flow of the devd helper (in charge of launching hotplug scripts
    inside of driver domains) is to wait for the device backend to switch to
    state 6  (XenbusStateClosed) and then remove it. This is not correct, since
    a domain can reconnect it's PV devices as many times as it wants.
    
    In order to fix this, introduce the following logic: the control domain will
    set the "online" backend node to 0 when it wants the driver domain to
    disconnect the device, so now the condition applied in devd is that "state"
    must be 6 and "online" 0 in order to proceed with the disconnection.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reported-by: Alex Velazquez <alex.j.velazquez@gmail.com>
    Cc: Alex Velazquez <alex.j.velazquez@gmail.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: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c        |   32 ++++++++++++++++++--------------
 tools/libxl/libxl_device.c |    9 ++++-----
 2 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4d27891..d38d0c7 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4421,32 +4421,36 @@ static void backend_watch_callback(libxl__egc *egc, libxl__ev_xswatch *watch,
     libxl__ao *nested_ao =3D libxl__nested_ao_create(ddomain->ao);
     STATE_AO_GC(nested_ao);
     char *p, *path;
-    const char *sstate;
-    int state, rc, num_devs;
+    const char *sstate, *sonline;
+    int state, online, rc, num_devs;
     libxl__device *dev =3D NULL;
     libxl__ddomain_device *ddev =3D NULL;
     libxl__ddomain_guest *dguest =3D NULL;
     bool free_ao =3D false;
 
-    /* Check if event_path ends with "state" and truncate it */
-    if (strlen(event_path) < strlen("state"))
-        goto skip;
-
+    /* Check if event_path ends with "state" or "online" and truncate it. */
     path =3D libxl__strdup(gc, event_path);
-    p =3D path + strlen(path) - strlen("state") - 1;
-    if (*p !=3D '/')
+    p =3D strrchr(path, '/');
+    if (p =3D=3D NULL)
         goto skip;
-    *p =3D '\0';
-    p++;
-    if (strcmp(p, "state") !=3D 0)
+    if (strcmp(p, "/state") !=3D 0 && strcmp(p, "/online") !=3D 0)
         goto skip;
+    /* Truncate the string so it points to the backend directory. */
+    *p =3D '\0';
 
-    /* Check if the state is 1 (XenbusStateInitialising) or greater */
-    rc =3D libxl__xs_read_checked(gc, XBT_NULL, event_path, &sstate);
+    /* Fetch the value of the state and online nodes. */
+    rc =3D libxl__xs_read_checked(gc, XBT_NULL, GCSPRINTF("%s/state", path),
+                                &sstate);
     if (rc || !sstate)
         goto skip;
     state =3D atoi(sstate);
 
+    rc =3D libxl__xs_read_checked(gc, XBT_NULL, GCSPRINTF("%s/online", path),
+                                &sonline);
+    if (rc || !sonline)
+        goto skip;
+    online =3D atoi(sonline);
+
     dev =3D libxl__zalloc(NOGC, sizeof(*dev));
     rc =3D libxl__parse_backend_path(gc, path, dev);
     if (rc)
@@ -4488,7 +4492,7 @@ static void backend_watch_callback(libxl__egc *egc, libxl__ev_xswatch *watch,
         rc =3D add_device(egc, nested_ao, dguest, ddev);
         if (rc > 0)
             free_ao =3D true;
-    } else if (state =3D=3D XenbusStateClosed) {
+    } else if (state =3D=3D XenbusStateClosed && online =3D=3D 0) {
         /*
          * Removal of an active device, remove it from the list and
          * free it's data structures if they are no longer needed.
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index bee5ed5..85a3662 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -837,16 +837,15 @@ void libxl__initiate_device_remove(libxl__egc *egc,
             goto out;
         }
 
+        rc =3D libxl__xs_write_checked(gc, t, online_path, "0");
+        if (rc)
+            goto out;
+
         /*
          * Check if device is already in "closed" state, in which case
          * it should not be changed.
          */
          if (state && atoi(state) !=3D XenbusStateClosed) {
-            rc =3D libxl__xs_write_checked(gc, t, online_path, "0");
-            if (rc) {
-                LOG(ERROR, "unable to write to xenstore path %s", online_path);
-                goto out;
-            }
             rc =3D libxl__xs_write_checked(gc, t, state_path, GCSPRINTF("%d", XenbusStateClosing));
             if (rc) {
                 LOG(ERROR, "unable to write to xenstore path %s", state_path);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:22:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:22: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 1ZhSZr-0003za-AK; Thu, 01 Oct 2015 01:22: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 1ZhSZp-0003zK-Rm
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:29 +0000
Content-Length: 3079
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	2D/7C-12371-5DA8C065; Thu, 01 Oct 2015 01:22:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1443662547!17750977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1179 invoked from network); 1 Oct 2015 01:22:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:22:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZn-0001ic-2Q
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZm-0003be-Vv
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:27 +0000
Date: Thu, 01 Oct 2015 01:22:26 +0000
Message-Id: <E1ZhSZm-0003be-Vv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix the cleanup of the backend
	path when using driver domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3600791358696007561=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3600791358696007561==
Content-Length: 2686
Content-Transfer-Encoding: quoted-printable

commit 546678c6a60f64fb186640460dfa69a837c8fba5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Sep 23 12:06:56 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:42:50 2015 +0100

    libxl: fix the cleanup of the backend path when using driver domains
    
    With the current libxl implementation the control domain will remove both
    the frontend and the backend xenstore paths of a device that's handled by a
    driver domain. This is incorrect, since the driver domain possibly needs to
    access the backend path in order to perform the disconnection and cleanup of
    the device.
    
    Fix this by making sure the control domain only cleans the frontend path,
    leaving the backend path to be cleaned by the driver domain. Note that if
    the device is not handled by a driver domain the control domain will perform
    the removal of both the frontend and the backend paths.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Reported-by: Alex Velazquez <alex.j.velazquez@gmail.com>
    Cc: Alex Velazquez <alex.j.velazquez@gmail.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: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_device.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 85a3662..8bb5e93 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -591,15 +591,15 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device *dev)
 
         if (domid =3D=3D LIBXL_TOOLSTACK_DOMID) {
             /*
-             * The toolstack domain is in charge for removing both the
-             * frontend and the backend path
+             * The toolstack domain is in charge of removing the
+             * frontend path.
              */
             libxl__xs_path_cleanup(gc, t, fe_path);
-            libxl__xs_path_cleanup(gc, t, be_path);
-        } else if (dev->backend_domid =3D=3D domid) {
+        }
+        if (dev->backend_domid =3D=3D domid) {
             /*
-             * The driver domain is in charge for removing what it can
-             * from the backend path
+             * The driver domain is in charge of removing what it can
+             * from the backend path.
              */
             libxl__xs_path_cleanup(gc, t, be_path);
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:22:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:22: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 1ZhSZr-0003za-AK; Thu, 01 Oct 2015 01:22: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 1ZhSZp-0003zK-Rm
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:29 +0000
Content-Length: 3079
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	2D/7C-12371-5DA8C065; Thu, 01 Oct 2015 01:22:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1443662547!17750977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1179 invoked from network); 1 Oct 2015 01:22:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:22:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZn-0001ic-2Q
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZm-0003be-Vv
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:27 +0000
Date: Thu, 01 Oct 2015 01:22:26 +0000
Message-Id: <E1ZhSZm-0003be-Vv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix the cleanup of the backend
	path when using driver domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3600791358696007561=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3600791358696007561==
Content-Length: 2686
Content-Transfer-Encoding: quoted-printable

commit 546678c6a60f64fb186640460dfa69a837c8fba5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Sep 23 12:06:56 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:42:50 2015 +0100

    libxl: fix the cleanup of the backend path when using driver domains
    
    With the current libxl implementation the control domain will remove both
    the frontend and the backend xenstore paths of a device that's handled by a
    driver domain. This is incorrect, since the driver domain possibly needs to
    access the backend path in order to perform the disconnection and cleanup of
    the device.
    
    Fix this by making sure the control domain only cleans the frontend path,
    leaving the backend path to be cleaned by the driver domain. Note that if
    the device is not handled by a driver domain the control domain will perform
    the removal of both the frontend and the backend paths.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Reported-by: Alex Velazquez <alex.j.velazquez@gmail.com>
    Cc: Alex Velazquez <alex.j.velazquez@gmail.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: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_device.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 85a3662..8bb5e93 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -591,15 +591,15 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device *dev)
 
         if (domid =3D=3D LIBXL_TOOLSTACK_DOMID) {
             /*
-             * The toolstack domain is in charge for removing both the
-             * frontend and the backend path
+             * The toolstack domain is in charge of removing the
+             * frontend path.
              */
             libxl__xs_path_cleanup(gc, t, fe_path);
-            libxl__xs_path_cleanup(gc, t, be_path);
-        } else if (dev->backend_domid =3D=3D domid) {
+        }
+        if (dev->backend_domid =3D=3D domid) {
             /*
-             * The driver domain is in charge for removing what it can
-             * from the backend path
+             * The driver domain is in charge of removing what it can
+             * from the backend path.
              */
             libxl__xs_path_cleanup(gc, t, be_path);
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:22:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:22: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 1ZhSa2-00040v-E0; Thu, 01 Oct 2015 01:22: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 1ZhSa1-00040j-1C
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:41 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	E8/96-18107-0EA8C065; Thu, 01 Oct 2015 01:22:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1443662557!33588037!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 20734 invoked from network); 1 Oct 2015 01:22:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:22:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZx-0001ik-FI
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZx-0003c0-BZ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:37 +0000
Date: Thu, 01 Oct 2015 01:22:37 +0000
Message-Id: <E1ZhSZx-0003c0-BZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] (lib)xl: soft reset support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c57e6ebd8c3e490e353e68d96abec1dad01e72f5
Author:     Vitaly Kuznetsov <vkuznets@redhat.com>
AuthorDate: Mon Sep 21 11:57:34 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:46:29 2015 +0100

    (lib)xl: soft reset support
    
    Use existing create/restore path to perform 'soft reset' for HVM
    domains. Tear everything down, e.g. destroy domain's device model,
    remove the domain from xenstore, save toolstack record and start
    over.
    
    Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5        |    8 ++-
 tools/libxl/libxl.c          |   22 ++++-
 tools/libxl/libxl.h          |   15 +++
 tools/libxl/libxl_create.c   |  196 ++++++++++++++++++++++++++++++++++++++----
 tools/libxl/libxl_internal.h |    4 +
 tools/libxl/libxl_types.idl  |    2 +
 tools/libxl/xl.h             |    1 +
 tools/libxl/xl_cmdimpl.c     |   25 +++++-
 8 files changed, 246 insertions(+), 27 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index db4a163..3496bdf 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -351,6 +351,12 @@ destroy the domain.
 write a "coredump" of the domain to F</var/lib/xen/dump/NAME> and then
 restart the domain.
 
+=item B<soft-reset>
+
+Reset all Xen specific interfaces for the Xen-aware HVM domain allowing
+it to reestablish these interfaces and continue executing the domain. PV
+and non-Xen-aware HVM guests are not supported.
+
 =back
 
 The default for C<on_poweroff> is C<destroy>.
@@ -372,7 +378,7 @@ Action to take if the domain crashes.  Default is C<destroy>.
 =item B<on_soft_reset="ACTION">
 
 Action to take if the domain performs 'soft reset' (e.g. does kexec).
-Default is C<restart>.
+Default is C<soft-reset>.
 
 =back
 
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d38d0c7..e4ea476 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1500,6 +1500,7 @@ void libxl__domain_destroy(libxl__egc *egc, libxl__domain_destroy_state *dds)
         dds->stubdom.ao = ao;
         dds->stubdom.domid = stubdomid;
         dds->stubdom.callback = stubdom_destroy_callback;
+        dds->stubdom.soft_reset = false;
         libxl__destroy_domid(egc, &dds->stubdom);
     } else {
         dds->stubdom_finished = 1;
@@ -1508,6 +1509,7 @@ void libxl__domain_destroy(libxl__egc *egc, libxl__domain_destroy_state *dds)
     dds->domain.ao = ao;
     dds->domain.domid = dds->domid;
     dds->domain.callback = domain_destroy_callback;
+    dds->domain.soft_reset = dds->soft_reset;
     libxl__destroy_domid(egc, &dds->domain);
 }
 
@@ -1688,10 +1690,14 @@ static void devices_destroy_cb(libxl__egc *egc,
 
     /* Clean up qemu-save and qemu-resume files. They are
      * intermediate files created by libxc. Unfortunately they
-     * don't fit in existing userdata scheme very well.
+     * don't fit in existing userdata scheme very well. In soft reset
+     * case we need to keep the file.
      */
-    rc = libxl__remove_file(gc, libxl__device_model_savefile(gc, domid));
-    if (rc < 0) goto out;
+    if (!dis->soft_reset) {
+        rc = libxl__remove_file(gc,
+                                libxl__device_model_savefile(gc, domid));
+        if (rc < 0) goto out;
+    }
     rc = libxl__remove_file(gc,
              GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%u", domid));
     if (rc < 0) goto out;
@@ -1702,7 +1708,15 @@ static void devices_destroy_cb(libxl__egc *egc,
         ctx->xch = xc_interface_open(ctx->lg,0,0);
         if (!ctx->xch) goto badchild;
 
-        rc = xc_domain_destroy(ctx->xch, domid);
+        if (!dis->soft_reset) {
+            rc = xc_domain_destroy(ctx->xch, domid);
+        } else {
+            rc = xc_domain_pause(ctx->xch, domid);
+            if (rc < 0) goto badchild;
+            rc = xc_domain_soft_reset(ctx->xch, domid);
+            if (rc < 0) goto badchild;
+            rc = xc_domain_unpause(ctx->xch, domid);
+        }
         if (rc < 0) goto badchild;
         _exit(0);
 
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 5f9047c..4ee9fbf 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -205,6 +205,13 @@
 #define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
 
 /*
+ * LIBXL_HAVE_SOFT_RESET indicates that libxl supports performing
+ * 'soft reset' for domains and there is 'soft_reset' shutdown reason
+ * in enum libxl_shutdown_reason.
+ */
+#define LIBXL_HAVE_SOFT_RESET 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
@@ -1132,6 +1139,14 @@ int static inline libxl_domain_create_restore_0x040200(
 
 #endif
 
+int libxl_domain_soft_reset(libxl_ctx *ctx,
+                            libxl_domain_config *d_config,
+                            uint32_t domid,
+                            const libxl_asyncop_how *ao_how,
+                            const libxl_asyncprogress_how
+                            *aop_console_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+
   /* A progress report will be made via ao_console_how, of type
    * domain_create_console_available, when the domain's primary
    * console is available and can be connected to.
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index f5771da..bf2099b 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -496,8 +496,6 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
     /* convenience aliases */
     libxl_domain_create_info *info = &d_config->c_info;
 
-    assert(!libxl_domid_valid_guest(*domid));
-
     uuid_string = libxl__uuid2string(gc, info->uuid);
     if (!uuid_string) {
         rc = ERROR_NOMEM;
@@ -518,7 +516,6 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         }
         flags |= XEN_DOMCTL_CDF_hap;
     }
-    *domid = -1;
 
     /* Ultimately, handle is an array of 16 uint8_t, same as uuid */
     libxl_uuid_copy(ctx, (libxl_uuid *)handle, &info->uuid);
@@ -530,13 +527,17 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         goto out;
     }
 
-    ret = xc_domain_create_config(ctx->xch, info->ssidref,
-                                  handle, flags, domid,
-                                  xc_config);
-    if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain creation fail");
-        rc = ERROR_FAIL;
-        goto out;
+    /* Valid domid here means we're soft resetting. */
+    if (!libxl_domid_valid_guest(*domid)) {
+        ret = xc_domain_create_config(ctx->xch, info->ssidref,
+                                      handle, flags, domid,
+                                      xc_config);
+        if (ret < 0) {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                             "domain creation fail");
+            rc = ERROR_FAIL;
+            goto out;
+        }
     }
 
     rc = libxl__arch_domain_save_config(gc, d_config, xc_config);
@@ -771,9 +772,8 @@ static void initiate_domain_create(libxl__egc *egc,
     libxl_domain_config *const d_config = dcs->guest_config;
     libxl__domain_build_state *const state = &dcs->build_state;
     const int restore_fd = dcs->restore_fd;
-    memset(&dcs->build_state, 0, sizeof(dcs->build_state));
 
-    domid = 0;
+    domid = dcs->domid_soft_reset;
 
     if (d_config->c_info.ssid_label) {
         char *s = d_config->c_info.ssid_label;
@@ -938,7 +938,7 @@ static void initiate_domain_create(libxl__egc *egc,
             d_config->nics[i].devid = ++last_devid;
     }
 
-    if (restore_fd >= 0) {
+    if (restore_fd >= 0 || dcs->domid_soft_reset != INVALID_DOMID) {
         LOG(DEBUG, "restoring, not running bootloader");
         domcreate_bootloader_done(egc, &dcs->bl, 0);
     } else  {
@@ -1011,7 +1011,7 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     dcs->dmss.dm.callback = domcreate_devmodel_started;
     dcs->dmss.callback = domcreate_devmodel_started;
 
-    if ( restore_fd < 0 ) {
+    if (restore_fd < 0 && dcs->domid_soft_reset == INVALID_DOMID) {
         rc = libxl__domain_build(gc, d_config, domid, state);
         domcreate_rebuild_done(egc, dcs, rc);
         return;
@@ -1031,8 +1031,10 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     dcs->srs.completion_callback = domcreate_stream_done;
     dcs->srs.checkpoint_callback = remus_checkpoint_stream_done;
 
-    libxl__stream_read_start(egc, &dcs->srs);
-    return;
+    if (restore_fd >= 0) {
+        libxl__stream_read_start(egc, &dcs->srs);
+        return;
+    }
 
  out:
     domcreate_stream_done(egc, &dcs->srs, rc);
@@ -1121,9 +1123,12 @@ out:
         libxl__file_reference_unmap(&state->pv_ramdisk);
     }
 
-    esave = errno;
-    libxl_fd_set_nonblock(ctx, fd, 0);
-    errno = esave;
+    /* fd == -1 here means we're doing soft reset. */
+    if (fd != -1) {
+        esave = errno;
+        libxl_fd_set_nonblock(ctx, fd, 0);
+        errno = esave;
+    }
     domcreate_rebuild_done(egc, dcs, ret);
 }
 
@@ -1544,6 +1549,14 @@ typedef struct {
     uint32_t *domid_out;
 } libxl__app_domain_create_state;
 
+typedef struct {
+    libxl__app_domain_create_state cdcs;
+    libxl__domain_destroy_state dds;
+    libxl__domain_suspend_state dss;
+    char *toolstack_buf;
+    uint32_t toolstack_len;
+} libxl__domain_soft_reset_state;
+
 static void domain_create_cb(libxl__egc *egc,
                              libxl__domain_create_state *dcs,
                              int rc, uint32_t domid);
@@ -1572,6 +1585,7 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
         if (rc < 0) goto out_err;
     }
     cdcs->dcs.callback = domain_create_cb;
+    cdcs->dcs.domid_soft_reset = INVALID_DOMID;
     libxl__ao_progress_gethow(&cdcs->dcs.aop_console_how, aop_console_how);
     cdcs->domid_out = domid;
 
@@ -1584,6 +1598,135 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
 
 }
 
+static void domain_soft_reset_cb(libxl__egc *egc,
+                                 libxl__domain_destroy_state *dds,
+                                 int rc)
+{
+    STATE_AO_GC(dds->ao);
+    libxl__domain_soft_reset_state *srs = CONTAINER_OF(dds, *srs, dds);
+    libxl__app_domain_create_state *cdcs = &srs->cdcs;
+    char *savefile, *restorefile;
+
+    if (rc) {
+        LOG(ERROR, "destruction of domain %u failed.", dds->domid);
+        goto error;
+    }
+
+    cdcs->dcs.guest_domid = dds->domid;
+    rc = libxl__restore_emulator_xenstore_data(&cdcs->dcs, srs->toolstack_buf,
+                                               srs->toolstack_len);
+    if (rc) {
+        LOG(ERROR, "failed to restore toolstack record.");
+        goto error;
+    }
+
+    savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d", dds->domid);
+    restorefile = GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%d", dds->domid);
+    rc = rename(savefile, restorefile);
+    if (rc) {
+        LOG(ERROR, "failed to rename dm save file.");
+        goto error;
+    }
+
+    initiate_domain_create(egc, &cdcs->dcs);
+    return;
+
+error:
+    domcreate_complete(egc, &cdcs->dcs, rc);
+}
+
+static int do_domain_soft_reset(libxl_ctx *ctx,
+                                libxl_domain_config *d_config,
+                                uint32_t domid_soft_reset,
+                                const libxl_asyncop_how *ao_how,
+                                const libxl_asyncprogress_how
+                                *aop_console_how)
+{
+    AO_CREATE(ctx, 0, ao_how);
+    libxl__domain_soft_reset_state *srs;
+    libxl__app_domain_create_state *cdcs;
+    libxl__domain_create_state *dcs;
+    libxl__domain_build_state *state;
+    libxl__domain_suspend_state *dss;
+    char *dom_path, *xs_store_mfn, *xs_console_mfn;
+    uint32_t domid_out;
+    int rc;
+
+    GCNEW(srs);
+    cdcs = &srs->cdcs;
+    dcs = &cdcs->dcs;
+    state = &dcs->build_state;
+    dss = &srs->dss;
+
+    srs->cdcs.dcs.ao = ao;
+    srs->cdcs.dcs.guest_config = d_config;
+    libxl_domain_config_init(&srs->cdcs.dcs.guest_config_saved);
+    libxl_domain_config_copy(ctx, &srs->cdcs.dcs.guest_config_saved,
+                             d_config);
+    cdcs->dcs.restore_fd = -1;
+    cdcs->dcs.domid_soft_reset = domid_soft_reset;
+    cdcs->dcs.callback = domain_create_cb;
+    libxl__ao_progress_gethow(&srs->cdcs.dcs.aop_console_how,
+                              aop_console_how);
+    cdcs->domid_out = &domid_out;
+
+    dom_path = libxl__xs_get_dompath(gc, domid_soft_reset);
+    if (!dom_path) {
+        LOG(ERROR, "failed to read domain path");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    xs_store_mfn = xs_read(ctx->xsh, XBT_NULL,
+                           GCSPRINTF("%s/store/ring-ref", dom_path),
+                           NULL);
+    state->store_mfn = xs_store_mfn ? atol(xs_store_mfn): 0;
+    free(xs_store_mfn);
+
+    xs_console_mfn = xs_read(ctx->xsh, XBT_NULL,
+                             GCSPRINTF("%s/console/ring-ref", dom_path),
+                             NULL);
+    state->console_mfn = xs_console_mfn ? atol(xs_console_mfn): 0;
+    free(xs_console_mfn);
+
+    dss->ao = ao;
+    dss->domid = domid_soft_reset;
+    dss->dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
+                                 domid_soft_reset);
+
+    rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
+                                            &srs->toolstack_len);
+    if (rc) {
+        LOG(ERROR, "failed to save toolstack record.");
+        goto out;
+    }
+
+    rc = libxl__domain_suspend_device_model(gc, dss);
+    if (rc) {
+        LOG(ERROR, "failed to suspend device model.");
+        goto out;
+    }
+
+    /*
+     * Ask all backends to disconnect by removing the domain from
+     * xenstore. On the creation path the domain will be introduced to
+     * xenstore again with probably different store/console/...
+     * channels.
+     */
+    xs_release_domain(ctx->xsh, cdcs->dcs.domid_soft_reset);
+
+    srs->dds.ao = ao;
+    srs->dds.domid = domid_soft_reset;
+    srs->dds.callback = domain_soft_reset_cb;
+    srs->dds.soft_reset = true;
+    libxl__domain_destroy(egc, &srs->dds);
+
+    return AO_INPROGRESS;
+
+ out:
+    return AO_CREATE_FAIL(rc);
+}
+
 static void domain_create_cb(libxl__egc *egc,
                              libxl__domain_create_state *dcs,
                              int rc, uint32_t domid)
@@ -1626,6 +1769,21 @@ int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
                             ao_how, aop_console_how);
 }
 
+int libxl_domain_soft_reset(libxl_ctx *ctx,
+                            libxl_domain_config *d_config,
+                            uint32_t domid,
+                            const libxl_asyncop_how *ao_how,
+                            const libxl_asyncprogress_how
+                            *aop_console_how)
+{
+    libxl_domain_build_info *const info = &d_config->b_info;
+
+    if (info->type != LIBXL_DOMAIN_TYPE_HVM) return ERROR_INVAL;
+
+    return do_domain_soft_reset(ctx, d_config, domid, ao_how,
+                                aop_console_how);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5fa55a7..57cbf38 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -111,6 +111,7 @@
 #define STUBDOM_SPECIAL_CONSOLES 3
 #define TAP_DEVICE_SUFFIX "-emu"
 #define DOMID_XS_PATH "domid"
+#define INVALID_DOMID ~0
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 
@@ -3226,6 +3227,7 @@ struct libxl__destroy_domid_state {
     /* private to implementation */
     libxl__devices_remove_state drs;
     libxl__ev_child destroyer;
+    bool soft_reset;
 };
 
 struct libxl__domain_destroy_state {
@@ -3240,6 +3242,7 @@ struct libxl__domain_destroy_state {
     int stubdom_finished;
     libxl__destroy_domid_state domain;
     int domain_finished;
+    bool soft_reset;
 };
 
 /*
@@ -3405,6 +3408,7 @@ struct libxl__domain_create_state {
     int restore_fd, libxc_fd;
     int restore_fdfl; /* original flags of restore_fd */
     libxl_domain_restore_params restore_params;
+    uint32_t domid_soft_reset;
     libxl__domain_create_cb *callback;
     libxl_asyncprogress_how aop_console_how;
     /* private to domain_create */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9f6ec00..87d8255 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -138,6 +138,8 @@ libxl_action_on_shutdown = Enumeration("action_on_shutdown", [
 
     (5, "COREDUMP_DESTROY"),
     (6, "COREDUMP_RESTART"),
+
+    (7, "SOFT_RESET"),
     ], init_val = "LIBXL_ACTION_ON_SHUTDOWN_DESTROY")
 
 libxl_trigger = Enumeration("trigger", [
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 6c19c0d..0021112 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -194,6 +194,7 @@ typedef enum {
     DOMAIN_RESTART_NONE = 0,     /* No domain restart */
     DOMAIN_RESTART_NORMAL,       /* Domain should be restarted */
     DOMAIN_RESTART_RENAME,       /* Domain should be renamed and restarted */
+    DOMAIN_RESTART_SOFT_RESET,   /* Soft reset should be performed */
 } domain_restart_type;
 
 extern void printf_info_sexp(int domid, libxl_domain_config *d_config, FILE *fh);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2706759..7db08a3 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -133,6 +133,8 @@ static const char *action_on_shutdown_names[] = {
 
     [LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_DESTROY] = "coredump-destroy",
     [LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_RESTART] = "coredump-restart",
+
+    [LIBXL_ACTION_ON_SHUTDOWN_SOFT_RESET] = "soft-reset",
 };
 
 /* Optional data, in order:
@@ -1423,7 +1425,7 @@ static void parse_config_data(const char *config_source,
     }
 
     if (xlu_cfg_get_string (config, "on_soft_reset", &buf, 0))
-        buf = "restart";
+        buf = "soft-reset";
     if (!parse_action_on_shutdown(buf, &d_config->on_soft_reset)) {
         fprintf(stderr, "Unknown on_soft_reset action \"%s\" specified\n", buf);
         exit(1);
@@ -2490,6 +2492,11 @@ static domain_restart_type handle_domain_death(uint32_t *r_domid,
         *r_domid = INVALID_DOMID;
         break;
 
+    case LIBXL_ACTION_ON_SHUTDOWN_SOFT_RESET:
+        reload_domain_config(*r_domid, d_config);
+        restart = DOMAIN_RESTART_SOFT_RESET;
+        break;
+
     case LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_DESTROY:
     case LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_RESTART:
         /* Already handled these above. */
@@ -2666,6 +2673,7 @@ static uint32_t create_domain(struct domain_create *dom_info)
     int restore_fd_to_close = -1;
     const libxl_asyncprogress_how *autoconnect_console_how;
     struct save_file_header hdr;
+    uint32_t domid_soft_reset = INVALID_DOMID;
 
     int restoring = (restore_file || (migrate_fd >= 0));
 
@@ -2880,7 +2888,13 @@ start:
          * restore/migrate-receive it again.
          */
         restoring = 0;
-    }else{
+    } else if (domid_soft_reset != INVALID_DOMID) {
+        /* Do soft reset. */
+        ret = libxl_domain_soft_reset(ctx, &d_config, domid_soft_reset,
+                                      0, autoconnect_console_how);
+        domid = domid_soft_reset;
+        domid_soft_reset = INVALID_DOMID;
+    } else {
         ret = libxl_domain_create_new(ctx, &d_config, &domid,
                                       0, autoconnect_console_how);
     }
@@ -2948,8 +2962,13 @@ start:
                 event->u.domain_shutdown.shutdown_reason,
                 event->u.domain_shutdown.shutdown_reason);
             switch (handle_domain_death(&domid, event, &d_config)) {
+            case DOMAIN_RESTART_SOFT_RESET:
+                domid_soft_reset = domid;
+                domid = INVALID_DOMID;
+                /* fall through */
             case DOMAIN_RESTART_RENAME:
-                if (!preserve_domain(&domid, event, &d_config)) {
+                if (domid_soft_reset == INVALID_DOMID &&
+                    !preserve_domain(&domid, event, &d_config)) {
                     /* If we fail then exit leaving the old domain in place. */
                     ret = -1;
                     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 Oct 01 01:22:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:22: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 1ZhSa2-00040v-E0; Thu, 01 Oct 2015 01:22: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 1ZhSa1-00040j-1C
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:41 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	E8/96-18107-0EA8C065; Thu, 01 Oct 2015 01:22:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1443662557!33588037!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 20734 invoked from network); 1 Oct 2015 01:22:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:22:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZx-0001ik-FI
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSZx-0003c0-BZ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:37 +0000
Date: Thu, 01 Oct 2015 01:22:37 +0000
Message-Id: <E1ZhSZx-0003c0-BZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] (lib)xl: soft reset support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c57e6ebd8c3e490e353e68d96abec1dad01e72f5
Author:     Vitaly Kuznetsov <vkuznets@redhat.com>
AuthorDate: Mon Sep 21 11:57:34 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:46:29 2015 +0100

    (lib)xl: soft reset support
    
    Use existing create/restore path to perform 'soft reset' for HVM
    domains. Tear everything down, e.g. destroy domain's device model,
    remove the domain from xenstore, save toolstack record and start
    over.
    
    Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5        |    8 ++-
 tools/libxl/libxl.c          |   22 ++++-
 tools/libxl/libxl.h          |   15 +++
 tools/libxl/libxl_create.c   |  196 ++++++++++++++++++++++++++++++++++++++----
 tools/libxl/libxl_internal.h |    4 +
 tools/libxl/libxl_types.idl  |    2 +
 tools/libxl/xl.h             |    1 +
 tools/libxl/xl_cmdimpl.c     |   25 +++++-
 8 files changed, 246 insertions(+), 27 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index db4a163..3496bdf 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -351,6 +351,12 @@ destroy the domain.
 write a "coredump" of the domain to F</var/lib/xen/dump/NAME> and then
 restart the domain.
 
+=item B<soft-reset>
+
+Reset all Xen specific interfaces for the Xen-aware HVM domain allowing
+it to reestablish these interfaces and continue executing the domain. PV
+and non-Xen-aware HVM guests are not supported.
+
 =back
 
 The default for C<on_poweroff> is C<destroy>.
@@ -372,7 +378,7 @@ Action to take if the domain crashes.  Default is C<destroy>.
 =item B<on_soft_reset="ACTION">
 
 Action to take if the domain performs 'soft reset' (e.g. does kexec).
-Default is C<restart>.
+Default is C<soft-reset>.
 
 =back
 
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d38d0c7..e4ea476 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1500,6 +1500,7 @@ void libxl__domain_destroy(libxl__egc *egc, libxl__domain_destroy_state *dds)
         dds->stubdom.ao = ao;
         dds->stubdom.domid = stubdomid;
         dds->stubdom.callback = stubdom_destroy_callback;
+        dds->stubdom.soft_reset = false;
         libxl__destroy_domid(egc, &dds->stubdom);
     } else {
         dds->stubdom_finished = 1;
@@ -1508,6 +1509,7 @@ void libxl__domain_destroy(libxl__egc *egc, libxl__domain_destroy_state *dds)
     dds->domain.ao = ao;
     dds->domain.domid = dds->domid;
     dds->domain.callback = domain_destroy_callback;
+    dds->domain.soft_reset = dds->soft_reset;
     libxl__destroy_domid(egc, &dds->domain);
 }
 
@@ -1688,10 +1690,14 @@ static void devices_destroy_cb(libxl__egc *egc,
 
     /* Clean up qemu-save and qemu-resume files. They are
      * intermediate files created by libxc. Unfortunately they
-     * don't fit in existing userdata scheme very well.
+     * don't fit in existing userdata scheme very well. In soft reset
+     * case we need to keep the file.
      */
-    rc = libxl__remove_file(gc, libxl__device_model_savefile(gc, domid));
-    if (rc < 0) goto out;
+    if (!dis->soft_reset) {
+        rc = libxl__remove_file(gc,
+                                libxl__device_model_savefile(gc, domid));
+        if (rc < 0) goto out;
+    }
     rc = libxl__remove_file(gc,
              GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%u", domid));
     if (rc < 0) goto out;
@@ -1702,7 +1708,15 @@ static void devices_destroy_cb(libxl__egc *egc,
         ctx->xch = xc_interface_open(ctx->lg,0,0);
         if (!ctx->xch) goto badchild;
 
-        rc = xc_domain_destroy(ctx->xch, domid);
+        if (!dis->soft_reset) {
+            rc = xc_domain_destroy(ctx->xch, domid);
+        } else {
+            rc = xc_domain_pause(ctx->xch, domid);
+            if (rc < 0) goto badchild;
+            rc = xc_domain_soft_reset(ctx->xch, domid);
+            if (rc < 0) goto badchild;
+            rc = xc_domain_unpause(ctx->xch, domid);
+        }
         if (rc < 0) goto badchild;
         _exit(0);
 
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 5f9047c..4ee9fbf 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -205,6 +205,13 @@
 #define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
 
 /*
+ * LIBXL_HAVE_SOFT_RESET indicates that libxl supports performing
+ * 'soft reset' for domains and there is 'soft_reset' shutdown reason
+ * in enum libxl_shutdown_reason.
+ */
+#define LIBXL_HAVE_SOFT_RESET 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
@@ -1132,6 +1139,14 @@ int static inline libxl_domain_create_restore_0x040200(
 
 #endif
 
+int libxl_domain_soft_reset(libxl_ctx *ctx,
+                            libxl_domain_config *d_config,
+                            uint32_t domid,
+                            const libxl_asyncop_how *ao_how,
+                            const libxl_asyncprogress_how
+                            *aop_console_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+
   /* A progress report will be made via ao_console_how, of type
    * domain_create_console_available, when the domain's primary
    * console is available and can be connected to.
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index f5771da..bf2099b 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -496,8 +496,6 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
     /* convenience aliases */
     libxl_domain_create_info *info = &d_config->c_info;
 
-    assert(!libxl_domid_valid_guest(*domid));
-
     uuid_string = libxl__uuid2string(gc, info->uuid);
     if (!uuid_string) {
         rc = ERROR_NOMEM;
@@ -518,7 +516,6 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         }
         flags |= XEN_DOMCTL_CDF_hap;
     }
-    *domid = -1;
 
     /* Ultimately, handle is an array of 16 uint8_t, same as uuid */
     libxl_uuid_copy(ctx, (libxl_uuid *)handle, &info->uuid);
@@ -530,13 +527,17 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         goto out;
     }
 
-    ret = xc_domain_create_config(ctx->xch, info->ssidref,
-                                  handle, flags, domid,
-                                  xc_config);
-    if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain creation fail");
-        rc = ERROR_FAIL;
-        goto out;
+    /* Valid domid here means we're soft resetting. */
+    if (!libxl_domid_valid_guest(*domid)) {
+        ret = xc_domain_create_config(ctx->xch, info->ssidref,
+                                      handle, flags, domid,
+                                      xc_config);
+        if (ret < 0) {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                             "domain creation fail");
+            rc = ERROR_FAIL;
+            goto out;
+        }
     }
 
     rc = libxl__arch_domain_save_config(gc, d_config, xc_config);
@@ -771,9 +772,8 @@ static void initiate_domain_create(libxl__egc *egc,
     libxl_domain_config *const d_config = dcs->guest_config;
     libxl__domain_build_state *const state = &dcs->build_state;
     const int restore_fd = dcs->restore_fd;
-    memset(&dcs->build_state, 0, sizeof(dcs->build_state));
 
-    domid = 0;
+    domid = dcs->domid_soft_reset;
 
     if (d_config->c_info.ssid_label) {
         char *s = d_config->c_info.ssid_label;
@@ -938,7 +938,7 @@ static void initiate_domain_create(libxl__egc *egc,
             d_config->nics[i].devid = ++last_devid;
     }
 
-    if (restore_fd >= 0) {
+    if (restore_fd >= 0 || dcs->domid_soft_reset != INVALID_DOMID) {
         LOG(DEBUG, "restoring, not running bootloader");
         domcreate_bootloader_done(egc, &dcs->bl, 0);
     } else  {
@@ -1011,7 +1011,7 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     dcs->dmss.dm.callback = domcreate_devmodel_started;
     dcs->dmss.callback = domcreate_devmodel_started;
 
-    if ( restore_fd < 0 ) {
+    if (restore_fd < 0 && dcs->domid_soft_reset == INVALID_DOMID) {
         rc = libxl__domain_build(gc, d_config, domid, state);
         domcreate_rebuild_done(egc, dcs, rc);
         return;
@@ -1031,8 +1031,10 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     dcs->srs.completion_callback = domcreate_stream_done;
     dcs->srs.checkpoint_callback = remus_checkpoint_stream_done;
 
-    libxl__stream_read_start(egc, &dcs->srs);
-    return;
+    if (restore_fd >= 0) {
+        libxl__stream_read_start(egc, &dcs->srs);
+        return;
+    }
 
  out:
     domcreate_stream_done(egc, &dcs->srs, rc);
@@ -1121,9 +1123,12 @@ out:
         libxl__file_reference_unmap(&state->pv_ramdisk);
     }
 
-    esave = errno;
-    libxl_fd_set_nonblock(ctx, fd, 0);
-    errno = esave;
+    /* fd == -1 here means we're doing soft reset. */
+    if (fd != -1) {
+        esave = errno;
+        libxl_fd_set_nonblock(ctx, fd, 0);
+        errno = esave;
+    }
     domcreate_rebuild_done(egc, dcs, ret);
 }
 
@@ -1544,6 +1549,14 @@ typedef struct {
     uint32_t *domid_out;
 } libxl__app_domain_create_state;
 
+typedef struct {
+    libxl__app_domain_create_state cdcs;
+    libxl__domain_destroy_state dds;
+    libxl__domain_suspend_state dss;
+    char *toolstack_buf;
+    uint32_t toolstack_len;
+} libxl__domain_soft_reset_state;
+
 static void domain_create_cb(libxl__egc *egc,
                              libxl__domain_create_state *dcs,
                              int rc, uint32_t domid);
@@ -1572,6 +1585,7 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
         if (rc < 0) goto out_err;
     }
     cdcs->dcs.callback = domain_create_cb;
+    cdcs->dcs.domid_soft_reset = INVALID_DOMID;
     libxl__ao_progress_gethow(&cdcs->dcs.aop_console_how, aop_console_how);
     cdcs->domid_out = domid;
 
@@ -1584,6 +1598,135 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
 
 }
 
+static void domain_soft_reset_cb(libxl__egc *egc,
+                                 libxl__domain_destroy_state *dds,
+                                 int rc)
+{
+    STATE_AO_GC(dds->ao);
+    libxl__domain_soft_reset_state *srs = CONTAINER_OF(dds, *srs, dds);
+    libxl__app_domain_create_state *cdcs = &srs->cdcs;
+    char *savefile, *restorefile;
+
+    if (rc) {
+        LOG(ERROR, "destruction of domain %u failed.", dds->domid);
+        goto error;
+    }
+
+    cdcs->dcs.guest_domid = dds->domid;
+    rc = libxl__restore_emulator_xenstore_data(&cdcs->dcs, srs->toolstack_buf,
+                                               srs->toolstack_len);
+    if (rc) {
+        LOG(ERROR, "failed to restore toolstack record.");
+        goto error;
+    }
+
+    savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d", dds->domid);
+    restorefile = GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%d", dds->domid);
+    rc = rename(savefile, restorefile);
+    if (rc) {
+        LOG(ERROR, "failed to rename dm save file.");
+        goto error;
+    }
+
+    initiate_domain_create(egc, &cdcs->dcs);
+    return;
+
+error:
+    domcreate_complete(egc, &cdcs->dcs, rc);
+}
+
+static int do_domain_soft_reset(libxl_ctx *ctx,
+                                libxl_domain_config *d_config,
+                                uint32_t domid_soft_reset,
+                                const libxl_asyncop_how *ao_how,
+                                const libxl_asyncprogress_how
+                                *aop_console_how)
+{
+    AO_CREATE(ctx, 0, ao_how);
+    libxl__domain_soft_reset_state *srs;
+    libxl__app_domain_create_state *cdcs;
+    libxl__domain_create_state *dcs;
+    libxl__domain_build_state *state;
+    libxl__domain_suspend_state *dss;
+    char *dom_path, *xs_store_mfn, *xs_console_mfn;
+    uint32_t domid_out;
+    int rc;
+
+    GCNEW(srs);
+    cdcs = &srs->cdcs;
+    dcs = &cdcs->dcs;
+    state = &dcs->build_state;
+    dss = &srs->dss;
+
+    srs->cdcs.dcs.ao = ao;
+    srs->cdcs.dcs.guest_config = d_config;
+    libxl_domain_config_init(&srs->cdcs.dcs.guest_config_saved);
+    libxl_domain_config_copy(ctx, &srs->cdcs.dcs.guest_config_saved,
+                             d_config);
+    cdcs->dcs.restore_fd = -1;
+    cdcs->dcs.domid_soft_reset = domid_soft_reset;
+    cdcs->dcs.callback = domain_create_cb;
+    libxl__ao_progress_gethow(&srs->cdcs.dcs.aop_console_how,
+                              aop_console_how);
+    cdcs->domid_out = &domid_out;
+
+    dom_path = libxl__xs_get_dompath(gc, domid_soft_reset);
+    if (!dom_path) {
+        LOG(ERROR, "failed to read domain path");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    xs_store_mfn = xs_read(ctx->xsh, XBT_NULL,
+                           GCSPRINTF("%s/store/ring-ref", dom_path),
+                           NULL);
+    state->store_mfn = xs_store_mfn ? atol(xs_store_mfn): 0;
+    free(xs_store_mfn);
+
+    xs_console_mfn = xs_read(ctx->xsh, XBT_NULL,
+                             GCSPRINTF("%s/console/ring-ref", dom_path),
+                             NULL);
+    state->console_mfn = xs_console_mfn ? atol(xs_console_mfn): 0;
+    free(xs_console_mfn);
+
+    dss->ao = ao;
+    dss->domid = domid_soft_reset;
+    dss->dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
+                                 domid_soft_reset);
+
+    rc = libxl__save_emulator_xenstore_data(dss, &srs->toolstack_buf,
+                                            &srs->toolstack_len);
+    if (rc) {
+        LOG(ERROR, "failed to save toolstack record.");
+        goto out;
+    }
+
+    rc = libxl__domain_suspend_device_model(gc, dss);
+    if (rc) {
+        LOG(ERROR, "failed to suspend device model.");
+        goto out;
+    }
+
+    /*
+     * Ask all backends to disconnect by removing the domain from
+     * xenstore. On the creation path the domain will be introduced to
+     * xenstore again with probably different store/console/...
+     * channels.
+     */
+    xs_release_domain(ctx->xsh, cdcs->dcs.domid_soft_reset);
+
+    srs->dds.ao = ao;
+    srs->dds.domid = domid_soft_reset;
+    srs->dds.callback = domain_soft_reset_cb;
+    srs->dds.soft_reset = true;
+    libxl__domain_destroy(egc, &srs->dds);
+
+    return AO_INPROGRESS;
+
+ out:
+    return AO_CREATE_FAIL(rc);
+}
+
 static void domain_create_cb(libxl__egc *egc,
                              libxl__domain_create_state *dcs,
                              int rc, uint32_t domid)
@@ -1626,6 +1769,21 @@ int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
                             ao_how, aop_console_how);
 }
 
+int libxl_domain_soft_reset(libxl_ctx *ctx,
+                            libxl_domain_config *d_config,
+                            uint32_t domid,
+                            const libxl_asyncop_how *ao_how,
+                            const libxl_asyncprogress_how
+                            *aop_console_how)
+{
+    libxl_domain_build_info *const info = &d_config->b_info;
+
+    if (info->type != LIBXL_DOMAIN_TYPE_HVM) return ERROR_INVAL;
+
+    return do_domain_soft_reset(ctx, d_config, domid, ao_how,
+                                aop_console_how);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5fa55a7..57cbf38 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -111,6 +111,7 @@
 #define STUBDOM_SPECIAL_CONSOLES 3
 #define TAP_DEVICE_SUFFIX "-emu"
 #define DOMID_XS_PATH "domid"
+#define INVALID_DOMID ~0
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 
@@ -3226,6 +3227,7 @@ struct libxl__destroy_domid_state {
     /* private to implementation */
     libxl__devices_remove_state drs;
     libxl__ev_child destroyer;
+    bool soft_reset;
 };
 
 struct libxl__domain_destroy_state {
@@ -3240,6 +3242,7 @@ struct libxl__domain_destroy_state {
     int stubdom_finished;
     libxl__destroy_domid_state domain;
     int domain_finished;
+    bool soft_reset;
 };
 
 /*
@@ -3405,6 +3408,7 @@ struct libxl__domain_create_state {
     int restore_fd, libxc_fd;
     int restore_fdfl; /* original flags of restore_fd */
     libxl_domain_restore_params restore_params;
+    uint32_t domid_soft_reset;
     libxl__domain_create_cb *callback;
     libxl_asyncprogress_how aop_console_how;
     /* private to domain_create */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9f6ec00..87d8255 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -138,6 +138,8 @@ libxl_action_on_shutdown = Enumeration("action_on_shutdown", [
 
     (5, "COREDUMP_DESTROY"),
     (6, "COREDUMP_RESTART"),
+
+    (7, "SOFT_RESET"),
     ], init_val = "LIBXL_ACTION_ON_SHUTDOWN_DESTROY")
 
 libxl_trigger = Enumeration("trigger", [
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 6c19c0d..0021112 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -194,6 +194,7 @@ typedef enum {
     DOMAIN_RESTART_NONE = 0,     /* No domain restart */
     DOMAIN_RESTART_NORMAL,       /* Domain should be restarted */
     DOMAIN_RESTART_RENAME,       /* Domain should be renamed and restarted */
+    DOMAIN_RESTART_SOFT_RESET,   /* Soft reset should be performed */
 } domain_restart_type;
 
 extern void printf_info_sexp(int domid, libxl_domain_config *d_config, FILE *fh);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2706759..7db08a3 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -133,6 +133,8 @@ static const char *action_on_shutdown_names[] = {
 
     [LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_DESTROY] = "coredump-destroy",
     [LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_RESTART] = "coredump-restart",
+
+    [LIBXL_ACTION_ON_SHUTDOWN_SOFT_RESET] = "soft-reset",
 };
 
 /* Optional data, in order:
@@ -1423,7 +1425,7 @@ static void parse_config_data(const char *config_source,
     }
 
     if (xlu_cfg_get_string (config, "on_soft_reset", &buf, 0))
-        buf = "restart";
+        buf = "soft-reset";
     if (!parse_action_on_shutdown(buf, &d_config->on_soft_reset)) {
         fprintf(stderr, "Unknown on_soft_reset action \"%s\" specified\n", buf);
         exit(1);
@@ -2490,6 +2492,11 @@ static domain_restart_type handle_domain_death(uint32_t *r_domid,
         *r_domid = INVALID_DOMID;
         break;
 
+    case LIBXL_ACTION_ON_SHUTDOWN_SOFT_RESET:
+        reload_domain_config(*r_domid, d_config);
+        restart = DOMAIN_RESTART_SOFT_RESET;
+        break;
+
     case LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_DESTROY:
     case LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_RESTART:
         /* Already handled these above. */
@@ -2666,6 +2673,7 @@ static uint32_t create_domain(struct domain_create *dom_info)
     int restore_fd_to_close = -1;
     const libxl_asyncprogress_how *autoconnect_console_how;
     struct save_file_header hdr;
+    uint32_t domid_soft_reset = INVALID_DOMID;
 
     int restoring = (restore_file || (migrate_fd >= 0));
 
@@ -2880,7 +2888,13 @@ start:
          * restore/migrate-receive it again.
          */
         restoring = 0;
-    }else{
+    } else if (domid_soft_reset != INVALID_DOMID) {
+        /* Do soft reset. */
+        ret = libxl_domain_soft_reset(ctx, &d_config, domid_soft_reset,
+                                      0, autoconnect_console_how);
+        domid = domid_soft_reset;
+        domid_soft_reset = INVALID_DOMID;
+    } else {
         ret = libxl_domain_create_new(ctx, &d_config, &domid,
                                       0, autoconnect_console_how);
     }
@@ -2948,8 +2962,13 @@ start:
                 event->u.domain_shutdown.shutdown_reason,
                 event->u.domain_shutdown.shutdown_reason);
             switch (handle_domain_death(&domid, event, &d_config)) {
+            case DOMAIN_RESTART_SOFT_RESET:
+                domid_soft_reset = domid;
+                domid = INVALID_DOMID;
+                /* fall through */
             case DOMAIN_RESTART_RENAME:
-                if (!preserve_domain(&domid, event, &d_config)) {
+                if (domid_soft_reset == INVALID_DOMID &&
+                    !preserve_domain(&domid, event, &d_config)) {
                     /* If we fail then exit leaving the old domain in place. */
                     ret = -1;
                     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 Oct 01 01:22:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:22: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 1ZhSaB-00042h-JQ; Thu, 01 Oct 2015 01:22:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSaA-00042N-2O
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:50 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	BF/52-10422-9EA8C065; Thu, 01 Oct 2015 01:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1443662567!6869856!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 24126 invoked from network); 1 Oct 2015 01:22:48 -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;
	1 Oct 2015 01:22:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSa7-0001is-Oo
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSa7-0003cs-Mq
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:47 +0000
Date: Thu, 01 Oct 2015 01:22:47 +0000
Message-Id: <E1ZhSa7-0003cs-Mq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic-v3: Clean-up the
	GIC*_PIDR2_* definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 55e8b12a5c054dfdf5feee1c3a84ffdfc2d38c83
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Sep 14 16:32:23 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:47:52 2015 +0100

    xen/arm: gic-v3: Clean-up the GIC*_PIDR2_* definitions
    
    GICR_PIDR2 and GICD_PIDR2 use the same register layout. Rather than
    define twice, one of which is an alias to the other, introduce GIC_PIDR2_*
    defines.
    
    Also:
        * Use the same prefix for the mask and the value
        * Integrate the shift in the value to avoid shifting in the code
        * Use GICv* to match the value name in the spec
        * Move them in a proper place
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic-v3.c             |    8 ++++----
 xen/include/asm-arm/gic_v3_defs.h |   12 ++++--------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index d1db1ce..4d623bf 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -639,8 +639,8 @@ static int __init gicv3_populate_rdist(void)
     {
         void __iomem *ptr = gicv3.rdist_regions[i].map_base;
 
-        reg = readl_relaxed(ptr + GICR_PIDR2) & GICR_PIDR2_ARCH_REV_MASK;
-        if ( (reg >> GICR_PIDR2_ARCH_REV_SHIFT) != GICR_PIDR2_ARCH_GICV3 )
+        reg = readl_relaxed(ptr + GICR_PIDR2) & GIC_PIDR2_ARCH_MASK;
+        if ( reg != GIC_PIDR2_ARCH_GICv3 )
         {
             dprintk(XENLOG_ERR,
                     "GICv3: No redistributor present @%"PRIpaddr"\n",
@@ -1193,8 +1193,8 @@ static int __init gicv3_init(void)
     if ( !gicv3.map_dbase )
         panic("GICv3: Failed to ioremap for GIC distributor\n");
 
-    reg = readl_relaxed(GICD + GICD_PIDR2) & GICD_PIDR2_ARCH_REV_MASK;
-    if ( ((reg >> GICD_PIDR2_ARCH_REV_SHIFT) != GICD_PIDR2_ARCH_GICV3) )
+    reg = readl_relaxed(GICD + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
+    if ( reg != GIC_PIDR2_ARCH_GICv3 )
          panic("GICv3: no distributor detected\n");
 
     if ( !dt_property_read_u32(node, "#redistributor-regions",
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index bf7b239..b0ac6ff 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -40,6 +40,10 @@
 #define GICD_PIDR5                   (0xFFD4)
 #define GICD_PIDR7                   (0xFFDC)
 
+/* Common between GICD_PIDR2 and GICR_PIDR2 */
+#define GIC_PIDR2_ARCH_MASK         (0xf0)
+#define GIC_PIDR2_ARCH_GICv3        (0x30)
+
 #define GICC_SRE_EL2_SRE             (1UL << 0)
 #define GICC_SRE_EL2_DFB             (1UL << 1)
 #define GICC_SRE_EL2_DIB             (1UL << 2)
@@ -59,14 +63,6 @@
 #define GICR_WAKER_ProcessorSleep    (1U << 1)
 #define GICR_WAKER_ChildrenAsleep    (1U << 2)
 
-#define GICD_PIDR2_ARCH_REV_MASK     (0xf0)
-#define GICD_PIDR2_ARCH_REV_SHIFT    (0x4)
-#define GICD_PIDR2_ARCH_GICV3        (0x3)
-
-#define GICR_PIDR2_ARCH_REV_MASK     GICD_PIDR2_ARCH_REV_MASK
-#define GICR_PIDR2_ARCH_REV_SHIFT    GICD_PIDR2_ARCH_REV_SHIFT
-#define GICR_PIDR2_ARCH_GICV3        GICD_PIDR2_ARCH_GICV3
-
 #define GICR_SYNCR_NOT_BUSY          1
 /*
  * Implementation defined value JEP106?
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:22:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:22: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 1ZhSaB-00042h-JQ; Thu, 01 Oct 2015 01:22:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSaA-00042N-2O
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:50 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	BF/52-10422-9EA8C065; Thu, 01 Oct 2015 01:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1443662567!6869856!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 24126 invoked from network); 1 Oct 2015 01:22:48 -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;
	1 Oct 2015 01:22:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSa7-0001is-Oo
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSa7-0003cs-Mq
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:47 +0000
Date: Thu, 01 Oct 2015 01:22:47 +0000
Message-Id: <E1ZhSa7-0003cs-Mq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic-v3: Clean-up the
	GIC*_PIDR2_* definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 55e8b12a5c054dfdf5feee1c3a84ffdfc2d38c83
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Sep 14 16:32:23 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:47:52 2015 +0100

    xen/arm: gic-v3: Clean-up the GIC*_PIDR2_* definitions
    
    GICR_PIDR2 and GICD_PIDR2 use the same register layout. Rather than
    define twice, one of which is an alias to the other, introduce GIC_PIDR2_*
    defines.
    
    Also:
        * Use the same prefix for the mask and the value
        * Integrate the shift in the value to avoid shifting in the code
        * Use GICv* to match the value name in the spec
        * Move them in a proper place
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic-v3.c             |    8 ++++----
 xen/include/asm-arm/gic_v3_defs.h |   12 ++++--------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index d1db1ce..4d623bf 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -639,8 +639,8 @@ static int __init gicv3_populate_rdist(void)
     {
         void __iomem *ptr = gicv3.rdist_regions[i].map_base;
 
-        reg = readl_relaxed(ptr + GICR_PIDR2) & GICR_PIDR2_ARCH_REV_MASK;
-        if ( (reg >> GICR_PIDR2_ARCH_REV_SHIFT) != GICR_PIDR2_ARCH_GICV3 )
+        reg = readl_relaxed(ptr + GICR_PIDR2) & GIC_PIDR2_ARCH_MASK;
+        if ( reg != GIC_PIDR2_ARCH_GICv3 )
         {
             dprintk(XENLOG_ERR,
                     "GICv3: No redistributor present @%"PRIpaddr"\n",
@@ -1193,8 +1193,8 @@ static int __init gicv3_init(void)
     if ( !gicv3.map_dbase )
         panic("GICv3: Failed to ioremap for GIC distributor\n");
 
-    reg = readl_relaxed(GICD + GICD_PIDR2) & GICD_PIDR2_ARCH_REV_MASK;
-    if ( ((reg >> GICD_PIDR2_ARCH_REV_SHIFT) != GICD_PIDR2_ARCH_GICV3) )
+    reg = readl_relaxed(GICD + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
+    if ( reg != GIC_PIDR2_ARCH_GICv3 )
          panic("GICv3: no distributor detected\n");
 
     if ( !dt_property_read_u32(node, "#redistributor-regions",
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index bf7b239..b0ac6ff 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -40,6 +40,10 @@
 #define GICD_PIDR5                   (0xFFD4)
 #define GICD_PIDR7                   (0xFFDC)
 
+/* Common between GICD_PIDR2 and GICR_PIDR2 */
+#define GIC_PIDR2_ARCH_MASK         (0xf0)
+#define GIC_PIDR2_ARCH_GICv3        (0x30)
+
 #define GICC_SRE_EL2_SRE             (1UL << 0)
 #define GICC_SRE_EL2_DFB             (1UL << 1)
 #define GICC_SRE_EL2_DIB             (1UL << 2)
@@ -59,14 +63,6 @@
 #define GICR_WAKER_ProcessorSleep    (1U << 1)
 #define GICR_WAKER_ChildrenAsleep    (1U << 2)
 
-#define GICD_PIDR2_ARCH_REV_MASK     (0xf0)
-#define GICD_PIDR2_ARCH_REV_SHIFT    (0x4)
-#define GICD_PIDR2_ARCH_GICV3        (0x3)
-
-#define GICR_PIDR2_ARCH_REV_MASK     GICD_PIDR2_ARCH_REV_MASK
-#define GICR_PIDR2_ARCH_REV_SHIFT    GICD_PIDR2_ARCH_REV_SHIFT
-#define GICR_PIDR2_ARCH_GICV3        GICD_PIDR2_ARCH_GICV3
-
 #define GICR_SYNCR_NOT_BUSY          1
 /*
  * Implementation defined value JEP106?
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:23:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSaL-00044Z-MA; Thu, 01 Oct 2015 01:23: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 1ZhSaK-00044F-Iw
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:00 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	03/BC-12371-3FA8C065; Thu, 01 Oct 2015 01:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1443662578!17751040!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2902 invoked from network); 1 Oct 2015 01:22:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:22: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 1ZhSaI-0001j0-2G
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSaH-0003dG-VT
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:57 +0000
Date: Thu, 01 Oct 2015 01:22:57 +0000
Message-Id: <E1ZhSaH-0003dG-VT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic-v3: Allow Xen to run on
	hardware supporting GICv4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18c67d29c91d64274212b33cd5db006db553abf9
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Sep 14 16:32:24 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:47:59 2015 +0100

    xen/arm: gic-v3: Allow Xen to run on hardware supporting GICv4
    
    GICv4 is an extension of GICv3 (see 1.1 in ARM IHI 0069A) which means
    that the GICv3 driver can run normally on GICv4 hardware.
    
    The GICv4-only features currently won't be used.
    
    Reported-by: Andre Przywara <andre.przywara@arm.com>
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic-v3.c             |    4 ++--
 xen/include/asm-arm/gic_v3_defs.h |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 4d623bf..1e3c19b 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -640,7 +640,7 @@ static int __init gicv3_populate_rdist(void)
         void __iomem *ptr = gicv3.rdist_regions[i].map_base;
 
         reg = readl_relaxed(ptr + GICR_PIDR2) & GIC_PIDR2_ARCH_MASK;
-        if ( reg != GIC_PIDR2_ARCH_GICv3 )
+        if ( reg != GIC_PIDR2_ARCH_GICv3 && reg != GIC_PIDR2_ARCH_GICv4 )
         {
             dprintk(XENLOG_ERR,
                     "GICv3: No redistributor present @%"PRIpaddr"\n",
@@ -1194,7 +1194,7 @@ static int __init gicv3_init(void)
         panic("GICv3: Failed to ioremap for GIC distributor\n");
 
     reg = readl_relaxed(GICD + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
-    if ( reg != GIC_PIDR2_ARCH_GICv3 )
+    if ( reg != GIC_PIDR2_ARCH_GICv3 && reg != GIC_PIDR2_ARCH_GICv4 )
          panic("GICv3: no distributor detected\n");
 
     if ( !dt_property_read_u32(node, "#redistributor-regions",
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index b0ac6ff..c6d73df 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -43,6 +43,7 @@
 /* Common between GICD_PIDR2 and GICR_PIDR2 */
 #define GIC_PIDR2_ARCH_MASK         (0xf0)
 #define GIC_PIDR2_ARCH_GICv3        (0x30)
+#define GIC_PIDR2_ARCH_GICv4        (0x40)
 
 #define GICC_SRE_EL2_SRE             (1UL << 0)
 #define GICC_SRE_EL2_DFB             (1UL << 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 Oct 01 01:23:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSaL-00044Z-MA; Thu, 01 Oct 2015 01:23: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 1ZhSaK-00044F-Iw
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:00 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	03/BC-12371-3FA8C065; Thu, 01 Oct 2015 01:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1443662578!17751040!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2902 invoked from network); 1 Oct 2015 01:22:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:22: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 1ZhSaI-0001j0-2G
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSaH-0003dG-VT
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:22:57 +0000
Date: Thu, 01 Oct 2015 01:22:57 +0000
Message-Id: <E1ZhSaH-0003dG-VT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic-v3: Allow Xen to run on
	hardware supporting GICv4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18c67d29c91d64274212b33cd5db006db553abf9
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Sep 14 16:32:24 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Sep 24 11:47:59 2015 +0100

    xen/arm: gic-v3: Allow Xen to run on hardware supporting GICv4
    
    GICv4 is an extension of GICv3 (see 1.1 in ARM IHI 0069A) which means
    that the GICv3 driver can run normally on GICv4 hardware.
    
    The GICv4-only features currently won't be used.
    
    Reported-by: Andre Przywara <andre.przywara@arm.com>
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic-v3.c             |    4 ++--
 xen/include/asm-arm/gic_v3_defs.h |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 4d623bf..1e3c19b 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -640,7 +640,7 @@ static int __init gicv3_populate_rdist(void)
         void __iomem *ptr = gicv3.rdist_regions[i].map_base;
 
         reg = readl_relaxed(ptr + GICR_PIDR2) & GIC_PIDR2_ARCH_MASK;
-        if ( reg != GIC_PIDR2_ARCH_GICv3 )
+        if ( reg != GIC_PIDR2_ARCH_GICv3 && reg != GIC_PIDR2_ARCH_GICv4 )
         {
             dprintk(XENLOG_ERR,
                     "GICv3: No redistributor present @%"PRIpaddr"\n",
@@ -1194,7 +1194,7 @@ static int __init gicv3_init(void)
         panic("GICv3: Failed to ioremap for GIC distributor\n");
 
     reg = readl_relaxed(GICD + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
-    if ( reg != GIC_PIDR2_ARCH_GICv3 )
+    if ( reg != GIC_PIDR2_ARCH_GICv3 && reg != GIC_PIDR2_ARCH_GICv4 )
          panic("GICv3: no distributor detected\n");
 
     if ( !dt_property_read_u32(node, "#redistributor-regions",
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index b0ac6ff..c6d73df 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -43,6 +43,7 @@
 /* Common between GICD_PIDR2 and GICR_PIDR2 */
 #define GIC_PIDR2_ARCH_MASK         (0xf0)
 #define GIC_PIDR2_ARCH_GICv3        (0x30)
+#define GIC_PIDR2_ARCH_GICv4        (0x40)
 
 #define GICC_SRE_EL2_SRE             (1UL << 0)
 #define GICC_SRE_EL2_DFB             (1UL << 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 Oct 01 01:23:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSaW-00046W-Ot; Thu, 01 Oct 2015 01:23: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 1ZhSaU-000465-R0
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:10 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	8F/3C-05427-EFA8C065; Thu, 01 Oct 2015 01:23:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1443662588!54551994!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 14061 invoked from network); 1 Oct 2015 01:23: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;
	1 Oct 2015 01:23: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 1ZhSaS-0001jb-Ak
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSaS-0003do-8y
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:08 +0000
Date: Thu, 01 Oct 2015 01:23:08 +0000
Message-Id: <E1ZhSaS-0003do-8y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/bigmem: eliminate struct domain
	address width restriction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb34ff7452fda9966915cba8cf3ed42d4ca738fc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Sep 25 09:02:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:02:02 2015 +0200

    x86/bigmem: eliminate struct domain address width restriction
    
    PDX-es are 64 bits wide in that case, and hence no limit needs to be
    enforced.
    
    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/domain.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 0b97912..dc3bb08 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -203,6 +203,7 @@ smap_check_policy_t smap_policy_change(struct vcpu *v,
     return old_policy;
 }
 
+#ifndef CONFIG_BIGMEM
 /*
  * The hole may be at or above the 44-bit boundary, so we need to determine
  * the total bit count until reaching 32 significant (not squashed out) bits
@@ -224,10 +225,14 @@ static unsigned int __init noinline _domain_struct_bits(void)
 
     return bits;
 }
+#endif
 
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
+#ifdef CONFIG_BIGMEM
+    const unsigned int bits = 0;
+#else
     /*
      * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
@@ -236,6 +241,7 @@ struct domain *alloc_domain_struct(void)
 
     if ( unlikely(!bits) )
          bits = _domain_struct_bits();
+#endif
 
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
     d = alloc_xenheap_pages(0, MEMF_bits(bits));
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:23:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSaW-00046W-Ot; Thu, 01 Oct 2015 01:23: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 1ZhSaU-000465-R0
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:10 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	8F/3C-05427-EFA8C065; Thu, 01 Oct 2015 01:23:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1443662588!54551994!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 14061 invoked from network); 1 Oct 2015 01:23: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;
	1 Oct 2015 01:23: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 1ZhSaS-0001jb-Ak
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSaS-0003do-8y
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:08 +0000
Date: Thu, 01 Oct 2015 01:23:08 +0000
Message-Id: <E1ZhSaS-0003do-8y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/bigmem: eliminate struct domain
	address width restriction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb34ff7452fda9966915cba8cf3ed42d4ca738fc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Sep 25 09:02:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:02:02 2015 +0200

    x86/bigmem: eliminate struct domain address width restriction
    
    PDX-es are 64 bits wide in that case, and hence no limit needs to be
    enforced.
    
    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/domain.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 0b97912..dc3bb08 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -203,6 +203,7 @@ smap_check_policy_t smap_policy_change(struct vcpu *v,
     return old_policy;
 }
 
+#ifndef CONFIG_BIGMEM
 /*
  * The hole may be at or above the 44-bit boundary, so we need to determine
  * the total bit count until reaching 32 significant (not squashed out) bits
@@ -224,10 +225,14 @@ static unsigned int __init noinline _domain_struct_bits(void)
 
     return bits;
 }
+#endif
 
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
+#ifdef CONFIG_BIGMEM
+    const unsigned int bits = 0;
+#else
     /*
      * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
@@ -236,6 +241,7 @@ struct domain *alloc_domain_struct(void)
 
     if ( unlikely(!bits) )
          bits = _domain_struct_bits();
+#endif
 
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
     d = alloc_xenheap_pages(0, MEMF_bits(bits));
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:23:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSag-000482-RP; Thu, 01 Oct 2015 01:23: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 1ZhSaf-00047p-F6
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:21 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	FF/F2-32615-80B8C065; Thu, 01 Oct 2015 01:23:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1443662598!6869908!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 27089 invoked from network); 1 Oct 2015 01:23:19 -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;
	1 Oct 2015 01:23:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSac-0001jj-MJ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSac-0003eE-JY
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:18 +0000
Date: Thu, 01 Oct 2015 01:23:18 +0000
Message-Id: <E1ZhSac-0003eE-JY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] add missing license and copyright
	statements to public interface headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d6ff9ef259e296e6aee32ad8840cc5081280e0d
Author:     Mike Belopuhov <mike.belopuhov@esdenera.com>
AuthorDate: Fri Sep 25 09:04:24 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:04:24 2015 +0200

    add missing license and copyright statements to public interface headers
    
    The copyright line indicates a person, a group of people and/or a company
    granting rights stated in the license text and is a required part of the
    license.
    
    The year of the copyright is chosen to be the same as when the license has
    been applied to the file or when the file has been created in case there
    was no license.  It is possible to update or add additional years if major
    changes have been done to the the file, but is generally not a requirement.
    
    Signed-off-by: Mike Belopuhov <mike.belopuhov@esdenera.com>
---
 xen/include/public/arch-x86/pmu.h       |   22 ++++++++++++++++++++++
 xen/include/public/hvm/e820.h           |    3 ++-
 xen/include/public/hvm/hvm_info_table.h |    2 ++
 xen/include/public/hvm/hvm_op.h         |    2 ++
 xen/include/public/hvm/hvm_xs_strings.h |    2 ++
 xen/include/public/hvm/params.h         |    2 ++
 xen/include/public/io/protocols.h       |    2 ++
 xen/include/public/physdev.h            |    2 ++
 xen/include/public/pmu.h                |   22 ++++++++++++++++++++++
 9 files changed, 58 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-x86/pmu.h b/xen/include/public/arch-x86/pmu.h
index 1a53888..68ebf12 100644
--- a/xen/include/public/arch-x86/pmu.h
+++ b/xen/include/public/arch-x86/pmu.h
@@ -1,3 +1,25 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
 #ifndef __XEN_PUBLIC_ARCH_X86_PMU_H__
 #define __XEN_PUBLIC_ARCH_X86_PMU_H__
 
diff --git a/xen/include/public/hvm/e820.h b/xen/include/public/hvm/e820.h
index 5bdc227..6c58a37 100644
--- a/xen/include/public/hvm/e820.h
+++ b/xen/include/public/hvm/e820.h
@@ -1,4 +1,3 @@
-
 /*
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -17,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_E820_H__
diff --git a/xen/include/public/hvm/hvm_info_table.h b/xen/include/public/hvm/hvm_info_table.h
index 36085fa..9e3f807 100644
--- a/xen/include/public/hvm/hvm_info_table.h
+++ b/xen/include/public/hvm/hvm_info_table.h
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index 014546a..1606185 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
diff --git a/xen/include/public/hvm/hvm_xs_strings.h b/xen/include/public/hvm/hvm_xs_strings.h
index 8aec935..146b0b0 100644
--- a/xen/include/public/hvm/hvm_xs_strings.h
+++ b/xen/include/public/hvm/hvm_xs_strings.h
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2013, Citrix Systems
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_XS_STRINGS_H__
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 147d9b8..356dfd3 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_PARAMS_H__
diff --git a/xen/include/public/io/protocols.h b/xen/include/public/io/protocols.h
index 80b196b..40a9b30 100644
--- a/xen/include/public/io/protocols.h
+++ b/xen/include/public/io/protocols.h
@@ -18,6 +18,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2008, Keir Fraser
  */
 
 #ifndef __XEN_PROTOCOLS_H__
diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
index c9be6de..0e54635 100644
--- a/xen/include/public/physdev.h
+++ b/xen/include/public/physdev.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_PHYSDEV_H__
diff --git a/xen/include/public/pmu.h b/xen/include/public/pmu.h
index 1149678..7753df0 100644
--- a/xen/include/public/pmu.h
+++ b/xen/include/public/pmu.h
@@ -1,3 +1,25 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
 #ifndef __XEN_PUBLIC_PMU_H__
 #define __XEN_PUBLIC_PMU_H__
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:23:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSag-000482-RP; Thu, 01 Oct 2015 01:23: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 1ZhSaf-00047p-F6
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:21 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	FF/F2-32615-80B8C065; Thu, 01 Oct 2015 01:23:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1443662598!6869908!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 27089 invoked from network); 1 Oct 2015 01:23:19 -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;
	1 Oct 2015 01:23:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSac-0001jj-MJ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSac-0003eE-JY
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:18 +0000
Date: Thu, 01 Oct 2015 01:23:18 +0000
Message-Id: <E1ZhSac-0003eE-JY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] add missing license and copyright
	statements to public interface headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d6ff9ef259e296e6aee32ad8840cc5081280e0d
Author:     Mike Belopuhov <mike.belopuhov@esdenera.com>
AuthorDate: Fri Sep 25 09:04:24 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:04:24 2015 +0200

    add missing license and copyright statements to public interface headers
    
    The copyright line indicates a person, a group of people and/or a company
    granting rights stated in the license text and is a required part of the
    license.
    
    The year of the copyright is chosen to be the same as when the license has
    been applied to the file or when the file has been created in case there
    was no license.  It is possible to update or add additional years if major
    changes have been done to the the file, but is generally not a requirement.
    
    Signed-off-by: Mike Belopuhov <mike.belopuhov@esdenera.com>
---
 xen/include/public/arch-x86/pmu.h       |   22 ++++++++++++++++++++++
 xen/include/public/hvm/e820.h           |    3 ++-
 xen/include/public/hvm/hvm_info_table.h |    2 ++
 xen/include/public/hvm/hvm_op.h         |    2 ++
 xen/include/public/hvm/hvm_xs_strings.h |    2 ++
 xen/include/public/hvm/params.h         |    2 ++
 xen/include/public/io/protocols.h       |    2 ++
 xen/include/public/physdev.h            |    2 ++
 xen/include/public/pmu.h                |   22 ++++++++++++++++++++++
 9 files changed, 58 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-x86/pmu.h b/xen/include/public/arch-x86/pmu.h
index 1a53888..68ebf12 100644
--- a/xen/include/public/arch-x86/pmu.h
+++ b/xen/include/public/arch-x86/pmu.h
@@ -1,3 +1,25 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
 #ifndef __XEN_PUBLIC_ARCH_X86_PMU_H__
 #define __XEN_PUBLIC_ARCH_X86_PMU_H__
 
diff --git a/xen/include/public/hvm/e820.h b/xen/include/public/hvm/e820.h
index 5bdc227..6c58a37 100644
--- a/xen/include/public/hvm/e820.h
+++ b/xen/include/public/hvm/e820.h
@@ -1,4 +1,3 @@
-
 /*
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -17,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_E820_H__
diff --git a/xen/include/public/hvm/hvm_info_table.h b/xen/include/public/hvm/hvm_info_table.h
index 36085fa..9e3f807 100644
--- a/xen/include/public/hvm/hvm_info_table.h
+++ b/xen/include/public/hvm/hvm_info_table.h
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index 014546a..1606185 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
diff --git a/xen/include/public/hvm/hvm_xs_strings.h b/xen/include/public/hvm/hvm_xs_strings.h
index 8aec935..146b0b0 100644
--- a/xen/include/public/hvm/hvm_xs_strings.h
+++ b/xen/include/public/hvm/hvm_xs_strings.h
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2013, Citrix Systems
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_XS_STRINGS_H__
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 147d9b8..356dfd3 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_PARAMS_H__
diff --git a/xen/include/public/io/protocols.h b/xen/include/public/io/protocols.h
index 80b196b..40a9b30 100644
--- a/xen/include/public/io/protocols.h
+++ b/xen/include/public/io/protocols.h
@@ -18,6 +18,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2008, Keir Fraser
  */
 
 #ifndef __XEN_PROTOCOLS_H__
diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
index c9be6de..0e54635 100644
--- a/xen/include/public/physdev.h
+++ b/xen/include/public/physdev.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_PHYSDEV_H__
diff --git a/xen/include/public/pmu.h b/xen/include/public/pmu.h
index 1149678..7753df0 100644
--- a/xen/include/public/pmu.h
+++ b/xen/include/public/pmu.h
@@ -1,3 +1,25 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
 #ifndef __XEN_PUBLIC_PMU_H__
 #define __XEN_PUBLIC_PMU_H__
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:23:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSaq-00049X-UL; Thu, 01 Oct 2015 01:23:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSap-00049E-AK
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:31 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	7C/8F-19110-21B8C065; Thu, 01 Oct 2015 01:23:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1443662609!54522719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13089 invoked from network); 1 Oct 2015 01:23:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:23: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 1ZhSam-0001jr-Va
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSam-0003ej-T2
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:28 +0000
Date: Thu, 01 Oct 2015 01:23:28 +0000
Message-Id: <E1ZhSam-0003ej-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: properly populate descriptor
	tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf6d39f81992c29a637c603dbabf1e21a0ea563f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Sep 25 09:05:29 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:05:29 2015 +0200

    x86/PV: properly populate descriptor tables
    
    Us extending the GDT limit past the Xen descriptors so far meant that
    guests (including user mode programs) accessing any descriptor table
    slot above the original OS'es limit but below the first Xen descriptor
    caused a #PF, converted to a #GP in our #PF handler. Which is quite
    different from the native behavior, where some of such accesses (LAR
    and LSL) don't fault. Mimic that behavior by mapping a blank page into
    unused slots.
    
    While not strictly required, treat the LDT the same for consistency.
    
    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/mm.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 202ff76..327b837 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -502,12 +502,13 @@ void update_cr3(struct vcpu *v)
     make_cr3(v, cr3_mfn);
 }
 
+static const char __section(".bss.page_aligned") zero_page[PAGE_SIZE];
 
 static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 {
     l1_pgentry_t *pl1e;
-    int i;
-    unsigned long pfn;
+    unsigned int i;
+    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
     struct page_info *page;
 
     BUG_ON(unlikely(in_irq()));
@@ -523,8 +524,9 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
     for ( i = 16; i < 32; i++ )
     {
         pfn = l1e_get_pfn(pl1e[i]);
-        if ( pfn == 0 ) continue;
-        l1e_write(&pl1e[i], l1e_empty());
+        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn )
+            continue;
+        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
         page = mfn_to_page(pfn);
         ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
         ASSERT_PAGE_IS_DOMAIN(page, v->domain);
@@ -4420,16 +4422,17 @@ long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
 void destroy_gdt(struct vcpu *v)
 {
     l1_pgentry_t *pl1e;
-    int i;
-    unsigned long pfn;
+    unsigned int i;
+    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
 
     v->arch.pv_vcpu.gdt_ents = 0;
     pl1e = gdt_ldt_ptes(v->domain, v);
     for ( i = 0; i < FIRST_RESERVED_GDT_PAGE; i++ )
     {
-        if ( (pfn = l1e_get_pfn(pl1e[i])) != 0 )
+        pfn = l1e_get_pfn(pl1e[i]);
+        if ( (l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) && pfn != zero_pfn )
             put_page_and_type(mfn_to_page(pfn));
-        l1e_write(&pl1e[i], l1e_empty());
+        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
         v->arch.pv_vcpu.gdt_frames[i] = 0;
     }
 }
@@ -4442,7 +4445,7 @@ long set_gdt(struct vcpu *v,
     struct domain *d = v->domain;
     l1_pgentry_t *pl1e;
     /* NB. There are 512 8-byte entries per GDT page. */
-    int i, nr_pages = (entries + 511) / 512;
+    unsigned int i, nr_pages = (entries + 511) / 512;
 
     if ( entries > FIRST_RESERVED_GDT_ENTRY )
         return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:23:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSaq-00049X-UL; Thu, 01 Oct 2015 01:23:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSap-00049E-AK
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:31 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	7C/8F-19110-21B8C065; Thu, 01 Oct 2015 01:23:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1443662609!54522719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13089 invoked from network); 1 Oct 2015 01:23:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:23: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 1ZhSam-0001jr-Va
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSam-0003ej-T2
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:28 +0000
Date: Thu, 01 Oct 2015 01:23:28 +0000
Message-Id: <E1ZhSam-0003ej-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: properly populate descriptor
	tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf6d39f81992c29a637c603dbabf1e21a0ea563f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Sep 25 09:05:29 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:05:29 2015 +0200

    x86/PV: properly populate descriptor tables
    
    Us extending the GDT limit past the Xen descriptors so far meant that
    guests (including user mode programs) accessing any descriptor table
    slot above the original OS'es limit but below the first Xen descriptor
    caused a #PF, converted to a #GP in our #PF handler. Which is quite
    different from the native behavior, where some of such accesses (LAR
    and LSL) don't fault. Mimic that behavior by mapping a blank page into
    unused slots.
    
    While not strictly required, treat the LDT the same for consistency.
    
    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/mm.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 202ff76..327b837 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -502,12 +502,13 @@ void update_cr3(struct vcpu *v)
     make_cr3(v, cr3_mfn);
 }
 
+static const char __section(".bss.page_aligned") zero_page[PAGE_SIZE];
 
 static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 {
     l1_pgentry_t *pl1e;
-    int i;
-    unsigned long pfn;
+    unsigned int i;
+    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
     struct page_info *page;
 
     BUG_ON(unlikely(in_irq()));
@@ -523,8 +524,9 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
     for ( i = 16; i < 32; i++ )
     {
         pfn = l1e_get_pfn(pl1e[i]);
-        if ( pfn == 0 ) continue;
-        l1e_write(&pl1e[i], l1e_empty());
+        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn )
+            continue;
+        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
         page = mfn_to_page(pfn);
         ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
         ASSERT_PAGE_IS_DOMAIN(page, v->domain);
@@ -4420,16 +4422,17 @@ long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
 void destroy_gdt(struct vcpu *v)
 {
     l1_pgentry_t *pl1e;
-    int i;
-    unsigned long pfn;
+    unsigned int i;
+    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
 
     v->arch.pv_vcpu.gdt_ents = 0;
     pl1e = gdt_ldt_ptes(v->domain, v);
     for ( i = 0; i < FIRST_RESERVED_GDT_PAGE; i++ )
     {
-        if ( (pfn = l1e_get_pfn(pl1e[i])) != 0 )
+        pfn = l1e_get_pfn(pl1e[i]);
+        if ( (l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) && pfn != zero_pfn )
             put_page_and_type(mfn_to_page(pfn));
-        l1e_write(&pl1e[i], l1e_empty());
+        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
         v->arch.pv_vcpu.gdt_frames[i] = 0;
     }
 }
@@ -4442,7 +4445,7 @@ long set_gdt(struct vcpu *v,
     struct domain *d = v->domain;
     l1_pgentry_t *pl1e;
     /* NB. There are 512 8-byte entries per GDT page. */
-    int i, nr_pages = (entries + 511) / 512;
+    unsigned int i, nr_pages = (entries + 511) / 512;
 
     if ( entries > FIRST_RESERVED_GDT_ENTRY )
         return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:23:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSb4-0004BP-0u; Thu, 01 Oct 2015 01:23: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 1ZhSb1-0004B7-RV
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:44 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	1C/87-01421-F1B8C065; Thu, 01 Oct 2015 01:23:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1443662619!47897012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18514 invoked from network); 1 Oct 2015 01:23:40 -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;
	1 Oct 2015 01:23: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 1ZhSax-0001jz-Ha
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSax-0003fo-Cw
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:39 +0000
Date: Thu, 01 Oct 2015 01:23:39 +0000
Message-Id: <E1ZhSax-0003fo-Cw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] keyhandler: rework keyhandler
	infrastructure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f96b29118a3ce99b1eb45e79564d5af382395607
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Sep 25 09:06:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:06:34 2015 +0200

    keyhandler: rework keyhandler infrastructure
    
    struct keyhandler does not contain much information, and requires a lot
    of boilerplate to use.  It is far more convenient to have
    register_keyhandler() take each piece of information a parameter,
    especially when introducing temporary debugging keyhandlers.
    
    This in turn allows struct keyhandler itself to become private to
    keyhandler.c and for the key_table to become more efficient.
    
    key_table doesn't need to contain 256 entries; all keys are ASCII which
    limits them to 7 bits of index, rather than 8.  It can also become a
    straight array, rather than an array of pointers.  The overall effect of
    this is the key_table grows in size by 50%, but there are no longer
    24-byte keyhandler structures all over the data section.
    
    All of the key_table entries in keyhandler.c can be initialised at
    compile time rather than runtime.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/acpi/cpu_idle.c             |    8 +-
 xen/arch/x86/hvm/irq.c                   |    8 +-
 xen/arch/x86/hvm/svm/vmcb.c              |    8 +-
 xen/arch/x86/hvm/vmx/vmcs.c              |    8 +-
 xen/arch/x86/io_apic.c                   |    7 +-
 xen/arch/x86/irq.c                       |    8 +-
 xen/arch/x86/mm/p2m-ept.c                |    8 +-
 xen/arch/x86/mm/shadow/common.c          |   14 +--
 xen/arch/x86/msi.c                       |    8 +-
 xen/arch/x86/nmi.c                       |   15 +--
 xen/arch/x86/numa.c                      |    8 +-
 xen/arch/x86/time.c                      |    8 +-
 xen/common/event_channel.c               |    8 +-
 xen/common/grant_table.c                 |    9 +-
 xen/common/kexec.c                       |    7 +-
 xen/common/keyhandler.c                  |  214 ++++++++++++------------------
 xen/common/page_alloc.c                  |   16 +--
 xen/common/timer.c                       |    8 +-
 xen/drivers/char/console.c               |   16 +--
 xen/drivers/passthrough/amd/iommu_intr.c |    9 +-
 xen/drivers/passthrough/iommu.c          |    8 +-
 xen/drivers/passthrough/pci.c            |    8 +-
 xen/drivers/passthrough/vtd/extern.h     |    2 +-
 xen/drivers/passthrough/vtd/iommu.c      |    2 +-
 xen/drivers/passthrough/vtd/utils.c      |    8 +-
 xen/include/xen/keyhandler.h             |   71 +++++------
 26 files changed, 152 insertions(+), 342 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 15fe2e9..d1f99a7 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -334,15 +334,9 @@ static void dump_cx(unsigned char key)
             print_acpi_power(cpu, processor_powers[cpu]);
 }
 
-static struct keyhandler dump_cx_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_cx,
-    .desc = "dump ACPI Cx structures"
-};
-
 static int __init cpu_idle_key_init(void)
 {
-    register_keyhandler('c', &dump_cx_keyhandler);
+    register_keyhandler('c', dump_cx, "dump ACPI Cx structures", 1);
     return 0;
 }
 __initcall(cpu_idle_key_init);
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 50fcf73..990a2ca 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -527,15 +527,9 @@ static void dump_irq_info(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static struct keyhandler dump_irq_info_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_irq_info,
-    .desc = "dump HVM irq info"
-};
-
 static int __init dump_irq_info_key_init(void)
 {
-    register_keyhandler('I', &dump_irq_info_keyhandler);
+    register_keyhandler('I', dump_irq_info, "dump HVM irq info", 1);
     return 0;
 }
 __initcall(dump_irq_info_key_init);
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index b5d7165..9ea014f 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -303,15 +303,9 @@ static void vmcb_dump(unsigned char ch)
     printk("**************************************\n");
 }
 
-static struct keyhandler vmcb_dump_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = vmcb_dump,
-    .desc = "dump AMD-V VMCBs"
-};
-
 void __init setup_vmcb_dump(void)
 {
-    register_keyhandler('v', &vmcb_dump_keyhandler);
+    register_keyhandler('v', vmcb_dump, "dump AMD-V VMCBs", 1);
 }
 
 /*
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 08f2078..15b136b 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1858,15 +1858,9 @@ static void vmcs_dump(unsigned char ch)
     printk("**************************************\n");
 }
 
-static struct keyhandler vmcs_dump_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = vmcs_dump,
-    .desc = "dump Intel's VMCS"
-};
-
 void __init setup_vmcs_dump(void)
 {
-    register_keyhandler('v', &vmcs_dump_keyhandler);
+    register_keyhandler('v', vmcs_dump, "dump VT-x VMCSs", 1);
 }
 
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index b8e37b5..1e710d6 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1251,11 +1251,6 @@ static void _print_IO_APIC_keyhandler(unsigned char key)
 {
     __print_IO_APIC(0);
 }
-static struct keyhandler print_IO_APIC_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = _print_IO_APIC_keyhandler,
-    .desc = "print ioapic info"
-};
 
 static void __init enable_IO_APIC(void)
 {
@@ -2054,7 +2049,7 @@ void __init setup_IO_APIC(void)
     print_IO_APIC();
     ioapic_pm_state_alloc();
 
-    register_keyhandler('z', &print_IO_APIC_keyhandler);
+    register_keyhandler('z', _print_IO_APIC_keyhandler, "dump IOAPIC info", 1);
 }
 
 void ioapic_suspend(void)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index bf2e822..f1397d6 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2316,15 +2316,9 @@ static void dump_irqs(unsigned char key)
     dump_ioapic_irq_info();
 }
 
-static struct keyhandler dump_irqs_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_irqs,
-    .desc = "dump interrupt bindings"
-};
-
 static int __init setup_dump_irqs(void)
 {
-    register_keyhandler('i', &dump_irqs_keyhandler);
+    register_keyhandler('i', dump_irqs, "dump interrupt bindings", 1);
     return 0;
 }
 __initcall(setup_dump_irqs);
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index dde242e..e4d3d6b 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -1257,15 +1257,9 @@ static void ept_dump_p2m_table(unsigned char key)
     }
 }
 
-static struct keyhandler ept_p2m_table = {
-    .diagnostic = 0,
-    .u.fn = ept_dump_p2m_table,
-    .desc = "dump ept p2m table"
-};
-
 void setup_ept_dump(void)
 {
-    register_keyhandler('D', &ept_p2m_table);
+    register_keyhandler('D', ept_dump_p2m_table, "dump VT-x EPT tables", 0);
 }
 
 /*
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 0264b91..3759232 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -97,14 +97,9 @@ static void shadow_audit_key(unsigned char key)
            __func__, shadow_audit_enable);
 }
 
-static struct keyhandler shadow_audit_keyhandler = {
-    .u.fn = shadow_audit_key,
-    .desc = "toggle shadow audits"
-};
-
 static int __init shadow_audit_key_init(void)
 {
-    register_keyhandler('O', &shadow_audit_keyhandler);
+    register_keyhandler('O', shadow_audit_key, "toggle shadow audits", 0);
     return 0;
 }
 __initcall(shadow_audit_key_init);
@@ -1409,15 +1404,10 @@ static void shadow_blow_all_tables(unsigned char c)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static struct keyhandler shadow_blow_all_tables_keyhandler = {
-    .u.fn = shadow_blow_all_tables,
-    .desc = "reset shadow pagetables"
-};
-
 /* Register this function in the Xen console keypress table */
 static __init int shadow_blow_tables_keyhandler_init(void)
 {
-    register_keyhandler('S', &shadow_blow_all_tables_keyhandler);
+    register_keyhandler('S', shadow_blow_all_tables, "reset shadow pagetables", 1);
     return 0;
 }
 __initcall(shadow_blow_tables_keyhandler_init);
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 3dbb84d..5a481f6 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1590,15 +1590,9 @@ static void dump_msi(unsigned char key)
     }
 }
 
-static struct keyhandler dump_msi_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_msi,
-    .desc = "dump MSI state"
-};
-
 static int __init msi_setup_keyhandler(void)
 {
-    register_keyhandler('M', &dump_msi_keyhandler);
+    register_keyhandler('M', dump_msi, "dump MSI state", 1);
     return 0;
 }
 __initcall(msi_setup_keyhandler);
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 2ab97a0..7520454 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -554,11 +554,6 @@ static void do_nmi_trigger(unsigned char key)
     self_nmi();
 }
 
-static struct keyhandler nmi_trigger_keyhandler = {
-    .u.fn = do_nmi_trigger,
-    .desc = "trigger an NMI"
-};
-
 static void do_nmi_stats(unsigned char key)
 {
     int i;
@@ -582,16 +577,10 @@ static void do_nmi_stats(unsigned char key)
         printk("dom0 vcpu0: NMI neither pending nor masked\n");
 }
 
-static struct keyhandler nmi_stats_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = do_nmi_stats,
-    .desc = "NMI statistics"
-};
-
 static __init int register_nmi_trigger(void)
 {
-    register_keyhandler('N', &nmi_trigger_keyhandler);
-    register_keyhandler('n', &nmi_stats_keyhandler);
+    register_keyhandler('N', do_nmi_trigger, "trigger an NMI", 0);
+    register_keyhandler('n', do_nmi_stats, "NMI statistics", 1);
     return 0;
 }
 __initcall(register_nmi_trigger);
diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 3041b24..0e82dd4 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -501,15 +501,9 @@ static void dump_numa(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static struct keyhandler dump_numa_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_numa,
-    .desc = "dump numa info"
-};
-
 static __init int register_numa_trigger(void)
 {
-    register_keyhandler('u', &dump_numa_keyhandler);
+    register_keyhandler('u', dump_numa, "dump NUMA info", 1);
     return 0;
 }
 __initcall(register_numa_trigger);
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bbb7e6c..b334f2f 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2047,15 +2047,9 @@ static void dump_softtsc(unsigned char key)
             printk("No domains have emulated TSC\n");
 }
 
-static struct keyhandler dump_softtsc_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_softtsc,
-    .desc = "dump softtsc stats"
-};
-
 static int __init setup_dump_softtsc(void)
 {
-    register_keyhandler('s', &dump_softtsc_keyhandler);
+    register_keyhandler('s', dump_softtsc, "dump softtsc stats", 1);
     return 0;
 }
 __initcall(setup_dump_softtsc);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index bd334f9..5a529a6 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1431,15 +1431,9 @@ static void dump_evtchn_info(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static struct keyhandler dump_evtchn_info_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_evtchn_info,
-    .desc = "dump evtchn info"
-};
-
 static int __init dump_evtchn_info_key_init(void)
 {
-    register_keyhandler('e', &dump_evtchn_info_keyhandler);
+    register_keyhandler('e', dump_evtchn_info, "dump evtchn info", 1);
     return 0;
 }
 __initcall(dump_evtchn_info_key_init);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 23185e7..c92abda 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3492,12 +3492,6 @@ static void gnttab_usage_print_all(unsigned char key)
     printk("%s ] done\n", __FUNCTION__);
 }
 
-static struct keyhandler gnttab_usage_print_all_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = gnttab_usage_print_all,
-    .desc = "print grant table usage"
-};
-
 static int __init gnttab_usage_init(void)
 {
     if ( max_nr_grant_frames )
@@ -3518,7 +3512,8 @@ static int __init gnttab_usage_init(void)
     if ( !max_maptrack_frames )
         max_maptrack_frames = DEFAULT_MAX_MAPTRACK_FRAMES;
 
-    register_keyhandler('g', &gnttab_usage_print_all_keyhandler);
+    register_keyhandler('g', gnttab_usage_print_all,
+                        "print grant table usage", 1);
     return 0;
 }
 __initcall(gnttab_usage_init);
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 7dd2700..2fc2957 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -374,11 +374,6 @@ static void do_crashdump_trigger(unsigned char key)
     printk(" * no crash kernel loaded!\n");
 }
 
-static struct keyhandler crashdump_trigger_keyhandler = {
-    .u.fn = do_crashdump_trigger,
-    .desc = "trigger a crashdump"
-};
-
 static void setup_note(Elf_Note *n, const char *name, int type, int descsz)
 {
     int l = strlen(name) + 1;
@@ -571,7 +566,7 @@ static int __init kexec_init(void)
     if ( ! crash_notes )
         return -ENOMEM;
 
-    register_keyhandler('C', &crashdump_trigger_keyhandler);
+    register_keyhandler('C', do_crashdump_trigger, "trigger a crashdump", 0);
 
     cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
     register_cpu_notifier(&cpu_nfb);
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 5d21e48..4ff90f6 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -3,7 +3,7 @@
  */
 
 #include <asm/regs.h>
-#include <xen/keyhandler.h> 
+#include <xen/keyhandler.h>
 #include <xen/shutdown.h>
 #include <xen/event.h>
 #include <xen/console.h>
@@ -21,12 +21,58 @@
 #include <asm/debugger.h>
 #include <asm/div64.h>
 
-static struct keyhandler *key_table[256];
 static unsigned char keypress_key;
 static bool_t alt_key_handling;
 
+static keyhandler_fn_t show_handlers, dump_hwdom_registers,
+    dump_domains, read_clocks;
+static irq_keyhandler_fn_t do_toggle_alt_key, dump_registers,
+    reboot_machine, run_all_keyhandlers, do_debug_key;
+
 char keyhandler_scratch[1024];
 
+static struct keyhandler {
+    union {
+        keyhandler_fn_t *fn;
+        irq_keyhandler_fn_t *irq_fn;
+    };
+
+    const char *desc;    /* Description for help message.                 */
+    bool_t irq_callback, /* Call in irq context? if not, tasklet context. */
+        diagnostic;      /* Include in 'dump all' handler.                */
+} key_table[128] __read_mostly =
+{
+#define KEYHANDLER(k, f, desc, diag)            \
+    [k] = { { (f) }, desc, 0, diag }
+
+#define IRQ_KEYHANDLER(k, f, desc, diag)        \
+    [k] = { { (keyhandler_fn_t *)(f) }, desc, 1, diag }
+
+    IRQ_KEYHANDLER('A', do_toggle_alt_key, "toggle alternative key handling", 0),
+    IRQ_KEYHANDLER('d', dump_registers, "dump registers", 1),
+        KEYHANDLER('h', show_handlers, "show this message", 0),
+        KEYHANDLER('q', dump_domains, "dump domain (and guest debug) info", 1),
+        KEYHANDLER('r', dump_runq, "dump run queues", 1),
+    IRQ_KEYHANDLER('R', reboot_machine, "reboot machine", 0),
+        KEYHANDLER('t', read_clocks, "display multi-cpu clock info", 1),
+        KEYHANDLER('0', dump_hwdom_registers, "dump Dom0 registers", 1),
+    IRQ_KEYHANDLER('%', do_debug_key, "trap to xendbg", 0),
+    IRQ_KEYHANDLER('*', run_all_keyhandlers, "print all diagnostics", 0),
+
+#ifdef PERF_COUNTERS
+    KEYHANDLER('p', perfc_printall, "print performance counters", 1),
+    KEYHANDLER('P', perfc_reset, "reset performance counters", 0),
+#endif
+
+#ifdef LOCK_PROFILE
+    KEYHANDLER('l', spinlock_profile_printall, "print lock profile info", 1),
+    KEYHANDLER('L', spinlock_profile_reset, "reset lock profile info", 0),
+#endif
+
+#undef IRQ_KEYHANDLER
+#undef KEYHANDLER
+};
+
 static void keypress_action(unsigned long unused)
 {
     handle_keypress(keypress_key, NULL);
@@ -38,13 +84,13 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
 {
     struct keyhandler *h;
 
-    if ( (h = key_table[key]) == NULL )
+    if ( key >= ARRAY_SIZE(key_table) || !(h = &key_table[key])->fn )
         return;
 
     if ( !in_irq() || h->irq_callback )
     {
         console_start_log_everything();
-        h->irq_callback ? (*h->u.irq_fn)(key, regs) : (*h->u.fn)(key);
+        h->irq_callback ? h->irq_fn(key, regs) : h->fn(key);
         console_end_log_everything();
     }
     else
@@ -54,27 +100,41 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
     }
 }
 
-void register_keyhandler(unsigned char key, struct keyhandler *handler)
+void register_keyhandler(unsigned char key, keyhandler_fn_t fn,
+                         const char *desc, bool_t diagnostic)
 {
-    ASSERT(key_table[key] == NULL);
-    key_table[key] = handler;
+    BUG_ON(key >= ARRAY_SIZE(key_table)); /* Key in range? */
+    ASSERT(!key_table[key].fn);           /* Clobbering something else? */
+
+    key_table[key].fn = fn;
+    key_table[key].desc = desc;
+    key_table[key].irq_callback = 0;
+    key_table[key].diagnostic = diagnostic;
+}
+
+void register_irq_keyhandler(unsigned char key, irq_keyhandler_fn_t fn,
+                             const char *desc, bool_t diagnostic)
+{
+    BUG_ON(key >= ARRAY_SIZE(key_table)); /* Key in range? */
+    ASSERT(!key_table[key].irq_fn);       /* Clobbering something else? */
+
+    key_table[key].irq_fn = fn;
+    key_table[key].desc = desc;
+    key_table[key].irq_callback = 1;
+    key_table[key].diagnostic = diagnostic;
 }
 
 static void show_handlers(unsigned char key)
 {
-    int i;
+    unsigned int i;
+
     printk("'%c' pressed -> showing installed handlers\n", key);
-    for ( i = 0; i < ARRAY_SIZE(key_table); i++ ) 
-        if ( key_table[i] != NULL ) 
-            printk(" key '%c' (ascii '%02x') => %s\n", 
-                   isprint(i) ? i : ' ', i, key_table[i]->desc);
+    for ( i = 0; i < ARRAY_SIZE(key_table); i++ )
+        if ( key_table[i].fn )
+            printk(" key '%c' (ascii '%02x') => %s\n",
+                   isprint(i) ? i : ' ', i, key_table[i].desc);
 }
 
-static struct keyhandler show_handlers_keyhandler = {
-    .u.fn = show_handlers,
-    .desc = "show this message"
-};
-
 static cpumask_t dump_execstate_mask;
 
 void dump_execstate(struct cpu_user_regs *regs)
@@ -141,13 +201,6 @@ static void dump_registers(unsigned char key, struct cpu_user_regs *regs)
     watchdog_enable();
 }
 
-static struct keyhandler dump_registers_keyhandler = {
-    .irq_callback = 1,
-    .diagnostic = 1,
-    .u.irq_fn = dump_registers,
-    .desc = "dump registers"
-};
-
 static DECLARE_TASKLET(dump_hwdom_tasklet, NULL, 0);
 
 static void dump_hwdom_action(unsigned long arg)
@@ -191,24 +244,12 @@ static void dump_hwdom_registers(unsigned char key)
     }
 }
 
-static struct keyhandler dump_hwdom_registers_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_hwdom_registers,
-    .desc = "dump Dom0 registers"
-};
-
 static void reboot_machine(unsigned char key, struct cpu_user_regs *regs)
 {
     printk("'%c' pressed -> rebooting machine\n", key);
     machine_restart(0);
 }
 
-static struct keyhandler reboot_machine_keyhandler = {
-    .irq_callback = 1,
-    .u.irq_fn = reboot_machine,
-    .desc = "reboot machine"
-};
-
 static void cpuset_print(char *set, int size, const cpumask_t *mask)
 {
     *set++ = '{';
@@ -262,8 +303,8 @@ static void dump_domains(unsigned char key)
                atomic_read(&d->refcnt), d->is_dying,
                atomic_read(&d->pause_count));
         printk("    nr_pages=%d xenheap_pages=%d shared_pages=%u paged_pages=%u "
-               "dirty_cpus=%s max_pages=%u\n", d->tot_pages, d->xenheap_pages, 
-                atomic_read(&d->shr_pages), atomic_read(&d->paged_pages), 
+               "dirty_cpus=%s max_pages=%u\n", d->tot_pages, d->xenheap_pages,
+                atomic_read(&d->shr_pages), atomic_read(&d->paged_pages),
                 tmpstr, d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
@@ -282,7 +323,7 @@ static void dump_domains(unsigned char key)
         rangeset_domain_printk(d);
 
         dump_pageframe_info(d);
-               
+
         nodeset_print(tmpstr, sizeof(tmpstr), &d->node_affinity);
         printk("NODE affinity for domain %d: %s\n", d->domain_id, tmpstr);
 
@@ -333,12 +374,6 @@ static void dump_domains(unsigned char key)
 #undef tmpstr
 }
 
-static struct keyhandler dump_domains_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_domains,
-    .desc = "dump domain (and guest debug) info"
-};
-
 static cpumask_t read_clocks_cpumask;
 static DEFINE_PER_CPU(s_time_t, read_clocks_time);
 static DEFINE_PER_CPU(u64, read_cycles_time);
@@ -420,42 +455,6 @@ static void read_clocks(unsigned char key)
            maxdif_cycles, sumdif_cycles/count, count, dif_cycles);
 }
 
-static struct keyhandler read_clocks_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = read_clocks,
-    .desc = "display multi-cpu clock info"
-};
-
-static struct keyhandler dump_runq_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_runq,
-    .desc = "dump run queues"
-};
-
-#ifdef PERF_COUNTERS
-static struct keyhandler perfc_printall_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = perfc_printall,
-    .desc = "print performance counters"
-};
-static struct keyhandler perfc_reset_keyhandler = {
-    .u.fn = perfc_reset,
-    .desc = "reset performance counters"
-};
-#endif
-
-#ifdef LOCK_PROFILE
-static struct keyhandler spinlock_printall_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = spinlock_profile_printall,
-    .desc = "print lock profile info"
-};
-static struct keyhandler spinlock_reset_keyhandler = {
-    .u.fn = spinlock_profile_reset,
-    .desc = "reset lock profile info"
-};
-#endif
-
 static void run_all_nonirq_keyhandlers(unsigned long unused)
 {
     /* Fire all the non-IRQ-context diagnostic keyhandlers */
@@ -467,11 +466,11 @@ static void run_all_nonirq_keyhandlers(unsigned long unused)
     for ( k = 0; k < ARRAY_SIZE(key_table); k++ )
     {
         process_pending_softirqs();
-        h = key_table[k];
-        if ( (h == NULL) || !h->diagnostic || h->irq_callback )
+        h = &key_table[k];
+        if ( !h->fn || !h->diagnostic || h->irq_callback )
             continue;
         printk("[%c: %s]\n", k, h->desc);
-        (*h->u.fn)(k);
+        h->fn(k);
     }
 
     console_end_log_everything();
@@ -483,7 +482,7 @@ static DECLARE_TASKLET(run_all_keyhandlers_tasklet,
 static void run_all_keyhandlers(unsigned char key, struct cpu_user_regs *regs)
 {
     struct keyhandler *h;
-    int k;
+    unsigned int k;
 
     watchdog_disable();
 
@@ -492,11 +491,11 @@ static void run_all_keyhandlers(unsigned char key, struct cpu_user_regs *regs)
     /* Fire all the IRQ-context diangostic keyhandlers now */
     for ( k = 0; k < ARRAY_SIZE(key_table); k++ )
     {
-        h = key_table[k];
-        if ( (h == NULL) || !h->diagnostic || !h->irq_callback )
+        h = &key_table[k];
+        if ( !h->irq_fn || !h->diagnostic || !h->irq_callback )
             continue;
         printk("[%c: %s]\n", k, h->desc);
-        (*h->u.irq_fn)(k, regs);
+        h->irq_fn(k, regs);
     }
 
     watchdog_enable();
@@ -505,12 +504,6 @@ static void run_all_keyhandlers(unsigned char key, struct cpu_user_regs *regs)
     tasklet_schedule(&run_all_keyhandlers_tasklet);
 }
 
-static struct keyhandler run_all_keyhandlers_keyhandler = {
-    .irq_callback = 1,
-    .u.irq_fn = run_all_keyhandlers,
-    .desc = "print all diagnostics"
-};
-
 static void do_debug_key(unsigned char key, struct cpu_user_regs *regs)
 {
     printk("'%c' pressed -> trapping into debugger\n", key);
@@ -520,12 +513,6 @@ static void do_debug_key(unsigned char key, struct cpu_user_regs *regs)
                              bit. */
 }
 
-static struct keyhandler do_debug_key_keyhandler = {
-    .irq_callback = 1,
-    .u.irq_fn = do_debug_key,
-    .desc = "trap to xendbg"
-};
-
 static void do_toggle_alt_key(unsigned char key, struct cpu_user_regs *regs)
 {
     alt_key_handling = !alt_key_handling;
@@ -533,12 +520,6 @@ static void do_toggle_alt_key(unsigned char key, struct cpu_user_regs *regs)
            alt_key_handling ? "alternative" : "normal");
 }
 
-static struct keyhandler toggle_alt_keyhandler = {
-    .irq_callback = 1,
-    .u.irq_fn = do_toggle_alt_key,
-    .desc = "toggle alternative key handling"
-};
-
 void __init initialize_keytable(void)
 {
     if ( num_present_cpus() > 16 )
@@ -547,27 +528,6 @@ void __init initialize_keytable(void)
         printk(XENLOG_INFO "Defaulting to alternative key handling; "
                "send 'A' to switch to normal mode.\n");
     }
-    register_keyhandler('A', &toggle_alt_keyhandler);
-    register_keyhandler('d', &dump_registers_keyhandler);
-    register_keyhandler('h', &show_handlers_keyhandler);
-    register_keyhandler('q', &dump_domains_keyhandler);
-    register_keyhandler('r', &dump_runq_keyhandler);
-    register_keyhandler('R', &reboot_machine_keyhandler);
-    register_keyhandler('t', &read_clocks_keyhandler);
-    register_keyhandler('0', &dump_hwdom_registers_keyhandler);
-    register_keyhandler('%', &do_debug_key_keyhandler);
-    register_keyhandler('*', &run_all_keyhandlers_keyhandler);
-
-#ifdef PERF_COUNTERS
-    register_keyhandler('p', &perfc_printall_keyhandler);
-    register_keyhandler('P', &perfc_reset_keyhandler);
-#endif
-
-#ifdef LOCK_PROFILE
-    register_keyhandler('l', &spinlock_printall_keyhandler);
-    register_keyhandler('L', &spinlock_reset_keyhandler);
-#endif
-
 }
 
 /*
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 74fc1de..2b8810c 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1849,15 +1849,9 @@ static void pagealloc_info(unsigned char key)
     printk("    Dom heap: %lukB free\n", total << (PAGE_SHIFT-10));
 }
 
-static struct keyhandler pagealloc_info_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = pagealloc_info,
-    .desc = "memory info"
-};
-
 static __init int pagealloc_keyhandler_init(void)
 {
-    register_keyhandler('m', &pagealloc_info_keyhandler);
+    register_keyhandler('m', pagealloc_info, "memory info", 1);
     return 0;
 }
 __initcall(pagealloc_keyhandler_init);
@@ -1901,15 +1895,9 @@ static void dump_heap(unsigned char key)
     }
 }
 
-static struct keyhandler dump_heap_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_heap,
-    .desc = "dump heap info"
-};
-
 static __init int register_heap_trigger(void)
 {
-    register_keyhandler('H', &dump_heap_keyhandler);
+    register_keyhandler('H', dump_heap, "dump heap info", 1);
     return 0;
 }
 __initcall(register_heap_trigger);
diff --git a/xen/common/timer.c b/xen/common/timer.c
index f36aebc..29a60a9 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -540,12 +540,6 @@ static void dump_timerq(unsigned char key)
     }
 }
 
-static struct keyhandler dump_timerq_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_timerq,
-    .desc = "dump timer queues"
-};
-
 static void migrate_timers_from_cpu(unsigned int old_cpu)
 {
     unsigned int new_cpu = cpumask_any(&cpu_online_map);
@@ -639,7 +633,7 @@ void __init timer_init(void)
     cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
     register_cpu_notifier(&cpu_nfb);
 
-    register_keyhandler('a', &dump_timerq_keyhandler);
+    register_keyhandler('a', dump_timerq, "dump timer queues", 1);
 }
 
 /*
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index fce4cc8..4362400 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -322,11 +322,6 @@ static void dump_console_ring_key(unsigned char key)
     free_xenheap_pages(buf, order);
 }
 
-static struct keyhandler dump_console_ring_keyhandler = {
-    .u.fn = dump_console_ring_key,
-    .desc = "synchronously dump console ring buffer (dmesg)"
-};
-
 /* CTRL-<switch_char> switches input direction between Xen and DOM0. */
 #define switch_code (opt_conswitch[0]-'a'+1)
 static int __read_mostly xen_rx = 1; /* FALSE => input passed to domain 0. */
@@ -833,7 +828,8 @@ void __init console_endboot(void)
     if ( opt_conswitch[1] == 'x' )
         xen_rx = !xen_rx;
 
-    register_keyhandler('w', &dump_console_ring_keyhandler);
+    register_keyhandler('w', dump_console_ring_key,
+                        "synchronously dump console ring buffer (dmesg)", 0);
 
     /* Serial input is directed to DOM0 by default. */
     switch_serial_input();
@@ -1069,11 +1065,6 @@ static void debugtrace_key(unsigned char key)
     debugtrace_toggle();
 }
 
-static struct keyhandler debugtrace_keyhandler = {
-    .u.fn = debugtrace_key,
-    .desc = "toggle debugtrace to console/buffer"
-};
-
 static int __init debugtrace_init(void)
 {
     int order;
@@ -1095,7 +1086,8 @@ static int __init debugtrace_init(void)
 
     debugtrace_bytes = bytes;
 
-    register_keyhandler('T', &debugtrace_keyhandler);
+    register_keyhandler('T', debugtrace_key,
+                        "toggle debugtrace to console/buffer", 0);
 
     return 0;
 }
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 62e29e9..74c2809 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -36,12 +36,6 @@ static DEFINE_SPINLOCK(shared_intremap_lock);
 
 static void dump_intremap_tables(unsigned char key);
 
-static struct keyhandler dump_intremap = {
-    .diagnostic = 0,
-    .u.fn = dump_intremap_tables,
-    .desc = "dump IOMMU intremap tables"
-};
-
 static spinlock_t* get_intremap_lock(int seg, int req_id)
 {
     return (amd_iommu_perdev_intremap ?
@@ -269,7 +263,8 @@ int __init amd_iommu_setup_ioapic_remapping(void)
         }
     }
 
-    register_keyhandler('V', &dump_intremap);
+    register_keyhandler('V', &dump_intremap_tables,
+                        "dump IOMMU intremap tables", 0);
 
     return 0;
 }
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index aee9d82..3e55abf 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -67,12 +67,6 @@ DEFINE_SPINLOCK(iommu_pt_cleanup_lock);
 PAGE_LIST_HEAD(iommu_pt_cleanup_list);
 static struct tasklet iommu_pt_cleanup_tasklet;
 
-static struct keyhandler iommu_p2m_table = {
-    .diagnostic = 0,
-    .u.fn = iommu_dump_p2m_table,
-    .desc = "dump iommu p2m table"
-};
-
 static void __init parse_iommu_param(char *s)
 {
     char *ss;
@@ -161,7 +155,7 @@ void __hwdom_init iommu_hwdom_init(struct domain *d)
     if ( !iommu_enabled )
         return;
 
-    register_keyhandler('o', &iommu_p2m_table);
+    register_keyhandler('o', &iommu_dump_p2m_table, "dump iommu p2m table", 0);
     d->need_iommu = !!iommu_dom0_strict;
     if ( need_iommu(d) && !iommu_use_hap_pt(d) )
     {
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 27b3ca7..62b311b 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1211,15 +1211,9 @@ static void dump_pci_devices(unsigned char ch)
     spin_unlock(&pcidevs_lock);
 }
 
-struct keyhandler dump_pci_devices_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_pci_devices,
-    .desc = "dump PCI devices"
-};
-
 static int __init setup_dump_pcidevs(void)
 {
-    register_keyhandler('Q', &dump_pci_devices_keyhandler);
+    register_keyhandler('Q', dump_pci_devices, "dump PCI devices", 1);
     return 0;
 }
 __initcall(setup_dump_pcidevs);
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 8acf889..fbfd9a6 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -29,7 +29,7 @@ extern bool_t rwbf_quirk;
 
 void print_iommu_regs(struct acpi_drhd_unit *drhd);
 void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn);
-extern struct keyhandler dump_iommu_info_keyhandler;
+keyhandler_fn_t vtd_dump_iommu_info;
 
 int enable_qinval(struct iommu *iommu);
 void disable_qinval(struct iommu *iommu);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b67b624..4746a55 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2210,7 +2210,7 @@ int __init intel_vtd_setup(void)
     if ( ret )
         goto error;
 
-    register_keyhandler('V', &dump_iommu_info_keyhandler);
+    register_keyhandler('V', vtd_dump_iommu_info, "dump iommu info", 1);
 
     return 0;
 
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index 44c4ef5..36ed3d6 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -177,7 +177,7 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn)
     } while ( --level );
 }
 
-static void dump_iommu_info(unsigned char key)
+void vtd_dump_iommu_info(unsigned char key)
 {
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
@@ -291,12 +291,6 @@ static void dump_iommu_info(unsigned char key)
     }
 }
 
-struct keyhandler dump_iommu_info_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_iommu_info,
-    .desc = "dump iommu info"
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/keyhandler.h b/xen/include/xen/keyhandler.h
index d3ab0a9..39052b5 100644
--- a/xen/include/xen/keyhandler.h
+++ b/xen/include/xen/keyhandler.h
@@ -1,53 +1,48 @@
 /******************************************************************************
  * keyhandler.h
- * 
+ *
  * We keep an array of 'handlers' for each key code between 0 and 255;
- * this is intended to allow very simple debugging routines (toggle 
+ * this is intended to allow very simple debugging routines (toggle
  * debug flag, dump registers, reboot, etc) to be hooked in in a slightly
- * nicer fashion than just editing the serial/keyboard drivers. 
+ * nicer fashion than just editing the serial/keyboard drivers.
  */
 
 #ifndef __XEN_KEYHANDLER_H__
 #define __XEN_KEYHANDLER_H__
 
-typedef void keyhandler_fn_t(
-    unsigned char key);
-typedef void irq_keyhandler_fn_t(
-    unsigned char key, struct cpu_user_regs *regs);
-
-struct keyhandler {
-    /*
-     * If TRUE then u.irq_fn is called in hardirq context with interrupts
-     * disabled. The @regs callback parameter points at the interrupted
-     * register context. 
-     * If FALSE then u.fn is called in softirq context with no locks held and
-     * interrupts enabled.
-     */
-    bool_t irq_callback;
-
-    /*
-     * If TRUE then the keyhandler will be included in the "dump everything"
-     * keyhandler, so must not have any side-effects.
-     */
-    bool_t diagnostic;
-
-    union {
-        keyhandler_fn_t *fn;
-        irq_keyhandler_fn_t *irq_fn;
-    } u;
-
-    /* The string is not copied by register_keyhandler(), so must persist. */
-    char *desc;
-};
-
-/* Initialize keytable with default handlers */
-extern void initialize_keytable(void);
+#include <xen/types.h>
 
 /*
- * Register a callback handler for key @key. The keyhandler structure is not
- * copied, so must persist.
+ * Callback type for keyhander.
+ *
+ * Called in softirq context with interrupts enabled.
  */
-extern void register_keyhandler(unsigned char key, struct keyhandler *handler);
+typedef void (keyhandler_fn_t)(unsigned char key);
+
+/*
+ * Callback type for irq_keyhandler.
+ *
+ * Called in hardirq context with interrupts disabled.
+ */
+typedef void (irq_keyhandler_fn_t)(unsigned char key,
+                                   struct cpu_user_regs *regs);
+
+/* Initialize keytable with default handlers. */
+void initialize_keytable(void);
+
+/*
+ * Regiser a callback handler for key @key for either plain or irq context.
+ * If @diagnostic is set, the handler will be included in the "dump
+ * everything" keyhandler.
+ */
+void register_keyhandler(unsigned char key,
+                         keyhandler_fn_t *fn,
+                         const char *desc,
+                         bool_t diagnostic);
+void register_irq_keyhandler(unsigned char key,
+                             irq_keyhandler_fn_t *fn,
+                             const char *desc,
+                             bool_t diagnostic);
 
 /* Inject a keypress into the key-handling subsystem. */
 extern void handle_keypress(unsigned char key, struct cpu_user_regs *regs);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:23:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSb4-0004BP-0u; Thu, 01 Oct 2015 01:23: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 1ZhSb1-0004B7-RV
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:44 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	1C/87-01421-F1B8C065; Thu, 01 Oct 2015 01:23:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1443662619!47897012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18514 invoked from network); 1 Oct 2015 01:23:40 -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;
	1 Oct 2015 01:23: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 1ZhSax-0001jz-Ha
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSax-0003fo-Cw
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:39 +0000
Date: Thu, 01 Oct 2015 01:23:39 +0000
Message-Id: <E1ZhSax-0003fo-Cw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] keyhandler: rework keyhandler
	infrastructure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f96b29118a3ce99b1eb45e79564d5af382395607
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Sep 25 09:06:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:06:34 2015 +0200

    keyhandler: rework keyhandler infrastructure
    
    struct keyhandler does not contain much information, and requires a lot
    of boilerplate to use.  It is far more convenient to have
    register_keyhandler() take each piece of information a parameter,
    especially when introducing temporary debugging keyhandlers.
    
    This in turn allows struct keyhandler itself to become private to
    keyhandler.c and for the key_table to become more efficient.
    
    key_table doesn't need to contain 256 entries; all keys are ASCII which
    limits them to 7 bits of index, rather than 8.  It can also become a
    straight array, rather than an array of pointers.  The overall effect of
    this is the key_table grows in size by 50%, but there are no longer
    24-byte keyhandler structures all over the data section.
    
    All of the key_table entries in keyhandler.c can be initialised at
    compile time rather than runtime.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/acpi/cpu_idle.c             |    8 +-
 xen/arch/x86/hvm/irq.c                   |    8 +-
 xen/arch/x86/hvm/svm/vmcb.c              |    8 +-
 xen/arch/x86/hvm/vmx/vmcs.c              |    8 +-
 xen/arch/x86/io_apic.c                   |    7 +-
 xen/arch/x86/irq.c                       |    8 +-
 xen/arch/x86/mm/p2m-ept.c                |    8 +-
 xen/arch/x86/mm/shadow/common.c          |   14 +--
 xen/arch/x86/msi.c                       |    8 +-
 xen/arch/x86/nmi.c                       |   15 +--
 xen/arch/x86/numa.c                      |    8 +-
 xen/arch/x86/time.c                      |    8 +-
 xen/common/event_channel.c               |    8 +-
 xen/common/grant_table.c                 |    9 +-
 xen/common/kexec.c                       |    7 +-
 xen/common/keyhandler.c                  |  214 ++++++++++++------------------
 xen/common/page_alloc.c                  |   16 +--
 xen/common/timer.c                       |    8 +-
 xen/drivers/char/console.c               |   16 +--
 xen/drivers/passthrough/amd/iommu_intr.c |    9 +-
 xen/drivers/passthrough/iommu.c          |    8 +-
 xen/drivers/passthrough/pci.c            |    8 +-
 xen/drivers/passthrough/vtd/extern.h     |    2 +-
 xen/drivers/passthrough/vtd/iommu.c      |    2 +-
 xen/drivers/passthrough/vtd/utils.c      |    8 +-
 xen/include/xen/keyhandler.h             |   71 +++++------
 26 files changed, 152 insertions(+), 342 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 15fe2e9..d1f99a7 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -334,15 +334,9 @@ static void dump_cx(unsigned char key)
             print_acpi_power(cpu, processor_powers[cpu]);
 }
 
-static struct keyhandler dump_cx_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_cx,
-    .desc = "dump ACPI Cx structures"
-};
-
 static int __init cpu_idle_key_init(void)
 {
-    register_keyhandler('c', &dump_cx_keyhandler);
+    register_keyhandler('c', dump_cx, "dump ACPI Cx structures", 1);
     return 0;
 }
 __initcall(cpu_idle_key_init);
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 50fcf73..990a2ca 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -527,15 +527,9 @@ static void dump_irq_info(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static struct keyhandler dump_irq_info_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_irq_info,
-    .desc = "dump HVM irq info"
-};
-
 static int __init dump_irq_info_key_init(void)
 {
-    register_keyhandler('I', &dump_irq_info_keyhandler);
+    register_keyhandler('I', dump_irq_info, "dump HVM irq info", 1);
     return 0;
 }
 __initcall(dump_irq_info_key_init);
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index b5d7165..9ea014f 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -303,15 +303,9 @@ static void vmcb_dump(unsigned char ch)
     printk("**************************************\n");
 }
 
-static struct keyhandler vmcb_dump_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = vmcb_dump,
-    .desc = "dump AMD-V VMCBs"
-};
-
 void __init setup_vmcb_dump(void)
 {
-    register_keyhandler('v', &vmcb_dump_keyhandler);
+    register_keyhandler('v', vmcb_dump, "dump AMD-V VMCBs", 1);
 }
 
 /*
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 08f2078..15b136b 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1858,15 +1858,9 @@ static void vmcs_dump(unsigned char ch)
     printk("**************************************\n");
 }
 
-static struct keyhandler vmcs_dump_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = vmcs_dump,
-    .desc = "dump Intel's VMCS"
-};
-
 void __init setup_vmcs_dump(void)
 {
-    register_keyhandler('v', &vmcs_dump_keyhandler);
+    register_keyhandler('v', vmcs_dump, "dump VT-x VMCSs", 1);
 }
 
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index b8e37b5..1e710d6 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1251,11 +1251,6 @@ static void _print_IO_APIC_keyhandler(unsigned char key)
 {
     __print_IO_APIC(0);
 }
-static struct keyhandler print_IO_APIC_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = _print_IO_APIC_keyhandler,
-    .desc = "print ioapic info"
-};
 
 static void __init enable_IO_APIC(void)
 {
@@ -2054,7 +2049,7 @@ void __init setup_IO_APIC(void)
     print_IO_APIC();
     ioapic_pm_state_alloc();
 
-    register_keyhandler('z', &print_IO_APIC_keyhandler);
+    register_keyhandler('z', _print_IO_APIC_keyhandler, "dump IOAPIC info", 1);
 }
 
 void ioapic_suspend(void)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index bf2e822..f1397d6 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2316,15 +2316,9 @@ static void dump_irqs(unsigned char key)
     dump_ioapic_irq_info();
 }
 
-static struct keyhandler dump_irqs_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_irqs,
-    .desc = "dump interrupt bindings"
-};
-
 static int __init setup_dump_irqs(void)
 {
-    register_keyhandler('i', &dump_irqs_keyhandler);
+    register_keyhandler('i', dump_irqs, "dump interrupt bindings", 1);
     return 0;
 }
 __initcall(setup_dump_irqs);
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index dde242e..e4d3d6b 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -1257,15 +1257,9 @@ static void ept_dump_p2m_table(unsigned char key)
     }
 }
 
-static struct keyhandler ept_p2m_table = {
-    .diagnostic = 0,
-    .u.fn = ept_dump_p2m_table,
-    .desc = "dump ept p2m table"
-};
-
 void setup_ept_dump(void)
 {
-    register_keyhandler('D', &ept_p2m_table);
+    register_keyhandler('D', ept_dump_p2m_table, "dump VT-x EPT tables", 0);
 }
 
 /*
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 0264b91..3759232 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -97,14 +97,9 @@ static void shadow_audit_key(unsigned char key)
            __func__, shadow_audit_enable);
 }
 
-static struct keyhandler shadow_audit_keyhandler = {
-    .u.fn = shadow_audit_key,
-    .desc = "toggle shadow audits"
-};
-
 static int __init shadow_audit_key_init(void)
 {
-    register_keyhandler('O', &shadow_audit_keyhandler);
+    register_keyhandler('O', shadow_audit_key, "toggle shadow audits", 0);
     return 0;
 }
 __initcall(shadow_audit_key_init);
@@ -1409,15 +1404,10 @@ static void shadow_blow_all_tables(unsigned char c)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static struct keyhandler shadow_blow_all_tables_keyhandler = {
-    .u.fn = shadow_blow_all_tables,
-    .desc = "reset shadow pagetables"
-};
-
 /* Register this function in the Xen console keypress table */
 static __init int shadow_blow_tables_keyhandler_init(void)
 {
-    register_keyhandler('S', &shadow_blow_all_tables_keyhandler);
+    register_keyhandler('S', shadow_blow_all_tables, "reset shadow pagetables", 1);
     return 0;
 }
 __initcall(shadow_blow_tables_keyhandler_init);
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 3dbb84d..5a481f6 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1590,15 +1590,9 @@ static void dump_msi(unsigned char key)
     }
 }
 
-static struct keyhandler dump_msi_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_msi,
-    .desc = "dump MSI state"
-};
-
 static int __init msi_setup_keyhandler(void)
 {
-    register_keyhandler('M', &dump_msi_keyhandler);
+    register_keyhandler('M', dump_msi, "dump MSI state", 1);
     return 0;
 }
 __initcall(msi_setup_keyhandler);
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 2ab97a0..7520454 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -554,11 +554,6 @@ static void do_nmi_trigger(unsigned char key)
     self_nmi();
 }
 
-static struct keyhandler nmi_trigger_keyhandler = {
-    .u.fn = do_nmi_trigger,
-    .desc = "trigger an NMI"
-};
-
 static void do_nmi_stats(unsigned char key)
 {
     int i;
@@ -582,16 +577,10 @@ static void do_nmi_stats(unsigned char key)
         printk("dom0 vcpu0: NMI neither pending nor masked\n");
 }
 
-static struct keyhandler nmi_stats_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = do_nmi_stats,
-    .desc = "NMI statistics"
-};
-
 static __init int register_nmi_trigger(void)
 {
-    register_keyhandler('N', &nmi_trigger_keyhandler);
-    register_keyhandler('n', &nmi_stats_keyhandler);
+    register_keyhandler('N', do_nmi_trigger, "trigger an NMI", 0);
+    register_keyhandler('n', do_nmi_stats, "NMI statistics", 1);
     return 0;
 }
 __initcall(register_nmi_trigger);
diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 3041b24..0e82dd4 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -501,15 +501,9 @@ static void dump_numa(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static struct keyhandler dump_numa_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_numa,
-    .desc = "dump numa info"
-};
-
 static __init int register_numa_trigger(void)
 {
-    register_keyhandler('u', &dump_numa_keyhandler);
+    register_keyhandler('u', dump_numa, "dump NUMA info", 1);
     return 0;
 }
 __initcall(register_numa_trigger);
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bbb7e6c..b334f2f 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2047,15 +2047,9 @@ static void dump_softtsc(unsigned char key)
             printk("No domains have emulated TSC\n");
 }
 
-static struct keyhandler dump_softtsc_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_softtsc,
-    .desc = "dump softtsc stats"
-};
-
 static int __init setup_dump_softtsc(void)
 {
-    register_keyhandler('s', &dump_softtsc_keyhandler);
+    register_keyhandler('s', dump_softtsc, "dump softtsc stats", 1);
     return 0;
 }
 __initcall(setup_dump_softtsc);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index bd334f9..5a529a6 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1431,15 +1431,9 @@ static void dump_evtchn_info(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static struct keyhandler dump_evtchn_info_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_evtchn_info,
-    .desc = "dump evtchn info"
-};
-
 static int __init dump_evtchn_info_key_init(void)
 {
-    register_keyhandler('e', &dump_evtchn_info_keyhandler);
+    register_keyhandler('e', dump_evtchn_info, "dump evtchn info", 1);
     return 0;
 }
 __initcall(dump_evtchn_info_key_init);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 23185e7..c92abda 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3492,12 +3492,6 @@ static void gnttab_usage_print_all(unsigned char key)
     printk("%s ] done\n", __FUNCTION__);
 }
 
-static struct keyhandler gnttab_usage_print_all_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = gnttab_usage_print_all,
-    .desc = "print grant table usage"
-};
-
 static int __init gnttab_usage_init(void)
 {
     if ( max_nr_grant_frames )
@@ -3518,7 +3512,8 @@ static int __init gnttab_usage_init(void)
     if ( !max_maptrack_frames )
         max_maptrack_frames = DEFAULT_MAX_MAPTRACK_FRAMES;
 
-    register_keyhandler('g', &gnttab_usage_print_all_keyhandler);
+    register_keyhandler('g', gnttab_usage_print_all,
+                        "print grant table usage", 1);
     return 0;
 }
 __initcall(gnttab_usage_init);
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 7dd2700..2fc2957 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -374,11 +374,6 @@ static void do_crashdump_trigger(unsigned char key)
     printk(" * no crash kernel loaded!\n");
 }
 
-static struct keyhandler crashdump_trigger_keyhandler = {
-    .u.fn = do_crashdump_trigger,
-    .desc = "trigger a crashdump"
-};
-
 static void setup_note(Elf_Note *n, const char *name, int type, int descsz)
 {
     int l = strlen(name) + 1;
@@ -571,7 +566,7 @@ static int __init kexec_init(void)
     if ( ! crash_notes )
         return -ENOMEM;
 
-    register_keyhandler('C', &crashdump_trigger_keyhandler);
+    register_keyhandler('C', do_crashdump_trigger, "trigger a crashdump", 0);
 
     cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
     register_cpu_notifier(&cpu_nfb);
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 5d21e48..4ff90f6 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -3,7 +3,7 @@
  */
 
 #include <asm/regs.h>
-#include <xen/keyhandler.h> 
+#include <xen/keyhandler.h>
 #include <xen/shutdown.h>
 #include <xen/event.h>
 #include <xen/console.h>
@@ -21,12 +21,58 @@
 #include <asm/debugger.h>
 #include <asm/div64.h>
 
-static struct keyhandler *key_table[256];
 static unsigned char keypress_key;
 static bool_t alt_key_handling;
 
+static keyhandler_fn_t show_handlers, dump_hwdom_registers,
+    dump_domains, read_clocks;
+static irq_keyhandler_fn_t do_toggle_alt_key, dump_registers,
+    reboot_machine, run_all_keyhandlers, do_debug_key;
+
 char keyhandler_scratch[1024];
 
+static struct keyhandler {
+    union {
+        keyhandler_fn_t *fn;
+        irq_keyhandler_fn_t *irq_fn;
+    };
+
+    const char *desc;    /* Description for help message.                 */
+    bool_t irq_callback, /* Call in irq context? if not, tasklet context. */
+        diagnostic;      /* Include in 'dump all' handler.                */
+} key_table[128] __read_mostly =
+{
+#define KEYHANDLER(k, f, desc, diag)            \
+    [k] = { { (f) }, desc, 0, diag }
+
+#define IRQ_KEYHANDLER(k, f, desc, diag)        \
+    [k] = { { (keyhandler_fn_t *)(f) }, desc, 1, diag }
+
+    IRQ_KEYHANDLER('A', do_toggle_alt_key, "toggle alternative key handling", 0),
+    IRQ_KEYHANDLER('d', dump_registers, "dump registers", 1),
+        KEYHANDLER('h', show_handlers, "show this message", 0),
+        KEYHANDLER('q', dump_domains, "dump domain (and guest debug) info", 1),
+        KEYHANDLER('r', dump_runq, "dump run queues", 1),
+    IRQ_KEYHANDLER('R', reboot_machine, "reboot machine", 0),
+        KEYHANDLER('t', read_clocks, "display multi-cpu clock info", 1),
+        KEYHANDLER('0', dump_hwdom_registers, "dump Dom0 registers", 1),
+    IRQ_KEYHANDLER('%', do_debug_key, "trap to xendbg", 0),
+    IRQ_KEYHANDLER('*', run_all_keyhandlers, "print all diagnostics", 0),
+
+#ifdef PERF_COUNTERS
+    KEYHANDLER('p', perfc_printall, "print performance counters", 1),
+    KEYHANDLER('P', perfc_reset, "reset performance counters", 0),
+#endif
+
+#ifdef LOCK_PROFILE
+    KEYHANDLER('l', spinlock_profile_printall, "print lock profile info", 1),
+    KEYHANDLER('L', spinlock_profile_reset, "reset lock profile info", 0),
+#endif
+
+#undef IRQ_KEYHANDLER
+#undef KEYHANDLER
+};
+
 static void keypress_action(unsigned long unused)
 {
     handle_keypress(keypress_key, NULL);
@@ -38,13 +84,13 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
 {
     struct keyhandler *h;
 
-    if ( (h = key_table[key]) == NULL )
+    if ( key >= ARRAY_SIZE(key_table) || !(h = &key_table[key])->fn )
         return;
 
     if ( !in_irq() || h->irq_callback )
     {
         console_start_log_everything();
-        h->irq_callback ? (*h->u.irq_fn)(key, regs) : (*h->u.fn)(key);
+        h->irq_callback ? h->irq_fn(key, regs) : h->fn(key);
         console_end_log_everything();
     }
     else
@@ -54,27 +100,41 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
     }
 }
 
-void register_keyhandler(unsigned char key, struct keyhandler *handler)
+void register_keyhandler(unsigned char key, keyhandler_fn_t fn,
+                         const char *desc, bool_t diagnostic)
 {
-    ASSERT(key_table[key] == NULL);
-    key_table[key] = handler;
+    BUG_ON(key >= ARRAY_SIZE(key_table)); /* Key in range? */
+    ASSERT(!key_table[key].fn);           /* Clobbering something else? */
+
+    key_table[key].fn = fn;
+    key_table[key].desc = desc;
+    key_table[key].irq_callback = 0;
+    key_table[key].diagnostic = diagnostic;
+}
+
+void register_irq_keyhandler(unsigned char key, irq_keyhandler_fn_t fn,
+                             const char *desc, bool_t diagnostic)
+{
+    BUG_ON(key >= ARRAY_SIZE(key_table)); /* Key in range? */
+    ASSERT(!key_table[key].irq_fn);       /* Clobbering something else? */
+
+    key_table[key].irq_fn = fn;
+    key_table[key].desc = desc;
+    key_table[key].irq_callback = 1;
+    key_table[key].diagnostic = diagnostic;
 }
 
 static void show_handlers(unsigned char key)
 {
-    int i;
+    unsigned int i;
+
     printk("'%c' pressed -> showing installed handlers\n", key);
-    for ( i = 0; i < ARRAY_SIZE(key_table); i++ ) 
-        if ( key_table[i] != NULL ) 
-            printk(" key '%c' (ascii '%02x') => %s\n", 
-                   isprint(i) ? i : ' ', i, key_table[i]->desc);
+    for ( i = 0; i < ARRAY_SIZE(key_table); i++ )
+        if ( key_table[i].fn )
+            printk(" key '%c' (ascii '%02x') => %s\n",
+                   isprint(i) ? i : ' ', i, key_table[i].desc);
 }
 
-static struct keyhandler show_handlers_keyhandler = {
-    .u.fn = show_handlers,
-    .desc = "show this message"
-};
-
 static cpumask_t dump_execstate_mask;
 
 void dump_execstate(struct cpu_user_regs *regs)
@@ -141,13 +201,6 @@ static void dump_registers(unsigned char key, struct cpu_user_regs *regs)
     watchdog_enable();
 }
 
-static struct keyhandler dump_registers_keyhandler = {
-    .irq_callback = 1,
-    .diagnostic = 1,
-    .u.irq_fn = dump_registers,
-    .desc = "dump registers"
-};
-
 static DECLARE_TASKLET(dump_hwdom_tasklet, NULL, 0);
 
 static void dump_hwdom_action(unsigned long arg)
@@ -191,24 +244,12 @@ static void dump_hwdom_registers(unsigned char key)
     }
 }
 
-static struct keyhandler dump_hwdom_registers_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_hwdom_registers,
-    .desc = "dump Dom0 registers"
-};
-
 static void reboot_machine(unsigned char key, struct cpu_user_regs *regs)
 {
     printk("'%c' pressed -> rebooting machine\n", key);
     machine_restart(0);
 }
 
-static struct keyhandler reboot_machine_keyhandler = {
-    .irq_callback = 1,
-    .u.irq_fn = reboot_machine,
-    .desc = "reboot machine"
-};
-
 static void cpuset_print(char *set, int size, const cpumask_t *mask)
 {
     *set++ = '{';
@@ -262,8 +303,8 @@ static void dump_domains(unsigned char key)
                atomic_read(&d->refcnt), d->is_dying,
                atomic_read(&d->pause_count));
         printk("    nr_pages=%d xenheap_pages=%d shared_pages=%u paged_pages=%u "
-               "dirty_cpus=%s max_pages=%u\n", d->tot_pages, d->xenheap_pages, 
-                atomic_read(&d->shr_pages), atomic_read(&d->paged_pages), 
+               "dirty_cpus=%s max_pages=%u\n", d->tot_pages, d->xenheap_pages,
+                atomic_read(&d->shr_pages), atomic_read(&d->paged_pages),
                 tmpstr, d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
@@ -282,7 +323,7 @@ static void dump_domains(unsigned char key)
         rangeset_domain_printk(d);
 
         dump_pageframe_info(d);
-               
+
         nodeset_print(tmpstr, sizeof(tmpstr), &d->node_affinity);
         printk("NODE affinity for domain %d: %s\n", d->domain_id, tmpstr);
 
@@ -333,12 +374,6 @@ static void dump_domains(unsigned char key)
 #undef tmpstr
 }
 
-static struct keyhandler dump_domains_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_domains,
-    .desc = "dump domain (and guest debug) info"
-};
-
 static cpumask_t read_clocks_cpumask;
 static DEFINE_PER_CPU(s_time_t, read_clocks_time);
 static DEFINE_PER_CPU(u64, read_cycles_time);
@@ -420,42 +455,6 @@ static void read_clocks(unsigned char key)
            maxdif_cycles, sumdif_cycles/count, count, dif_cycles);
 }
 
-static struct keyhandler read_clocks_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = read_clocks,
-    .desc = "display multi-cpu clock info"
-};
-
-static struct keyhandler dump_runq_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_runq,
-    .desc = "dump run queues"
-};
-
-#ifdef PERF_COUNTERS
-static struct keyhandler perfc_printall_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = perfc_printall,
-    .desc = "print performance counters"
-};
-static struct keyhandler perfc_reset_keyhandler = {
-    .u.fn = perfc_reset,
-    .desc = "reset performance counters"
-};
-#endif
-
-#ifdef LOCK_PROFILE
-static struct keyhandler spinlock_printall_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = spinlock_profile_printall,
-    .desc = "print lock profile info"
-};
-static struct keyhandler spinlock_reset_keyhandler = {
-    .u.fn = spinlock_profile_reset,
-    .desc = "reset lock profile info"
-};
-#endif
-
 static void run_all_nonirq_keyhandlers(unsigned long unused)
 {
     /* Fire all the non-IRQ-context diagnostic keyhandlers */
@@ -467,11 +466,11 @@ static void run_all_nonirq_keyhandlers(unsigned long unused)
     for ( k = 0; k < ARRAY_SIZE(key_table); k++ )
     {
         process_pending_softirqs();
-        h = key_table[k];
-        if ( (h == NULL) || !h->diagnostic || h->irq_callback )
+        h = &key_table[k];
+        if ( !h->fn || !h->diagnostic || h->irq_callback )
             continue;
         printk("[%c: %s]\n", k, h->desc);
-        (*h->u.fn)(k);
+        h->fn(k);
     }
 
     console_end_log_everything();
@@ -483,7 +482,7 @@ static DECLARE_TASKLET(run_all_keyhandlers_tasklet,
 static void run_all_keyhandlers(unsigned char key, struct cpu_user_regs *regs)
 {
     struct keyhandler *h;
-    int k;
+    unsigned int k;
 
     watchdog_disable();
 
@@ -492,11 +491,11 @@ static void run_all_keyhandlers(unsigned char key, struct cpu_user_regs *regs)
     /* Fire all the IRQ-context diangostic keyhandlers now */
     for ( k = 0; k < ARRAY_SIZE(key_table); k++ )
     {
-        h = key_table[k];
-        if ( (h == NULL) || !h->diagnostic || !h->irq_callback )
+        h = &key_table[k];
+        if ( !h->irq_fn || !h->diagnostic || !h->irq_callback )
             continue;
         printk("[%c: %s]\n", k, h->desc);
-        (*h->u.irq_fn)(k, regs);
+        h->irq_fn(k, regs);
     }
 
     watchdog_enable();
@@ -505,12 +504,6 @@ static void run_all_keyhandlers(unsigned char key, struct cpu_user_regs *regs)
     tasklet_schedule(&run_all_keyhandlers_tasklet);
 }
 
-static struct keyhandler run_all_keyhandlers_keyhandler = {
-    .irq_callback = 1,
-    .u.irq_fn = run_all_keyhandlers,
-    .desc = "print all diagnostics"
-};
-
 static void do_debug_key(unsigned char key, struct cpu_user_regs *regs)
 {
     printk("'%c' pressed -> trapping into debugger\n", key);
@@ -520,12 +513,6 @@ static void do_debug_key(unsigned char key, struct cpu_user_regs *regs)
                              bit. */
 }
 
-static struct keyhandler do_debug_key_keyhandler = {
-    .irq_callback = 1,
-    .u.irq_fn = do_debug_key,
-    .desc = "trap to xendbg"
-};
-
 static void do_toggle_alt_key(unsigned char key, struct cpu_user_regs *regs)
 {
     alt_key_handling = !alt_key_handling;
@@ -533,12 +520,6 @@ static void do_toggle_alt_key(unsigned char key, struct cpu_user_regs *regs)
            alt_key_handling ? "alternative" : "normal");
 }
 
-static struct keyhandler toggle_alt_keyhandler = {
-    .irq_callback = 1,
-    .u.irq_fn = do_toggle_alt_key,
-    .desc = "toggle alternative key handling"
-};
-
 void __init initialize_keytable(void)
 {
     if ( num_present_cpus() > 16 )
@@ -547,27 +528,6 @@ void __init initialize_keytable(void)
         printk(XENLOG_INFO "Defaulting to alternative key handling; "
                "send 'A' to switch to normal mode.\n");
     }
-    register_keyhandler('A', &toggle_alt_keyhandler);
-    register_keyhandler('d', &dump_registers_keyhandler);
-    register_keyhandler('h', &show_handlers_keyhandler);
-    register_keyhandler('q', &dump_domains_keyhandler);
-    register_keyhandler('r', &dump_runq_keyhandler);
-    register_keyhandler('R', &reboot_machine_keyhandler);
-    register_keyhandler('t', &read_clocks_keyhandler);
-    register_keyhandler('0', &dump_hwdom_registers_keyhandler);
-    register_keyhandler('%', &do_debug_key_keyhandler);
-    register_keyhandler('*', &run_all_keyhandlers_keyhandler);
-
-#ifdef PERF_COUNTERS
-    register_keyhandler('p', &perfc_printall_keyhandler);
-    register_keyhandler('P', &perfc_reset_keyhandler);
-#endif
-
-#ifdef LOCK_PROFILE
-    register_keyhandler('l', &spinlock_printall_keyhandler);
-    register_keyhandler('L', &spinlock_reset_keyhandler);
-#endif
-
 }
 
 /*
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 74fc1de..2b8810c 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1849,15 +1849,9 @@ static void pagealloc_info(unsigned char key)
     printk("    Dom heap: %lukB free\n", total << (PAGE_SHIFT-10));
 }
 
-static struct keyhandler pagealloc_info_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = pagealloc_info,
-    .desc = "memory info"
-};
-
 static __init int pagealloc_keyhandler_init(void)
 {
-    register_keyhandler('m', &pagealloc_info_keyhandler);
+    register_keyhandler('m', pagealloc_info, "memory info", 1);
     return 0;
 }
 __initcall(pagealloc_keyhandler_init);
@@ -1901,15 +1895,9 @@ static void dump_heap(unsigned char key)
     }
 }
 
-static struct keyhandler dump_heap_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_heap,
-    .desc = "dump heap info"
-};
-
 static __init int register_heap_trigger(void)
 {
-    register_keyhandler('H', &dump_heap_keyhandler);
+    register_keyhandler('H', dump_heap, "dump heap info", 1);
     return 0;
 }
 __initcall(register_heap_trigger);
diff --git a/xen/common/timer.c b/xen/common/timer.c
index f36aebc..29a60a9 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -540,12 +540,6 @@ static void dump_timerq(unsigned char key)
     }
 }
 
-static struct keyhandler dump_timerq_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_timerq,
-    .desc = "dump timer queues"
-};
-
 static void migrate_timers_from_cpu(unsigned int old_cpu)
 {
     unsigned int new_cpu = cpumask_any(&cpu_online_map);
@@ -639,7 +633,7 @@ void __init timer_init(void)
     cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
     register_cpu_notifier(&cpu_nfb);
 
-    register_keyhandler('a', &dump_timerq_keyhandler);
+    register_keyhandler('a', dump_timerq, "dump timer queues", 1);
 }
 
 /*
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index fce4cc8..4362400 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -322,11 +322,6 @@ static void dump_console_ring_key(unsigned char key)
     free_xenheap_pages(buf, order);
 }
 
-static struct keyhandler dump_console_ring_keyhandler = {
-    .u.fn = dump_console_ring_key,
-    .desc = "synchronously dump console ring buffer (dmesg)"
-};
-
 /* CTRL-<switch_char> switches input direction between Xen and DOM0. */
 #define switch_code (opt_conswitch[0]-'a'+1)
 static int __read_mostly xen_rx = 1; /* FALSE => input passed to domain 0. */
@@ -833,7 +828,8 @@ void __init console_endboot(void)
     if ( opt_conswitch[1] == 'x' )
         xen_rx = !xen_rx;
 
-    register_keyhandler('w', &dump_console_ring_keyhandler);
+    register_keyhandler('w', dump_console_ring_key,
+                        "synchronously dump console ring buffer (dmesg)", 0);
 
     /* Serial input is directed to DOM0 by default. */
     switch_serial_input();
@@ -1069,11 +1065,6 @@ static void debugtrace_key(unsigned char key)
     debugtrace_toggle();
 }
 
-static struct keyhandler debugtrace_keyhandler = {
-    .u.fn = debugtrace_key,
-    .desc = "toggle debugtrace to console/buffer"
-};
-
 static int __init debugtrace_init(void)
 {
     int order;
@@ -1095,7 +1086,8 @@ static int __init debugtrace_init(void)
 
     debugtrace_bytes = bytes;
 
-    register_keyhandler('T', &debugtrace_keyhandler);
+    register_keyhandler('T', debugtrace_key,
+                        "toggle debugtrace to console/buffer", 0);
 
     return 0;
 }
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 62e29e9..74c2809 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -36,12 +36,6 @@ static DEFINE_SPINLOCK(shared_intremap_lock);
 
 static void dump_intremap_tables(unsigned char key);
 
-static struct keyhandler dump_intremap = {
-    .diagnostic = 0,
-    .u.fn = dump_intremap_tables,
-    .desc = "dump IOMMU intremap tables"
-};
-
 static spinlock_t* get_intremap_lock(int seg, int req_id)
 {
     return (amd_iommu_perdev_intremap ?
@@ -269,7 +263,8 @@ int __init amd_iommu_setup_ioapic_remapping(void)
         }
     }
 
-    register_keyhandler('V', &dump_intremap);
+    register_keyhandler('V', &dump_intremap_tables,
+                        "dump IOMMU intremap tables", 0);
 
     return 0;
 }
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index aee9d82..3e55abf 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -67,12 +67,6 @@ DEFINE_SPINLOCK(iommu_pt_cleanup_lock);
 PAGE_LIST_HEAD(iommu_pt_cleanup_list);
 static struct tasklet iommu_pt_cleanup_tasklet;
 
-static struct keyhandler iommu_p2m_table = {
-    .diagnostic = 0,
-    .u.fn = iommu_dump_p2m_table,
-    .desc = "dump iommu p2m table"
-};
-
 static void __init parse_iommu_param(char *s)
 {
     char *ss;
@@ -161,7 +155,7 @@ void __hwdom_init iommu_hwdom_init(struct domain *d)
     if ( !iommu_enabled )
         return;
 
-    register_keyhandler('o', &iommu_p2m_table);
+    register_keyhandler('o', &iommu_dump_p2m_table, "dump iommu p2m table", 0);
     d->need_iommu = !!iommu_dom0_strict;
     if ( need_iommu(d) && !iommu_use_hap_pt(d) )
     {
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 27b3ca7..62b311b 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1211,15 +1211,9 @@ static void dump_pci_devices(unsigned char ch)
     spin_unlock(&pcidevs_lock);
 }
 
-struct keyhandler dump_pci_devices_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_pci_devices,
-    .desc = "dump PCI devices"
-};
-
 static int __init setup_dump_pcidevs(void)
 {
-    register_keyhandler('Q', &dump_pci_devices_keyhandler);
+    register_keyhandler('Q', dump_pci_devices, "dump PCI devices", 1);
     return 0;
 }
 __initcall(setup_dump_pcidevs);
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 8acf889..fbfd9a6 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -29,7 +29,7 @@ extern bool_t rwbf_quirk;
 
 void print_iommu_regs(struct acpi_drhd_unit *drhd);
 void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn);
-extern struct keyhandler dump_iommu_info_keyhandler;
+keyhandler_fn_t vtd_dump_iommu_info;
 
 int enable_qinval(struct iommu *iommu);
 void disable_qinval(struct iommu *iommu);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b67b624..4746a55 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2210,7 +2210,7 @@ int __init intel_vtd_setup(void)
     if ( ret )
         goto error;
 
-    register_keyhandler('V', &dump_iommu_info_keyhandler);
+    register_keyhandler('V', vtd_dump_iommu_info, "dump iommu info", 1);
 
     return 0;
 
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index 44c4ef5..36ed3d6 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -177,7 +177,7 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn)
     } while ( --level );
 }
 
-static void dump_iommu_info(unsigned char key)
+void vtd_dump_iommu_info(unsigned char key)
 {
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
@@ -291,12 +291,6 @@ static void dump_iommu_info(unsigned char key)
     }
 }
 
-struct keyhandler dump_iommu_info_keyhandler = {
-    .diagnostic = 1,
-    .u.fn = dump_iommu_info,
-    .desc = "dump iommu info"
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/keyhandler.h b/xen/include/xen/keyhandler.h
index d3ab0a9..39052b5 100644
--- a/xen/include/xen/keyhandler.h
+++ b/xen/include/xen/keyhandler.h
@@ -1,53 +1,48 @@
 /******************************************************************************
  * keyhandler.h
- * 
+ *
  * We keep an array of 'handlers' for each key code between 0 and 255;
- * this is intended to allow very simple debugging routines (toggle 
+ * this is intended to allow very simple debugging routines (toggle
  * debug flag, dump registers, reboot, etc) to be hooked in in a slightly
- * nicer fashion than just editing the serial/keyboard drivers. 
+ * nicer fashion than just editing the serial/keyboard drivers.
  */
 
 #ifndef __XEN_KEYHANDLER_H__
 #define __XEN_KEYHANDLER_H__
 
-typedef void keyhandler_fn_t(
-    unsigned char key);
-typedef void irq_keyhandler_fn_t(
-    unsigned char key, struct cpu_user_regs *regs);
-
-struct keyhandler {
-    /*
-     * If TRUE then u.irq_fn is called in hardirq context with interrupts
-     * disabled. The @regs callback parameter points at the interrupted
-     * register context. 
-     * If FALSE then u.fn is called in softirq context with no locks held and
-     * interrupts enabled.
-     */
-    bool_t irq_callback;
-
-    /*
-     * If TRUE then the keyhandler will be included in the "dump everything"
-     * keyhandler, so must not have any side-effects.
-     */
-    bool_t diagnostic;
-
-    union {
-        keyhandler_fn_t *fn;
-        irq_keyhandler_fn_t *irq_fn;
-    } u;
-
-    /* The string is not copied by register_keyhandler(), so must persist. */
-    char *desc;
-};
-
-/* Initialize keytable with default handlers */
-extern void initialize_keytable(void);
+#include <xen/types.h>
 
 /*
- * Register a callback handler for key @key. The keyhandler structure is not
- * copied, so must persist.
+ * Callback type for keyhander.
+ *
+ * Called in softirq context with interrupts enabled.
  */
-extern void register_keyhandler(unsigned char key, struct keyhandler *handler);
+typedef void (keyhandler_fn_t)(unsigned char key);
+
+/*
+ * Callback type for irq_keyhandler.
+ *
+ * Called in hardirq context with interrupts disabled.
+ */
+typedef void (irq_keyhandler_fn_t)(unsigned char key,
+                                   struct cpu_user_regs *regs);
+
+/* Initialize keytable with default handlers. */
+void initialize_keytable(void);
+
+/*
+ * Regiser a callback handler for key @key for either plain or irq context.
+ * If @diagnostic is set, the handler will be included in the "dump
+ * everything" keyhandler.
+ */
+void register_keyhandler(unsigned char key,
+                         keyhandler_fn_t *fn,
+                         const char *desc,
+                         bool_t diagnostic);
+void register_irq_keyhandler(unsigned char key,
+                             irq_keyhandler_fn_t *fn,
+                             const char *desc,
+                             bool_t diagnostic);
 
 /* Inject a keypress into the key-handling subsystem. */
 extern void handle_keypress(unsigned char key, struct cpu_user_regs *regs);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:23:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSbC-0004Cv-6P; Thu, 01 Oct 2015 01:23:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbB-0004Cj-7h
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:53 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	D0/E7-22142-82B8C065; Thu, 01 Oct 2015 01:23:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1443662630!38976047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23517 invoked from network); 1 Oct 2015 01:23:50 -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;
	1 Oct 2015 01:23: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 1ZhSb7-0001k7-Sn
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSb7-0003gA-PE
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:49 +0000
Date: Thu, 01 Oct 2015 01:23:49 +0000
Message-Id: <E1ZhSb7-0003gA-PE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vt-d: fix IM bit mask and unmask of
	Fault Event Control Register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Fri Sep 25 09:08:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:08:22 2015 +0200

    vt-d: fix IM bit mask and unmask of Fault Event Control Register
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 4746a55..1d8b561 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -991,10 +991,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
     unsigned long flags;
+    u32 sts;
 
     /* unmask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts &= ~DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.host_masked = 0;
 }
@@ -1003,10 +1006,13 @@ static void dma_msi_mask(struct irq_desc *desc)
 {
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
+    u32 sts;
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts |= DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.host_masked = 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 Oct 01 01:23:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:23: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 1ZhSbC-0004Cv-6P; Thu, 01 Oct 2015 01:23:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbB-0004Cj-7h
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:53 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	D0/E7-22142-82B8C065; Thu, 01 Oct 2015 01:23:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1443662630!38976047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23517 invoked from network); 1 Oct 2015 01:23:50 -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;
	1 Oct 2015 01:23: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 1ZhSb7-0001k7-Sn
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSb7-0003gA-PE
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:23:49 +0000
Date: Thu, 01 Oct 2015 01:23:49 +0000
Message-Id: <E1ZhSb7-0003gA-PE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vt-d: fix IM bit mask and unmask of
	Fault Event Control Register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Fri Sep 25 09:08:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 09:08:22 2015 +0200

    vt-d: fix IM bit mask and unmask of Fault Event Control Register
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 4746a55..1d8b561 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -991,10 +991,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
     unsigned long flags;
+    u32 sts;
 
     /* unmask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts &= ~DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.host_masked = 0;
 }
@@ -1003,10 +1006,13 @@ static void dma_msi_mask(struct irq_desc *desc)
 {
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
+    u32 sts;
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts |= DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.host_masked = 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 Oct 01 01:24:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24: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 1ZhSbM-0004EQ-8w; Thu, 01 Oct 2015 01:24: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 1ZhSbL-0004EE-91
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:03 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	A9/25-10678-23B8C065; Thu, 01 Oct 2015 01:24:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1443662640!46734191!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26964 invoked from network); 1 Oct 2015 01:24:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:24: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 1ZhSbI-0001kF-6S
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbI-0003gd-4P
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:00 +0000
Date: Thu, 01 Oct 2015 01:24:00 +0000
Message-Id: <E1ZhSbI-0003gd-4P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce
	libxl__is_igd_vga_passthru
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83215fba3a80c30b5191a4a1086dc510cca43069
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Fri Sep 18 16:30:16 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 15:59:06 2015 +0100

    libxl: introduce libxl__is_igd_vga_passthru
    
    While working with qemu, IGD is a specific device in the case of pass through
    so we need to identify that to handle more later. Here we define a table to
    record all IGD types currently we can support. Also we need to introduce two
    helper functions to get vendor and device ids to lookup that table.
    
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    2 +
 tools/libxl/libxl_pci.c      |  124 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 57cbf38..c2413c2 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1344,6 +1344,8 @@ _hidden int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pc
 _hidden int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
                                       libxl_device_pci *pcidev, int num);
 _hidden int libxl__device_pci_destroy_all(libxl__gc *gc, uint32_t domid);
+_hidden bool libxl__is_igd_vga_passthru(libxl__gc *gc,
+                                        const libxl_domain_config *d_config);
 
 /* from libxl_dtdev */
 
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 7229a36..8434ec8 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -491,6 +491,130 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
     return 0;
 }
 
+static uint16_t sysfs_dev_get_vendor(libxl__gc *gc, libxl_device_pci *pcidev)
+{
+    char *pci_device_vendor_path =
+            GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/vendor",
+                      pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+    uint16_t read_items;
+    uint16_t pci_device_vendor;
+
+    FILE *f = fopen(pci_device_vendor_path, "r");
+    if (!f) {
+        LOGE(ERROR,
+             "pci device "PCI_BDF" does not have vendor attribute",
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+    read_items = fscanf(f, "0x%hx\n", &pci_device_vendor);
+    fclose(f);
+    if (read_items != 1) {
+        LOGE(ERROR,
+             "cannot read vendor of pci device "PCI_BDF,
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+
+    return pci_device_vendor;
+}
+
+static uint16_t sysfs_dev_get_device(libxl__gc *gc, libxl_device_pci *pcidev)
+{
+    char *pci_device_device_path =
+            GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/device",
+                      pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+    uint16_t read_items;
+    uint16_t pci_device_device;
+
+    FILE *f = fopen(pci_device_device_path, "r");
+    if (!f) {
+        LOGE(ERROR,
+             "pci device "PCI_BDF" does not have device attribute",
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+    read_items = fscanf(f, "0x%hx\n", &pci_device_device);
+    fclose(f);
+    if (read_items != 1) {
+        LOGE(ERROR,
+             "cannot read device of pci device "PCI_BDF,
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+
+    return pci_device_device;
+}
+
+typedef struct {
+    uint16_t vendor;
+    uint16_t device;
+} pci_info;
+
+static const pci_info fixup_ids[] = {
+    /* Intel HSW Classic */
+    {0x8086, 0x0402}, /* HSWGT1D, HSWD_w7 */
+    {0x8086, 0x0406}, /* HSWGT1M, HSWM_w7 */
+    {0x8086, 0x0412}, /* HSWGT2D, HSWD_w7 */
+    {0x8086, 0x0416}, /* HSWGT2M, HSWM_w7 */
+    {0x8086, 0x041E}, /* HSWGT15D, HSWD_w7 */
+    /* Intel HSW ULT */
+    {0x8086, 0x0A06}, /* HSWGT1UT, HSWM_w7 */
+    {0x8086, 0x0A16}, /* HSWGT2UT, HSWM_w7 */
+    {0x8086, 0x0A26}, /* HSWGT3UT, HSWM_w7 */
+    {0x8086, 0x0A2E}, /* HSWGT3UT28W, HSWM_w7 */
+    {0x8086, 0x0A1E}, /* HSWGT2UX, HSWM_w7 */
+    {0x8086, 0x0A0E}, /* HSWGT1ULX, HSWM_w7 */
+    /* Intel HSW CRW */
+    {0x8086, 0x0D26}, /* HSWGT3CW, HSWM_w7 */
+    {0x8086, 0x0D22}, /* HSWGT3CWDT, HSWD_w7 */
+    /* Intel HSW Server */
+    {0x8086, 0x041A}, /* HSWSVGT2, HSWD_w7 */
+    /* Intel HSW SRVR */
+    {0x8086, 0x040A}, /* HSWSVGT1, HSWD_w7 */
+    /* Intel BSW */
+    {0x8086, 0x1606}, /* BDWULTGT1, BDWM_w7 */
+    {0x8086, 0x1616}, /* BDWULTGT2, BDWM_w7 */
+    {0x8086, 0x1626}, /* BDWULTGT3, BDWM_w7 */
+    {0x8086, 0x160E}, /* BDWULXGT1, BDWM_w7 */
+    {0x8086, 0x161E}, /* BDWULXGT2, BDWM_w7 */
+    {0x8086, 0x1602}, /* BDWHALOGT1, BDWM_w7 */
+    {0x8086, 0x1612}, /* BDWHALOGT2, BDWM_w7 */
+    {0x8086, 0x1622}, /* BDWHALOGT3, BDWM_w7 */
+    {0x8086, 0x162B}, /* BDWHALO28W, BDWM_w7 */
+    {0x8086, 0x162A}, /* BDWGT3WRKS, BDWM_w7 */
+    {0x8086, 0x162D}, /* BDWGT3SRVR, BDWM_w7 */
+};
+
+/*
+ * Some devices may need some ways to work well. Here like IGD,
+ * we have to pass a specific option to qemu.
+ */
+bool libxl__is_igd_vga_passthru(libxl__gc *gc,
+                                const libxl_domain_config *d_config)
+{
+    unsigned int i, j, num = ARRAY_SIZE(fixup_ids);
+    uint16_t vendor, device, pt_vendor, pt_device;
+
+    for (i = 0 ; i < d_config->num_pcidevs ; i++) {
+        libxl_device_pci *pcidev = &d_config->pcidevs[i];
+        pt_vendor = sysfs_dev_get_vendor(gc, pcidev);
+        pt_device = sysfs_dev_get_device(gc, pcidev);
+
+        if (pt_vendor == 0xffff || pt_device == 0xffff)
+            continue;
+
+        for (j = 0 ; j < num ; j++) {
+            vendor = fixup_ids[j].vendor;
+            device = fixup_ids[j].device;
+
+            if (pt_vendor == vendor &&  pt_device == device)
+                return true;
+        }
+    }
+
+    return false;
+}
+
 /*
  * A brief comment about slots.  I don't know what slots are for; however,
  * I have by experimentation determined:
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:24:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24: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 1ZhSbM-0004EQ-8w; Thu, 01 Oct 2015 01:24: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 1ZhSbL-0004EE-91
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:03 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	A9/25-10678-23B8C065; Thu, 01 Oct 2015 01:24:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1443662640!46734191!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26964 invoked from network); 1 Oct 2015 01:24:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:24: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 1ZhSbI-0001kF-6S
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbI-0003gd-4P
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:00 +0000
Date: Thu, 01 Oct 2015 01:24:00 +0000
Message-Id: <E1ZhSbI-0003gd-4P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce
	libxl__is_igd_vga_passthru
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83215fba3a80c30b5191a4a1086dc510cca43069
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Fri Sep 18 16:30:16 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 15:59:06 2015 +0100

    libxl: introduce libxl__is_igd_vga_passthru
    
    While working with qemu, IGD is a specific device in the case of pass through
    so we need to identify that to handle more later. Here we define a table to
    record all IGD types currently we can support. Also we need to introduce two
    helper functions to get vendor and device ids to lookup that table.
    
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    2 +
 tools/libxl/libxl_pci.c      |  124 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 57cbf38..c2413c2 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1344,6 +1344,8 @@ _hidden int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pc
 _hidden int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
                                       libxl_device_pci *pcidev, int num);
 _hidden int libxl__device_pci_destroy_all(libxl__gc *gc, uint32_t domid);
+_hidden bool libxl__is_igd_vga_passthru(libxl__gc *gc,
+                                        const libxl_domain_config *d_config);
 
 /* from libxl_dtdev */
 
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 7229a36..8434ec8 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -491,6 +491,130 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
     return 0;
 }
 
+static uint16_t sysfs_dev_get_vendor(libxl__gc *gc, libxl_device_pci *pcidev)
+{
+    char *pci_device_vendor_path =
+            GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/vendor",
+                      pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+    uint16_t read_items;
+    uint16_t pci_device_vendor;
+
+    FILE *f = fopen(pci_device_vendor_path, "r");
+    if (!f) {
+        LOGE(ERROR,
+             "pci device "PCI_BDF" does not have vendor attribute",
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+    read_items = fscanf(f, "0x%hx\n", &pci_device_vendor);
+    fclose(f);
+    if (read_items != 1) {
+        LOGE(ERROR,
+             "cannot read vendor of pci device "PCI_BDF,
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+
+    return pci_device_vendor;
+}
+
+static uint16_t sysfs_dev_get_device(libxl__gc *gc, libxl_device_pci *pcidev)
+{
+    char *pci_device_device_path =
+            GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/device",
+                      pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+    uint16_t read_items;
+    uint16_t pci_device_device;
+
+    FILE *f = fopen(pci_device_device_path, "r");
+    if (!f) {
+        LOGE(ERROR,
+             "pci device "PCI_BDF" does not have device attribute",
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+    read_items = fscanf(f, "0x%hx\n", &pci_device_device);
+    fclose(f);
+    if (read_items != 1) {
+        LOGE(ERROR,
+             "cannot read device of pci device "PCI_BDF,
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+
+    return pci_device_device;
+}
+
+typedef struct {
+    uint16_t vendor;
+    uint16_t device;
+} pci_info;
+
+static const pci_info fixup_ids[] = {
+    /* Intel HSW Classic */
+    {0x8086, 0x0402}, /* HSWGT1D, HSWD_w7 */
+    {0x8086, 0x0406}, /* HSWGT1M, HSWM_w7 */
+    {0x8086, 0x0412}, /* HSWGT2D, HSWD_w7 */
+    {0x8086, 0x0416}, /* HSWGT2M, HSWM_w7 */
+    {0x8086, 0x041E}, /* HSWGT15D, HSWD_w7 */
+    /* Intel HSW ULT */
+    {0x8086, 0x0A06}, /* HSWGT1UT, HSWM_w7 */
+    {0x8086, 0x0A16}, /* HSWGT2UT, HSWM_w7 */
+    {0x8086, 0x0A26}, /* HSWGT3UT, HSWM_w7 */
+    {0x8086, 0x0A2E}, /* HSWGT3UT28W, HSWM_w7 */
+    {0x8086, 0x0A1E}, /* HSWGT2UX, HSWM_w7 */
+    {0x8086, 0x0A0E}, /* HSWGT1ULX, HSWM_w7 */
+    /* Intel HSW CRW */
+    {0x8086, 0x0D26}, /* HSWGT3CW, HSWM_w7 */
+    {0x8086, 0x0D22}, /* HSWGT3CWDT, HSWD_w7 */
+    /* Intel HSW Server */
+    {0x8086, 0x041A}, /* HSWSVGT2, HSWD_w7 */
+    /* Intel HSW SRVR */
+    {0x8086, 0x040A}, /* HSWSVGT1, HSWD_w7 */
+    /* Intel BSW */
+    {0x8086, 0x1606}, /* BDWULTGT1, BDWM_w7 */
+    {0x8086, 0x1616}, /* BDWULTGT2, BDWM_w7 */
+    {0x8086, 0x1626}, /* BDWULTGT3, BDWM_w7 */
+    {0x8086, 0x160E}, /* BDWULXGT1, BDWM_w7 */
+    {0x8086, 0x161E}, /* BDWULXGT2, BDWM_w7 */
+    {0x8086, 0x1602}, /* BDWHALOGT1, BDWM_w7 */
+    {0x8086, 0x1612}, /* BDWHALOGT2, BDWM_w7 */
+    {0x8086, 0x1622}, /* BDWHALOGT3, BDWM_w7 */
+    {0x8086, 0x162B}, /* BDWHALO28W, BDWM_w7 */
+    {0x8086, 0x162A}, /* BDWGT3WRKS, BDWM_w7 */
+    {0x8086, 0x162D}, /* BDWGT3SRVR, BDWM_w7 */
+};
+
+/*
+ * Some devices may need some ways to work well. Here like IGD,
+ * we have to pass a specific option to qemu.
+ */
+bool libxl__is_igd_vga_passthru(libxl__gc *gc,
+                                const libxl_domain_config *d_config)
+{
+    unsigned int i, j, num = ARRAY_SIZE(fixup_ids);
+    uint16_t vendor, device, pt_vendor, pt_device;
+
+    for (i = 0 ; i < d_config->num_pcidevs ; i++) {
+        libxl_device_pci *pcidev = &d_config->pcidevs[i];
+        pt_vendor = sysfs_dev_get_vendor(gc, pcidev);
+        pt_device = sysfs_dev_get_device(gc, pcidev);
+
+        if (pt_vendor == 0xffff || pt_device == 0xffff)
+            continue;
+
+        for (j = 0 ; j < num ; j++) {
+            vendor = fixup_ids[j].vendor;
+            device = fixup_ids[j].device;
+
+            if (pt_vendor == vendor &&  pt_device == device)
+                return true;
+        }
+    }
+
+    return false;
+}
+
 /*
  * A brief comment about slots.  I don't know what slots are for; however,
  * I have by experimentation determined:
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:24:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24: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 1ZhSbW-0004G2-Bs; Thu, 01 Oct 2015 01:24: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 1ZhSbV-0004Fn-Hi
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:13 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	23/27-22089-C3B8C065; Thu, 01 Oct 2015 01:24:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1443662650!33588180!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26385 invoked from network); 1 Oct 2015 01:24:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:24: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 1ZhSbS-0001kq-J4
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbS-0003hn-Fd
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:10 +0000
Date: Thu, 01 Oct 2015 01:24:10 +0000
Message-Id: <E1ZhSbS-0003hn-Fd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce gfx_passthru_kind
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 488508b49a65dda20cf6eb6d8f549e8d758e610f
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Fri Sep 18 16:30:17 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 15:59:06 2015 +0100

    libxl: introduce gfx_passthru_kind
    
    Although we already have 'gfx_passthru' in b_info, this doesn't suffice
    after we want to handle IGD specifically. Now we define a new field of
    type, gfx_passthru_kind, to indicate we're trying to pass IGD. Actually
    this means we can benefit this to support other specific devices just
    by extending gfx_passthru_kind. And then we can cooperate with
    gfx_passthru to address IGD cases as follows:
    
        gfx_passthru = 0    => sets build_info.u.gfx_passthru to false
        gfx_passthru = 1    => sets build_info.u.gfx_passthru to true and
                               build_info.u.gfx_passthru_kind to DEFAULT
        gfx_passthru = "igd"    => sets build_info.u.gfx_passthru to true
                                   and build_info.u.gfx_passthru_kind to IGD
    
    Here if gfx_passthru_kind = DEFAULT, we will call
    libxl__is_igd_vga_passthru() to check if we're hitting that table to need
    to pass that option to qemu. But if gfx_passthru_kind = "igd" we always
    force to pass that.
    
    And "-gfx_passthru" is just introduced to work for qemu-xen-traditional
    so we should get this away from libxl__build_device_model_args_new() in
    the case of qemu upstream.
    
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5       |   35 +++++++++++++++++++++++++++++---
 tools/libxl/libxl.h         |    6 +++++
 tools/libxl/libxl_dm.c      |   46 +++++++++++++++++++++++++++++++++++++++---
 tools/libxl/libxl_types.idl |    6 +++++
 tools/libxl/xl_cmdimpl.c    |   14 +++++++++++-
 5 files changed, 97 insertions(+), 10 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 3496bdf..f8fa48f 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -818,7 +818,7 @@ through to this VM. See L<seize|/"seize_boolean"> above.
 devices passed through to this VM. See L<power_mgt|/"power_mgmt_boolean">
 above.
 
-=item B<gfx_passthru=BOOLEAN>
+=item B<gfx_passthru=BOOLEAN|"STRING">
 
 Enable graphics device PCI passthrough. This option makes an assigned
 PCI graphics card become primary graphics card in the VM. The QEMU
@@ -846,9 +846,36 @@ working graphics passthrough. See the XenVGAPassthroughTestedAdapters
 L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters> wiki page
 for currently supported graphics cards for gfx_passthru.
 
-gfx_passthru is currently only supported with the qemu-xen-traditional
-device-model. Upstream qemu-xen device-model currently does not have
-support for gfx_passthru.
+gfx_passthru is currently supported both with the qemu-xen-traditional
+device-model and upstream qemu-xen device-model.
+
+When given as a boolean the B<gfx_passthru> option either disables gfx
+passthru or enables autodetection.
+
+But when given as a string the B<gfx_passthru> option describes the type
+of device to enable. Note this behavior is only supported with the upstream
+qemu-xen device-model. With qemu-xen-traditional IGD is always assumed
+and other options than autodetect or explicit IGD will result in an error.
+
+Currently, valid options are:
+
+=over 4
+
+=item B<gfx_passthru=0>
+
+Disables graphics device PCI passthrough.
+
+=item B<gfx_passthru=1>, B<gfx_passthru="default">
+
+Enables graphics device PCI passthrough and autodetects the type of device
+which is being used.
+
+=item "igd"
+
+Enables graphics device PCI passthrough but forcing the type of device to
+Intel Graphics Device.
+
+=back
 
 Note that some graphics adapters (AMD/ATI cards, for example) do not
 necessarily require gfx_passthru option, so you can use the normal Xen
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 4ee9fbf..f0cc4e1 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -839,6 +839,12 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
  */
 #define LIBXL_HAVE_SRM_V1 1
 
+/*
+ * libxl_domain_build_info has the u.hvm.gfx_passthru_kind field and
+ * the libxl_gfx_passthru_kind enumeration is defined.
+*/
+#define LIBXL_HAVE_GFX_PASSTHRU_KIND
+
 typedef char **libxl_string_list;
 void libxl_string_list_dispose(libxl_string_list *sl);
 int libxl_string_list_length(const libxl_string_list *sl);
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 8be5455..71a1a3e 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -605,7 +605,15 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
             flexarray_vappend(dm_args, "-net", "none", NULL);
         }
         if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
-            flexarray_append(dm_args, "-gfx_passthru");
+            switch (b_info->u.hvm.gfx_passthru_kind) {
+            case LIBXL_GFX_PASSTHRU_KIND_DEFAULT:
+            case LIBXL_GFX_PASSTHRU_KIND_IGD:
+                flexarray_append(dm_args, "-gfx_passthru");
+                break;
+            default:
+                LOG(ERROR, "unsupported gfx_passthru_kind.");
+                return ERROR_INVAL;
+            }
         }
     } else {
         if (!sdl && !vnc)
@@ -700,6 +708,22 @@ static char *dm_spice_options(libxl__gc *gc,
     return opt;
 }
 
+static enum libxl_gfx_passthru_kind
+libxl__detect_gfx_passthru_kind(libxl__gc *gc,
+                                const libxl_domain_config *guest_config)
+{
+    const libxl_domain_build_info *b_info = &guest_config->b_info;
+
+    if (b_info->u.hvm.gfx_passthru_kind != LIBXL_GFX_PASSTHRU_KIND_DEFAULT)
+        return b_info->u.hvm.gfx_passthru_kind;
+
+    if (libxl__is_igd_vga_passthru(gc, guest_config)) {
+        return LIBXL_GFX_PASSTHRU_KIND_IGD;
+    }
+
+    return LIBXL_GFX_PASSTHRU_KIND_DEFAULT;
+}
+
 static int libxl__build_device_model_args_new(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
@@ -1031,9 +1055,6 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, "-net");
             flexarray_append(dm_args, "none");
         }
-        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
-            flexarray_append(dm_args, "-gfx_passthru");
-        }
     } else {
         if (!sdl && !vnc) {
             flexarray_append(dm_args, "-nographic");
@@ -1078,6 +1099,23 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                             machinearg, max_ram_below_4g);
             }
         }
+
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
+            enum libxl_gfx_passthru_kind gfx_passthru_kind =
+                            libxl__detect_gfx_passthru_kind(gc, guest_config);
+            switch (gfx_passthru_kind) {
+            case LIBXL_GFX_PASSTHRU_KIND_IGD:
+                machinearg = GCSPRINTF("%s,igd-passthru=on", machinearg);
+                break;
+            case LIBXL_GFX_PASSTHRU_KIND_DEFAULT:
+                LOG(ERROR, "unable to detect required gfx_passthru_kind");
+                return ERROR_FAIL;
+            default:
+                LOG(ERROR, "invalid value for gfx_passthru_kind");
+                return ERROR_INVAL;
+            }
+        }
+
         flexarray_append(dm_args, machinearg);
         for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
             flexarray_append(dm_args, b_info->extra_hvm[i]);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 87d8255..96e2940 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -159,6 +159,11 @@ libxl_tsc_mode = Enumeration("tsc_mode", [
     (3, "native_paravirt"),
     ])
 
+libxl_gfx_passthru_kind = Enumeration("gfx_passthru_kind", [
+    (0, "default"),
+    (1, "igd"),
+    ])
+
 # Consistent with the values defined for HVM_PARAM_TIMER_MODE.
 libxl_timer_mode = Enumeration("timer_mode", [
     (-1, "unknown"),
@@ -490,6 +495,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("spice",            libxl_spice_info),
                                        
                                        ("gfx_passthru",     libxl_defbool),
+                                       ("gfx_passthru_kind", libxl_gfx_passthru_kind),
                                        
                                        ("serial",           string),
                                        ("boot",             string),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 7db08a3..4dfcd9c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2297,8 +2297,18 @@ skip_vfb:
         xlu_cfg_replace_string (config, "spice_streaming_video",
                                 &b_info->u.hvm.spice.streaming_video, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
-        xlu_cfg_get_defbool(config, "gfx_passthru",
-                            &b_info->u.hvm.gfx_passthru, 0);
+        if (!xlu_cfg_get_long(config, "gfx_passthru", &l, 1)) {
+            libxl_defbool_set(&b_info->u.hvm.gfx_passthru, l);
+        } else if (!xlu_cfg_get_string(config, "gfx_passthru", &buf, 0)) {
+            if (libxl_gfx_passthru_kind_from_string(buf,
+                                        &b_info->u.hvm.gfx_passthru_kind)) {
+                fprintf(stderr,
+                        "ERROR: invalid value \"%s\" for \"gfx_passthru\"\n",
+                        buf);
+                exit (1);
+            }
+            libxl_defbool_set(&b_info->u.hvm.gfx_passthru, true);
+        }
         switch (xlu_cfg_get_list_as_string_list(config, "serial",
                                                 &b_info->u.hvm.serial_list,
                                                 1))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:24:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24: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 1ZhSbW-0004G2-Bs; Thu, 01 Oct 2015 01:24: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 1ZhSbV-0004Fn-Hi
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:13 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	23/27-22089-C3B8C065; Thu, 01 Oct 2015 01:24:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1443662650!33588180!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26385 invoked from network); 1 Oct 2015 01:24:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:24: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 1ZhSbS-0001kq-J4
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbS-0003hn-Fd
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:10 +0000
Date: Thu, 01 Oct 2015 01:24:10 +0000
Message-Id: <E1ZhSbS-0003hn-Fd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce gfx_passthru_kind
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 488508b49a65dda20cf6eb6d8f549e8d758e610f
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Fri Sep 18 16:30:17 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 15:59:06 2015 +0100

    libxl: introduce gfx_passthru_kind
    
    Although we already have 'gfx_passthru' in b_info, this doesn't suffice
    after we want to handle IGD specifically. Now we define a new field of
    type, gfx_passthru_kind, to indicate we're trying to pass IGD. Actually
    this means we can benefit this to support other specific devices just
    by extending gfx_passthru_kind. And then we can cooperate with
    gfx_passthru to address IGD cases as follows:
    
        gfx_passthru = 0    => sets build_info.u.gfx_passthru to false
        gfx_passthru = 1    => sets build_info.u.gfx_passthru to true and
                               build_info.u.gfx_passthru_kind to DEFAULT
        gfx_passthru = "igd"    => sets build_info.u.gfx_passthru to true
                                   and build_info.u.gfx_passthru_kind to IGD
    
    Here if gfx_passthru_kind = DEFAULT, we will call
    libxl__is_igd_vga_passthru() to check if we're hitting that table to need
    to pass that option to qemu. But if gfx_passthru_kind = "igd" we always
    force to pass that.
    
    And "-gfx_passthru" is just introduced to work for qemu-xen-traditional
    so we should get this away from libxl__build_device_model_args_new() in
    the case of qemu upstream.
    
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5       |   35 +++++++++++++++++++++++++++++---
 tools/libxl/libxl.h         |    6 +++++
 tools/libxl/libxl_dm.c      |   46 +++++++++++++++++++++++++++++++++++++++---
 tools/libxl/libxl_types.idl |    6 +++++
 tools/libxl/xl_cmdimpl.c    |   14 +++++++++++-
 5 files changed, 97 insertions(+), 10 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 3496bdf..f8fa48f 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -818,7 +818,7 @@ through to this VM. See L<seize|/"seize_boolean"> above.
 devices passed through to this VM. See L<power_mgt|/"power_mgmt_boolean">
 above.
 
-=item B<gfx_passthru=BOOLEAN>
+=item B<gfx_passthru=BOOLEAN|"STRING">
 
 Enable graphics device PCI passthrough. This option makes an assigned
 PCI graphics card become primary graphics card in the VM. The QEMU
@@ -846,9 +846,36 @@ working graphics passthrough. See the XenVGAPassthroughTestedAdapters
 L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters> wiki page
 for currently supported graphics cards for gfx_passthru.
 
-gfx_passthru is currently only supported with the qemu-xen-traditional
-device-model. Upstream qemu-xen device-model currently does not have
-support for gfx_passthru.
+gfx_passthru is currently supported both with the qemu-xen-traditional
+device-model and upstream qemu-xen device-model.
+
+When given as a boolean the B<gfx_passthru> option either disables gfx
+passthru or enables autodetection.
+
+But when given as a string the B<gfx_passthru> option describes the type
+of device to enable. Note this behavior is only supported with the upstream
+qemu-xen device-model. With qemu-xen-traditional IGD is always assumed
+and other options than autodetect or explicit IGD will result in an error.
+
+Currently, valid options are:
+
+=over 4
+
+=item B<gfx_passthru=0>
+
+Disables graphics device PCI passthrough.
+
+=item B<gfx_passthru=1>, B<gfx_passthru="default">
+
+Enables graphics device PCI passthrough and autodetects the type of device
+which is being used.
+
+=item "igd"
+
+Enables graphics device PCI passthrough but forcing the type of device to
+Intel Graphics Device.
+
+=back
 
 Note that some graphics adapters (AMD/ATI cards, for example) do not
 necessarily require gfx_passthru option, so you can use the normal Xen
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 4ee9fbf..f0cc4e1 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -839,6 +839,12 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
  */
 #define LIBXL_HAVE_SRM_V1 1
 
+/*
+ * libxl_domain_build_info has the u.hvm.gfx_passthru_kind field and
+ * the libxl_gfx_passthru_kind enumeration is defined.
+*/
+#define LIBXL_HAVE_GFX_PASSTHRU_KIND
+
 typedef char **libxl_string_list;
 void libxl_string_list_dispose(libxl_string_list *sl);
 int libxl_string_list_length(const libxl_string_list *sl);
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 8be5455..71a1a3e 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -605,7 +605,15 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
             flexarray_vappend(dm_args, "-net", "none", NULL);
         }
         if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
-            flexarray_append(dm_args, "-gfx_passthru");
+            switch (b_info->u.hvm.gfx_passthru_kind) {
+            case LIBXL_GFX_PASSTHRU_KIND_DEFAULT:
+            case LIBXL_GFX_PASSTHRU_KIND_IGD:
+                flexarray_append(dm_args, "-gfx_passthru");
+                break;
+            default:
+                LOG(ERROR, "unsupported gfx_passthru_kind.");
+                return ERROR_INVAL;
+            }
         }
     } else {
         if (!sdl && !vnc)
@@ -700,6 +708,22 @@ static char *dm_spice_options(libxl__gc *gc,
     return opt;
 }
 
+static enum libxl_gfx_passthru_kind
+libxl__detect_gfx_passthru_kind(libxl__gc *gc,
+                                const libxl_domain_config *guest_config)
+{
+    const libxl_domain_build_info *b_info = &guest_config->b_info;
+
+    if (b_info->u.hvm.gfx_passthru_kind != LIBXL_GFX_PASSTHRU_KIND_DEFAULT)
+        return b_info->u.hvm.gfx_passthru_kind;
+
+    if (libxl__is_igd_vga_passthru(gc, guest_config)) {
+        return LIBXL_GFX_PASSTHRU_KIND_IGD;
+    }
+
+    return LIBXL_GFX_PASSTHRU_KIND_DEFAULT;
+}
+
 static int libxl__build_device_model_args_new(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
@@ -1031,9 +1055,6 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, "-net");
             flexarray_append(dm_args, "none");
         }
-        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
-            flexarray_append(dm_args, "-gfx_passthru");
-        }
     } else {
         if (!sdl && !vnc) {
             flexarray_append(dm_args, "-nographic");
@@ -1078,6 +1099,23 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                             machinearg, max_ram_below_4g);
             }
         }
+
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
+            enum libxl_gfx_passthru_kind gfx_passthru_kind =
+                            libxl__detect_gfx_passthru_kind(gc, guest_config);
+            switch (gfx_passthru_kind) {
+            case LIBXL_GFX_PASSTHRU_KIND_IGD:
+                machinearg = GCSPRINTF("%s,igd-passthru=on", machinearg);
+                break;
+            case LIBXL_GFX_PASSTHRU_KIND_DEFAULT:
+                LOG(ERROR, "unable to detect required gfx_passthru_kind");
+                return ERROR_FAIL;
+            default:
+                LOG(ERROR, "invalid value for gfx_passthru_kind");
+                return ERROR_INVAL;
+            }
+        }
+
         flexarray_append(dm_args, machinearg);
         for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
             flexarray_append(dm_args, b_info->extra_hvm[i]);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 87d8255..96e2940 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -159,6 +159,11 @@ libxl_tsc_mode = Enumeration("tsc_mode", [
     (3, "native_paravirt"),
     ])
 
+libxl_gfx_passthru_kind = Enumeration("gfx_passthru_kind", [
+    (0, "default"),
+    (1, "igd"),
+    ])
+
 # Consistent with the values defined for HVM_PARAM_TIMER_MODE.
 libxl_timer_mode = Enumeration("timer_mode", [
     (-1, "unknown"),
@@ -490,6 +495,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("spice",            libxl_spice_info),
                                        
                                        ("gfx_passthru",     libxl_defbool),
+                                       ("gfx_passthru_kind", libxl_gfx_passthru_kind),
                                        
                                        ("serial",           string),
                                        ("boot",             string),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 7db08a3..4dfcd9c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2297,8 +2297,18 @@ skip_vfb:
         xlu_cfg_replace_string (config, "spice_streaming_video",
                                 &b_info->u.hvm.spice.streaming_video, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
-        xlu_cfg_get_defbool(config, "gfx_passthru",
-                            &b_info->u.hvm.gfx_passthru, 0);
+        if (!xlu_cfg_get_long(config, "gfx_passthru", &l, 1)) {
+            libxl_defbool_set(&b_info->u.hvm.gfx_passthru, l);
+        } else if (!xlu_cfg_get_string(config, "gfx_passthru", &buf, 0)) {
+            if (libxl_gfx_passthru_kind_from_string(buf,
+                                        &b_info->u.hvm.gfx_passthru_kind)) {
+                fprintf(stderr,
+                        "ERROR: invalid value \"%s\" for \"gfx_passthru\"\n",
+                        buf);
+                exit (1);
+            }
+            libxl_defbool_set(&b_info->u.hvm.gfx_passthru, true);
+        }
         switch (xlu_cfg_get_list_as_string_list(config, "serial",
                                                 &b_info->u.hvm.serial_list,
                                                 1))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:24:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24: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 1ZhSbg-0004HS-EY; Thu, 01 Oct 2015 01:24:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbf-0004HI-97
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:23 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	CA/37-31450-64B8C065; Thu, 01 Oct 2015 01:24:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1443662660!23270611!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1956 invoked from network); 1 Oct 2015 01:24:21 -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;
	1 Oct 2015 01:24: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 1ZhSbc-0001ky-Q3
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbc-0003i9-Ow
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:20 +0000
Date: Thu, 01 Oct 2015 01:24:20 +0000
Message-Id: <E1ZhSbc-0003i9-Ow@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove useless stuff from
	domain builder
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f8e469520a4987936764fc30f0d6e1a93dfebe1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Sep 22 14:20:52 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 16:04:22 2015 +0100

    libxc: remove useless stuff from domain builder
    
    Remove unused fields from the domain builder and associated functions.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h      |    2 --
 tools/python/xen/lowlevel/xc/xc.c |   10 +++-------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 600aef6..602c5cd 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -132,7 +132,6 @@ struct xc_dom_image {
     xen_pfn_t total_pages;
     xen_pfn_t p2m_size;         /* number of pfns covered by p2m */
     struct xc_dom_phys *phys_pages;
-    int realmodearea_log;
 #if defined (__arm__) || defined(__aarch64__)
     xen_pfn_t rambank_size[GUEST_RAM_BANKS];
 #endif
@@ -157,7 +156,6 @@ struct xc_dom_image {
 
     xc_interface *xch;
     domid_t guest_domid;
-    int8_t vhpt_size_log2; /* for IA64 */
     int8_t superpages;
     int claim_enabled; /* 0 by default, 1 enables it */
     int shadow_enabled;
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 9ab53fb..67afed4 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -463,7 +463,6 @@ static PyObject *pyxc_linux_build(XcObject *self,
     char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
     int flags = 0;
     int store_evtchn, console_evtchn;
-    int vhpt = 0;
     int superpages = 0;
     unsigned int mem_mb;
     unsigned long store_mfn = 0;
@@ -477,23 +476,20 @@ static PyObject *pyxc_linux_build(XcObject *self,
                                 "console_evtchn", "image",
                                 /* optional */
                                 "ramdisk", "cmdline", "flags",
-                                "features", "vhpt", "superpages", NULL };
+                                "features", "superpages", NULL };
 
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssisii", kwd_list,
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssisi", kwd_list,
                                       &domid, &store_evtchn, &mem_mb,
                                       &console_evtchn, &image,
                                       /* optional */
                                       &ramdisk, &cmdline, &flags,
-                                      &features, &vhpt, &superpages) )
+                                      &features, &superpages) )
         return NULL;
 
     xc_dom_loginit(self->xc_handle);
     if (!(dom = xc_dom_allocate(self->xc_handle, cmdline, features)))
         return pyxc_error_to_exception(self->xc_handle);
 
-    /* for IA64 */
-    dom->vhpt_size_log2 = vhpt;
-
     dom->superpages = superpages;
 
     if ( xc_dom_linux_build(self->xc_handle, dom, domid, mem_mb, image,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:24:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24: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 1ZhSbg-0004HS-EY; Thu, 01 Oct 2015 01:24:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbf-0004HI-97
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:23 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	CA/37-31450-64B8C065; Thu, 01 Oct 2015 01:24:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1443662660!23270611!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1956 invoked from network); 1 Oct 2015 01:24:21 -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;
	1 Oct 2015 01:24: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 1ZhSbc-0001ky-Q3
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbc-0003i9-Ow
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:20 +0000
Date: Thu, 01 Oct 2015 01:24:20 +0000
Message-Id: <E1ZhSbc-0003i9-Ow@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove useless stuff from
	domain builder
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f8e469520a4987936764fc30f0d6e1a93dfebe1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Sep 22 14:20:52 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 16:04:22 2015 +0100

    libxc: remove useless stuff from domain builder
    
    Remove unused fields from the domain builder and associated functions.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h      |    2 --
 tools/python/xen/lowlevel/xc/xc.c |   10 +++-------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 600aef6..602c5cd 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -132,7 +132,6 @@ struct xc_dom_image {
     xen_pfn_t total_pages;
     xen_pfn_t p2m_size;         /* number of pfns covered by p2m */
     struct xc_dom_phys *phys_pages;
-    int realmodearea_log;
 #if defined (__arm__) || defined(__aarch64__)
     xen_pfn_t rambank_size[GUEST_RAM_BANKS];
 #endif
@@ -157,7 +156,6 @@ struct xc_dom_image {
 
     xc_interface *xch;
     domid_t guest_domid;
-    int8_t vhpt_size_log2; /* for IA64 */
     int8_t superpages;
     int claim_enabled; /* 0 by default, 1 enables it */
     int shadow_enabled;
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 9ab53fb..67afed4 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -463,7 +463,6 @@ static PyObject *pyxc_linux_build(XcObject *self,
     char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
     int flags = 0;
     int store_evtchn, console_evtchn;
-    int vhpt = 0;
     int superpages = 0;
     unsigned int mem_mb;
     unsigned long store_mfn = 0;
@@ -477,23 +476,20 @@ static PyObject *pyxc_linux_build(XcObject *self,
                                 "console_evtchn", "image",
                                 /* optional */
                                 "ramdisk", "cmdline", "flags",
-                                "features", "vhpt", "superpages", NULL };
+                                "features", "superpages", NULL };
 
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssisii", kwd_list,
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssisi", kwd_list,
                                       &domid, &store_evtchn, &mem_mb,
                                       &console_evtchn, &image,
                                       /* optional */
                                       &ramdisk, &cmdline, &flags,
-                                      &features, &vhpt, &superpages) )
+                                      &features, &superpages) )
         return NULL;
 
     xc_dom_loginit(self->xc_handle);
     if (!(dom = xc_dom_allocate(self->xc_handle, cmdline, features)))
         return pyxc_error_to_exception(self->xc_handle);
 
-    /* for IA64 */
-    dom->vhpt_size_log2 = vhpt;
-
     dom->superpages = superpages;
 
     if ( xc_dom_linux_build(self->xc_handle, dom, domid, mem_mb, image,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:24:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhSbq-0004J5-HC; Thu, 01 Oct 2015 01:24:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbp-0004Ir-Vz
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:34 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	AB/C3-32641-15B8C065; Thu, 01 Oct 2015 01:24:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1443662671!17958777!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1565 invoked from network); 1 Oct 2015 01:24:32 -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;
	1 Oct 2015 01:24: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 1ZhSbn-0001l6-5g
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbm-0003iV-V7
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:31 +0000
Date: Thu, 01 Oct 2015 01:24:30 +0000
Message-Id: <E1ZhSbm-0003iV-V7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: do initrd processing of domain
	builder in own function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit add29edab82957b22bb2cf9d518d123bf1ad97f2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Sep 11 14:32:19 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 16:12:00 2015 +0100

    libxc: do initrd processing of domain builder in own function
    
    Factor out the initrd processing in xc_dom_build_image() into an own
    function to prepare starting a domain with unmapped initrd.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_core.c |   77 +++++++++++++++++++++++++--------------------
 1 files changed, 43 insertions(+), 34 deletions(-)

diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 8466677..fbe4464 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -957,6 +957,48 @@ int xc_dom_update_guest_p2m(struct xc_dom_image *dom)
     return 0;
 }
 
+static int xc_dom_build_ramdisk(struct xc_dom_image *dom)
+{
+    size_t unziplen, ramdisklen;
+    void *ramdiskmap;
+
+    if ( !dom->ramdisk_seg.vstart )
+    {
+        unziplen = xc_dom_check_gzip(dom->xch,
+                                     dom->ramdisk_blob, dom->ramdisk_size);
+        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
+            unziplen = 0;
+    }
+    else
+        unziplen = 0;
+
+    ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
+
+    if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk",
+                              dom->ramdisk_seg.vstart, ramdisklen) != 0 )
+        goto err;
+    ramdiskmap = xc_dom_seg_to_ptr(dom, &dom->ramdisk_seg);
+    if ( ramdiskmap == NULL )
+    {
+        DOMPRINTF("%s: xc_dom_seg_to_ptr(dom, &dom->ramdisk_seg) => NULL",
+                  __FUNCTION__);
+        goto err;
+    }
+    if ( unziplen )
+    {
+        if ( xc_dom_do_gunzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size,
+                              ramdiskmap, ramdisklen) == -1 )
+            goto err;
+    }
+    else
+        memcpy(ramdiskmap, dom->ramdisk_blob, dom->ramdisk_size);
+
+    return 0;
+
+ err:
+    return -1;
+}
+
 int xc_dom_build_image(struct xc_dom_image *dom)
 {
     unsigned int page_size;
@@ -984,41 +1026,8 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     /* load ramdisk */
     if ( dom->ramdisk_blob )
     {
-        size_t unziplen, ramdisklen;
-        void *ramdiskmap;
-
-        if ( !dom->ramdisk_seg.vstart )
-        {
-            unziplen = xc_dom_check_gzip(dom->xch,
-                                         dom->ramdisk_blob, dom->ramdisk_size);
-            if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
-                unziplen = 0;
-        }
-        else
-            unziplen = 0;
-
-        ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
-
-        if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk",
-                                  dom->ramdisk_seg.vstart,
-                                  ramdisklen) != 0 )
+        if ( xc_dom_build_ramdisk(dom) != 0 )
             goto err;
-        ramdiskmap = xc_dom_seg_to_ptr(dom, &dom->ramdisk_seg);
-        if ( ramdiskmap == NULL )
-        {
-            DOMPRINTF("%s: xc_dom_seg_to_ptr(dom, &dom->ramdisk_seg) => NULL",
-                      __FUNCTION__);
-            goto err;
-        }
-        if ( unziplen )
-        {
-            if ( xc_dom_do_gunzip(dom->xch,
-                                  dom->ramdisk_blob, dom->ramdisk_size,
-                                  ramdiskmap, ramdisklen) == -1 )
-                goto err;
-        }
-        else
-            memcpy(ramdiskmap, dom->ramdisk_blob, dom->ramdisk_size);
     }
 
     /* load devicetree */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:24:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhSbq-0004J5-HC; Thu, 01 Oct 2015 01:24:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbp-0004Ir-Vz
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:34 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	AB/C3-32641-15B8C065; Thu, 01 Oct 2015 01:24:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1443662671!17958777!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1565 invoked from network); 1 Oct 2015 01:24:32 -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;
	1 Oct 2015 01:24: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 1ZhSbn-0001l6-5g
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbm-0003iV-V7
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:31 +0000
Date: Thu, 01 Oct 2015 01:24:30 +0000
Message-Id: <E1ZhSbm-0003iV-V7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: do initrd processing of domain
	builder in own function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit add29edab82957b22bb2cf9d518d123bf1ad97f2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Sep 11 14:32:19 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 16:12:00 2015 +0100

    libxc: do initrd processing of domain builder in own function
    
    Factor out the initrd processing in xc_dom_build_image() into an own
    function to prepare starting a domain with unmapped initrd.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_core.c |   77 +++++++++++++++++++++++++--------------------
 1 files changed, 43 insertions(+), 34 deletions(-)

diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 8466677..fbe4464 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -957,6 +957,48 @@ int xc_dom_update_guest_p2m(struct xc_dom_image *dom)
     return 0;
 }
 
+static int xc_dom_build_ramdisk(struct xc_dom_image *dom)
+{
+    size_t unziplen, ramdisklen;
+    void *ramdiskmap;
+
+    if ( !dom->ramdisk_seg.vstart )
+    {
+        unziplen = xc_dom_check_gzip(dom->xch,
+                                     dom->ramdisk_blob, dom->ramdisk_size);
+        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
+            unziplen = 0;
+    }
+    else
+        unziplen = 0;
+
+    ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
+
+    if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk",
+                              dom->ramdisk_seg.vstart, ramdisklen) != 0 )
+        goto err;
+    ramdiskmap = xc_dom_seg_to_ptr(dom, &dom->ramdisk_seg);
+    if ( ramdiskmap == NULL )
+    {
+        DOMPRINTF("%s: xc_dom_seg_to_ptr(dom, &dom->ramdisk_seg) => NULL",
+                  __FUNCTION__);
+        goto err;
+    }
+    if ( unziplen )
+    {
+        if ( xc_dom_do_gunzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size,
+                              ramdiskmap, ramdisklen) == -1 )
+            goto err;
+    }
+    else
+        memcpy(ramdiskmap, dom->ramdisk_blob, dom->ramdisk_size);
+
+    return 0;
+
+ err:
+    return -1;
+}
+
 int xc_dom_build_image(struct xc_dom_image *dom)
 {
     unsigned int page_size;
@@ -984,41 +1026,8 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     /* load ramdisk */
     if ( dom->ramdisk_blob )
     {
-        size_t unziplen, ramdisklen;
-        void *ramdiskmap;
-
-        if ( !dom->ramdisk_seg.vstart )
-        {
-            unziplen = xc_dom_check_gzip(dom->xch,
-                                         dom->ramdisk_blob, dom->ramdisk_size);
-            if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
-                unziplen = 0;
-        }
-        else
-            unziplen = 0;
-
-        ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
-
-        if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk",
-                                  dom->ramdisk_seg.vstart,
-                                  ramdisklen) != 0 )
+        if ( xc_dom_build_ramdisk(dom) != 0 )
             goto err;
-        ramdiskmap = xc_dom_seg_to_ptr(dom, &dom->ramdisk_seg);
-        if ( ramdiskmap == NULL )
-        {
-            DOMPRINTF("%s: xc_dom_seg_to_ptr(dom, &dom->ramdisk_seg) => NULL",
-                      __FUNCTION__);
-            goto err;
-        }
-        if ( unziplen )
-        {
-            if ( xc_dom_do_gunzip(dom->xch,
-                                  dom->ramdisk_blob, dom->ramdisk_size,
-                                  ramdiskmap, ramdisklen) == -1 )
-                goto err;
-        }
-        else
-            memcpy(ramdiskmap, dom->ramdisk_blob, dom->ramdisk_size);
     }
 
     /* load devicetree */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 01:24:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24: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 1ZhSc5-0004LG-M4; Thu, 01 Oct 2015 01:24: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 1ZhSc4-0004L9-U9
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:49 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	D7/11-03763-06B8C065; Thu, 01 Oct 2015 01:24:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1443662686!14523627!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8091 invoked from network); 1 Oct 2015 01:24:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:24:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSc2-0001lE-F0
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbx-0003jO-CT
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:41 +0000
Date: Thu, 01 Oct 2015 01:24:41 +0000
Message-Id: <E1ZhSbx-0003jO-CT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vt-d: fix IM bit unmask of Fault Event
	Control Register in init_vtd_hw()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26b300bd727ef00a8f60329212a83c3b027a48f7
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Fri Sep 25 18:03:04 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 18:03:04 2015 +0200

    vt-d: fix IM bit unmask of Fault Event Control Register in init_vtd_hw()
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Quan Xu <quan.xu@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 1d8b561..8254937 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2012,6 +2012,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2025,7 +2026,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:24:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:24: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 1ZhSc5-0004LG-M4; Thu, 01 Oct 2015 01:24: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 1ZhSc4-0004L9-U9
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:49 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	D7/11-03763-06B8C065; Thu, 01 Oct 2015 01:24:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1443662686!14523627!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8091 invoked from network); 1 Oct 2015 01:24:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:24:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSc2-0001lE-F0
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhSbx-0003jO-CT
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:41 +0000
Date: Thu, 01 Oct 2015 01:24:41 +0000
Message-Id: <E1ZhSbx-0003jO-CT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vt-d: fix IM bit unmask of Fault Event
	Control Register in init_vtd_hw()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26b300bd727ef00a8f60329212a83c3b027a48f7
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Fri Sep 25 18:03:04 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 18:03:04 2015 +0200

    vt-d: fix IM bit unmask of Fault Event Control Register in init_vtd_hw()
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Quan Xu <quan.xu@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 1d8b561..8254937 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2012,6 +2012,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2025,7 +2026,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:25:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:25:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhScG-0004Mo-PD; Thu, 01 Oct 2015 01:25: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 1ZhScF-0004MZ-FQ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:59 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	E9/73-10422-A6B8C065; Thu, 01 Oct 2015 01:24:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1443662697!38980042!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6207 invoked from network); 1 Oct 2015 01:24:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:24: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 1ZhScD-0001lZ-82
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScD-0003k2-1x
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:57 +0000
Date: Thu, 01 Oct 2015 01:24:57 +0000
Message-Id: <E1ZhScD-0003k2-1x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fix comment coding style in
	handle_node in domain_build.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 d8e43d188e7b40dd19980c22dc5fe5cb5e93b7c7
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 22 18:47:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 17:02:48 2015 +0100

    xen/arm: Fix comment coding style in handle_node in domain_build.c
    
    Only coding style changes. No functional changes.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a059de6..72b1845 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1226,8 +1226,10 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
-    /* Replace these nodes with our own. Note that the original may be
-     * used_by DOMID_XEN so this check comes first. */
+    /*
+     * Replace these nodes with our own. Note that the original may be
+     * used_by DOMID_XEN so this check comes first.
+     */
     if ( device_get_class(node) == DEVICE_GIC )
         return make_gic_node(d, kinfo->fdt, node);
     if ( dt_match_node(timer_matches, node) )
@@ -1240,7 +1242,8 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
-    /* Even if the IOMMU device is not used by Xen, it should not be
+    /*
+     * Even if the IOMMU device is not used by Xen, it should not be
      * passthrough to DOM0
      */
     if ( device_get_class(node) == DEVICE_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 Thu Oct 01 01:25:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:25:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhScG-0004Mo-PD; Thu, 01 Oct 2015 01:25: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 1ZhScF-0004MZ-FQ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:59 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	E9/73-10422-A6B8C065; Thu, 01 Oct 2015 01:24:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1443662697!38980042!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6207 invoked from network); 1 Oct 2015 01:24:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:24: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 1ZhScD-0001lZ-82
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScD-0003k2-1x
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:24:57 +0000
Date: Thu, 01 Oct 2015 01:24:57 +0000
Message-Id: <E1ZhScD-0003k2-1x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fix comment coding style in
	handle_node in domain_build.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 d8e43d188e7b40dd19980c22dc5fe5cb5e93b7c7
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 22 18:47:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 17:02:48 2015 +0100

    xen/arm: Fix comment coding style in handle_node in domain_build.c
    
    Only coding style changes. No functional changes.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a059de6..72b1845 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1226,8 +1226,10 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
-    /* Replace these nodes with our own. Note that the original may be
-     * used_by DOMID_XEN so this check comes first. */
+    /*
+     * Replace these nodes with our own. Note that the original may be
+     * used_by DOMID_XEN so this check comes first.
+     */
     if ( device_get_class(node) == DEVICE_GIC )
         return make_gic_node(d, kinfo->fdt, node);
     if ( dt_match_node(timer_matches, node) )
@@ -1240,7 +1242,8 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
-    /* Even if the IOMMU device is not used by Xen, it should not be
+    /*
+     * Even if the IOMMU device is not used by Xen, it should not be
      * passthrough to DOM0
      */
     if ( device_get_class(node) == DEVICE_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 Thu Oct 01 01:25:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhScQ-0004OL-TL; Thu, 01 Oct 2015 01:25:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScP-0004O1-VT
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:10 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	93/F3-32615-57B8C065; Thu, 01 Oct 2015 01:25:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1443662707!33710241!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29744 invoked from network); 1 Oct 2015 01:25:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:25: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 1ZhScN-0001mB-HB
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScN-0003kj-FD
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:07 +0000
Date: Thu, 01 Oct 2015 01:25:07 +0000
Message-Id: <E1ZhScN-0003kj-FD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	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 94760fe10b8a3cf4835c950b9c66c43539ed3dbc
Merge: 26b300bd727ef00a8f60329212a83c3b027a48f7 d8e43d188e7b40dd19980c22dc5fe5cb5e93b7c7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Sep 25 18:04:13 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 18:04:13 2015 +0200

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

 xen/arch/arm/domain_build.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:25:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhScQ-0004OL-TL; Thu, 01 Oct 2015 01:25:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScP-0004O1-VT
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:10 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	93/F3-32615-57B8C065; Thu, 01 Oct 2015 01:25:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1443662707!33710241!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29744 invoked from network); 1 Oct 2015 01:25:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 01:25: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 1ZhScN-0001mB-HB
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScN-0003kj-FD
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:07 +0000
Date: Thu, 01 Oct 2015 01:25:07 +0000
Message-Id: <E1ZhScN-0003kj-FD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	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 94760fe10b8a3cf4835c950b9c66c43539ed3dbc
Merge: 26b300bd727ef00a8f60329212a83c3b027a48f7 d8e43d188e7b40dd19980c22dc5fe5cb5e93b7c7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Sep 25 18:04:13 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 18:04:13 2015 +0200

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

 xen/arch/arm/domain_build.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:25:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:25: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 1ZhScb-0004Pt-W6; Thu, 01 Oct 2015 01:25: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 1ZhSca-0004Ph-8u
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:20 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	A6/F4-12946-F7B8C065; Thu, 01 Oct 2015 01:25:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1443662718!12247116!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5667 invoked from network); 1 Oct 2015 01:25:18 -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;
	1 Oct 2015 01:25:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScX-0001mu-Qp
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScX-0003l6-O8
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:17 +0000
Date: Thu, 01 Oct 2015 01:25:17 +0000
Message-Id: <E1ZhScX-0003l6-O8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remove unused macros from sched.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa2e4d38164453f7d000cc30d6cc47ffa1d77539
Author:     Juergen Gross <jgross@ssue.com>
AuthorDate: Fri Sep 25 18:04:46 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 18:04:46 2015 +0200

    remove unused macros from sched.h
    
    The macros num_cpupool_cpus() and domain_is_locked() aren't used by
    anyone. Remove them.
    
    Signed-off-by: Juergen Gross <jgross@ssue.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/xen/sched.h |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 8053b5a..68819f8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -260,7 +260,6 @@ struct vcpu
 /* Per-domain lock can be recursively acquired in fault handlers. */
 #define domain_lock(d) spin_lock_recursive(&(d)->domain_lock)
 #define domain_unlock(d) spin_unlock_recursive(&(d)->domain_lock)
-#define domain_is_locked(d) spin_is_locked(&(d)->domain_lock)
 
 /* VM event */
 struct vm_event_domain
@@ -894,8 +893,6 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op);
 void schedule_dump(struct cpupool *c);
 extern void dump_runq(unsigned char key);
 
-#define num_cpupool_cpus(c) cpumask_weight((c)->cpu_valid)
-
 void arch_do_physinfo(xen_sysctl_physinfo_t *pi);
 
 #endif /* __SCHED_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 01:25:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 01:25: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 1ZhScb-0004Pt-W6; Thu, 01 Oct 2015 01:25: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 1ZhSca-0004Ph-8u
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:20 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	A6/F4-12946-F7B8C065; Thu, 01 Oct 2015 01:25:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1443662718!12247116!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5667 invoked from network); 1 Oct 2015 01:25:18 -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;
	1 Oct 2015 01:25:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScX-0001mu-Qp
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhScX-0003l6-O8
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 01:25:17 +0000
Date: Thu, 01 Oct 2015 01:25:17 +0000
Message-Id: <E1ZhScX-0003l6-O8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remove unused macros from sched.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa2e4d38164453f7d000cc30d6cc47ffa1d77539
Author:     Juergen Gross <jgross@ssue.com>
AuthorDate: Fri Sep 25 18:04:46 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Sep 25 18:04:46 2015 +0200

    remove unused macros from sched.h
    
    The macros num_cpupool_cpus() and domain_is_locked() aren't used by
    anyone. Remove them.
    
    Signed-off-by: Juergen Gross <jgross@ssue.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/xen/sched.h |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 8053b5a..68819f8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -260,7 +260,6 @@ struct vcpu
 /* Per-domain lock can be recursively acquired in fault handlers. */
 #define domain_lock(d) spin_lock_recursive(&(d)->domain_lock)
 #define domain_unlock(d) spin_unlock_recursive(&(d)->domain_lock)
-#define domain_is_locked(d) spin_is_locked(&(d)->domain_lock)
 
 /* VM event */
 struct vm_event_domain
@@ -894,8 +893,6 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op);
 void schedule_dump(struct cpupool *c);
 extern void dump_runq(unsigned char key);
 
-#define num_cpupool_cpus(c) cpumask_weight((c)->cpu_valid)
-
 void arch_do_physinfo(xen_sysctl_physinfo_t *pi);
 
 #endif /* __SCHED_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:22: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 1ZhiUc-0004fv-CK; Thu, 01 Oct 2015 18:22: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 1ZhiUb-0004fp-5e
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:09 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	FF/9B-01421-0D97D065; Thu, 01 Oct 2015 18:22:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1443723724!12579514!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 4188 invoked from network); 1 Oct 2015 18:22:05 -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;
	1 Oct 2015 18:22:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUW-0006Mg-Ek
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUW-0002x8-3g
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:04 +0000
Date: Thu, 01 Oct 2015 18:22:04 +0000
Message-Id: <E1ZhiUW-0002x8-3g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/bigmem: eliminate struct
	domain address width restriction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit afa96a28fbdfdcc00ee870ede5f462552cd92752
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 28 17:36:51 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:36:51 2015 +0200

    x86/bigmem: eliminate struct domain address width restriction
    
    PDX-es are 64 bits wide in that case, and hence no limit needs to be
    enforced.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: fb34ff7452fda9966915cba8cf3ed42d4ca738fc
    master date: 2015-09-25 09:02:02 +0200
---
 xen/arch/x86/domain.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 045f6ff..a877bab 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -204,6 +204,7 @@ smap_check_policy_t smap_policy_change(struct vcpu *v,
     return old_policy;
 }
 
+#ifndef CONFIG_BIGMEM
 /*
  * The hole may be at or above the 44-bit boundary, so we need to determine
  * the total bit count until reaching 32 significant (not squashed out) bits
@@ -225,10 +226,14 @@ static unsigned int __init noinline _domain_struct_bits(void)
 
     return bits;
 }
+#endif
 
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
+#ifdef CONFIG_BIGMEM
+    const unsigned int bits = 0;
+#else
     /*
      * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
@@ -237,6 +242,7 @@ struct domain *alloc_domain_struct(void)
 
     if ( unlikely(!bits) )
          bits = _domain_struct_bits();
+#endif
 
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
     d = alloc_xenheap_pages(0, MEMF_bits(bits));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:22: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 1ZhiUc-0004fv-CK; Thu, 01 Oct 2015 18:22: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 1ZhiUb-0004fp-5e
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:09 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	FF/9B-01421-0D97D065; Thu, 01 Oct 2015 18:22:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1443723724!12579514!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 4188 invoked from network); 1 Oct 2015 18:22:05 -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;
	1 Oct 2015 18:22:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUW-0006Mg-Ek
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUW-0002x8-3g
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:04 +0000
Date: Thu, 01 Oct 2015 18:22:04 +0000
Message-Id: <E1ZhiUW-0002x8-3g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/bigmem: eliminate struct
	domain address width restriction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit afa96a28fbdfdcc00ee870ede5f462552cd92752
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 28 17:36:51 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:36:51 2015 +0200

    x86/bigmem: eliminate struct domain address width restriction
    
    PDX-es are 64 bits wide in that case, and hence no limit needs to be
    enforced.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: fb34ff7452fda9966915cba8cf3ed42d4ca738fc
    master date: 2015-09-25 09:02:02 +0200
---
 xen/arch/x86/domain.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 045f6ff..a877bab 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -204,6 +204,7 @@ smap_check_policy_t smap_policy_change(struct vcpu *v,
     return old_policy;
 }
 
+#ifndef CONFIG_BIGMEM
 /*
  * The hole may be at or above the 44-bit boundary, so we need to determine
  * the total bit count until reaching 32 significant (not squashed out) bits
@@ -225,10 +226,14 @@ static unsigned int __init noinline _domain_struct_bits(void)
 
     return bits;
 }
+#endif
 
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
+#ifdef CONFIG_BIGMEM
+    const unsigned int bits = 0;
+#else
     /*
      * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
@@ -237,6 +242,7 @@ struct domain *alloc_domain_struct(void)
 
     if ( unlikely(!bits) )
          bits = _domain_struct_bits();
+#endif
 
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
     d = alloc_xenheap_pages(0, MEMF_bits(bits));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhiUl-0004gg-En; Thu, 01 Oct 2015 18:22:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUk-0004gV-DX
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:18 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	4A/F6-10422-9D97D065; Thu, 01 Oct 2015 18:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1443723735!39260041!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 31549 invoked from network); 1 Oct 2015 18:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUg-0006Mk-Pl
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUg-0002xU-M4
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:14 +0000
Date: Thu, 01 Oct 2015 18:22:14 +0000
Message-Id: <E1ZhiUg-0002xU-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] add missing license and copyright
	statements to public interface headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04f61260deee93fb32b0a22fafbfd11ddfe9d628
Author:     Mike Belopuhov <mike.belopuhov@esdenera.com>
AuthorDate: Mon Sep 28 17:37:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:37:37 2015 +0200

    add missing license and copyright statements to public interface headers
    
    The copyright line indicates a person, a group of people and/or a company
    granting rights stated in the license text and is a required part of the
    license.
    
    The year of the copyright is chosen to be the same as when the license has
    been applied to the file or when the file has been created in case there
    was no license.  It is possible to update or add additional years if major
    changes have been done to the the file, but is generally not a requirement.
    
    Signed-off-by: Mike Belopuhov <mike.belopuhov@esdenera.com>
    master commit: 8d6ff9ef259e296e6aee32ad8840cc5081280e0d
    master date: 2015-09-25 09:04:24 +0200
---
 xen/include/public/arch-x86/pmu.h       |   22 ++++++++++++++++++++++
 xen/include/public/hvm/e820.h           |    3 ++-
 xen/include/public/hvm/hvm_info_table.h |    2 ++
 xen/include/public/hvm/hvm_op.h         |    2 ++
 xen/include/public/hvm/hvm_xs_strings.h |    2 ++
 xen/include/public/hvm/params.h         |    2 ++
 xen/include/public/io/protocols.h       |    2 ++
 xen/include/public/physdev.h            |    2 ++
 xen/include/public/pmu.h                |   22 ++++++++++++++++++++++
 9 files changed, 58 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-x86/pmu.h b/xen/include/public/arch-x86/pmu.h
index 1a53888..68ebf12 100644
--- a/xen/include/public/arch-x86/pmu.h
+++ b/xen/include/public/arch-x86/pmu.h
@@ -1,3 +1,25 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
 #ifndef __XEN_PUBLIC_ARCH_X86_PMU_H__
 #define __XEN_PUBLIC_ARCH_X86_PMU_H__
 
diff --git a/xen/include/public/hvm/e820.h b/xen/include/public/hvm/e820.h
index 5bdc227..6c58a37 100644
--- a/xen/include/public/hvm/e820.h
+++ b/xen/include/public/hvm/e820.h
@@ -1,4 +1,3 @@
-
 /*
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -17,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_E820_H__
diff --git a/xen/include/public/hvm/hvm_info_table.h b/xen/include/public/hvm/hvm_info_table.h
index 36085fa..9e3f807 100644
--- a/xen/include/public/hvm/hvm_info_table.h
+++ b/xen/include/public/hvm/hvm_info_table.h
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index 014546a..1606185 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
diff --git a/xen/include/public/hvm/hvm_xs_strings.h b/xen/include/public/hvm/hvm_xs_strings.h
index 8aec935..146b0b0 100644
--- a/xen/include/public/hvm/hvm_xs_strings.h
+++ b/xen/include/public/hvm/hvm_xs_strings.h
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2013, Citrix Systems
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_XS_STRINGS_H__
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 147d9b8..356dfd3 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_PARAMS_H__
diff --git a/xen/include/public/io/protocols.h b/xen/include/public/io/protocols.h
index 80b196b..40a9b30 100644
--- a/xen/include/public/io/protocols.h
+++ b/xen/include/public/io/protocols.h
@@ -18,6 +18,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2008, Keir Fraser
  */
 
 #ifndef __XEN_PROTOCOLS_H__
diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
index c9be6de..0e54635 100644
--- a/xen/include/public/physdev.h
+++ b/xen/include/public/physdev.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_PHYSDEV_H__
diff --git a/xen/include/public/pmu.h b/xen/include/public/pmu.h
index 1149678..7753df0 100644
--- a/xen/include/public/pmu.h
+++ b/xen/include/public/pmu.h
@@ -1,3 +1,25 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
 #ifndef __XEN_PUBLIC_PMU_H__
 #define __XEN_PUBLIC_PMU_H__
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhiUl-0004gg-En; Thu, 01 Oct 2015 18:22:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUk-0004gV-DX
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:18 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	4A/F6-10422-9D97D065; Thu, 01 Oct 2015 18:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1443723735!39260041!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 31549 invoked from network); 1 Oct 2015 18:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUg-0006Mk-Pl
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUg-0002xU-M4
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:14 +0000
Date: Thu, 01 Oct 2015 18:22:14 +0000
Message-Id: <E1ZhiUg-0002xU-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] add missing license and copyright
	statements to public interface headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04f61260deee93fb32b0a22fafbfd11ddfe9d628
Author:     Mike Belopuhov <mike.belopuhov@esdenera.com>
AuthorDate: Mon Sep 28 17:37:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:37:37 2015 +0200

    add missing license and copyright statements to public interface headers
    
    The copyright line indicates a person, a group of people and/or a company
    granting rights stated in the license text and is a required part of the
    license.
    
    The year of the copyright is chosen to be the same as when the license has
    been applied to the file or when the file has been created in case there
    was no license.  It is possible to update or add additional years if major
    changes have been done to the the file, but is generally not a requirement.
    
    Signed-off-by: Mike Belopuhov <mike.belopuhov@esdenera.com>
    master commit: 8d6ff9ef259e296e6aee32ad8840cc5081280e0d
    master date: 2015-09-25 09:04:24 +0200
---
 xen/include/public/arch-x86/pmu.h       |   22 ++++++++++++++++++++++
 xen/include/public/hvm/e820.h           |    3 ++-
 xen/include/public/hvm/hvm_info_table.h |    2 ++
 xen/include/public/hvm/hvm_op.h         |    2 ++
 xen/include/public/hvm/hvm_xs_strings.h |    2 ++
 xen/include/public/hvm/params.h         |    2 ++
 xen/include/public/io/protocols.h       |    2 ++
 xen/include/public/physdev.h            |    2 ++
 xen/include/public/pmu.h                |   22 ++++++++++++++++++++++
 9 files changed, 58 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-x86/pmu.h b/xen/include/public/arch-x86/pmu.h
index 1a53888..68ebf12 100644
--- a/xen/include/public/arch-x86/pmu.h
+++ b/xen/include/public/arch-x86/pmu.h
@@ -1,3 +1,25 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
 #ifndef __XEN_PUBLIC_ARCH_X86_PMU_H__
 #define __XEN_PUBLIC_ARCH_X86_PMU_H__
 
diff --git a/xen/include/public/hvm/e820.h b/xen/include/public/hvm/e820.h
index 5bdc227..6c58a37 100644
--- a/xen/include/public/hvm/e820.h
+++ b/xen/include/public/hvm/e820.h
@@ -1,4 +1,3 @@
-
 /*
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -17,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_E820_H__
diff --git a/xen/include/public/hvm/hvm_info_table.h b/xen/include/public/hvm/hvm_info_table.h
index 36085fa..9e3f807 100644
--- a/xen/include/public/hvm/hvm_info_table.h
+++ b/xen/include/public/hvm/hvm_info_table.h
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index 014546a..1606185 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
diff --git a/xen/include/public/hvm/hvm_xs_strings.h b/xen/include/public/hvm/hvm_xs_strings.h
index 8aec935..146b0b0 100644
--- a/xen/include/public/hvm/hvm_xs_strings.h
+++ b/xen/include/public/hvm/hvm_xs_strings.h
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2013, Citrix Systems
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_XS_STRINGS_H__
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 147d9b8..356dfd3 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_PARAMS_H__
diff --git a/xen/include/public/io/protocols.h b/xen/include/public/io/protocols.h
index 80b196b..40a9b30 100644
--- a/xen/include/public/io/protocols.h
+++ b/xen/include/public/io/protocols.h
@@ -18,6 +18,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2008, Keir Fraser
  */
 
 #ifndef __XEN_PROTOCOLS_H__
diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
index c9be6de..0e54635 100644
--- a/xen/include/public/physdev.h
+++ b/xen/include/public/physdev.h
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_PHYSDEV_H__
diff --git a/xen/include/public/pmu.h b/xen/include/public/pmu.h
index 1149678..7753df0 100644
--- a/xen/include/public/pmu.h
+++ b/xen/include/public/pmu.h
@@ -1,3 +1,25 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
 #ifndef __XEN_PUBLIC_PMU_H__
 #define __XEN_PUBLIC_PMU_H__
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhiUv-0004iD-HJ; Thu, 01 Oct 2015 18:22: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 1ZhiUt-0004hl-UF
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:28 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	51/99-01748-3E97D065; Thu, 01 Oct 2015 18:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1443723745!47065652!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18178 invoked from network); 1 Oct 2015 18:22:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUr-0006Mw-CL
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUr-0002yy-0i
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:25 +0000
Date: Thu, 01 Oct 2015 18:22:25 +0000
Message-Id: <E1ZhiUr-0002yy-0i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] vt-d: fix IM bit mask and unmask
	of Fault Event Control Register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6307ebcbd7d3c2db3adb087d1d614b97cb5e64cc
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Mon Sep 28 17:38:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:38:09 2015 +0200

    vt-d: fix IM bit mask and unmask of Fault Event Control Register
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    
    vt-d: fix IM bit unmask of Fault Event Control Register in init_vtd_hw()
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    master commit: 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9
    master date: 2015-09-25 09:08:22 +0200
    master commit: 26b300bd727ef00a8f60329212a83c3b027a48f7
    master date: 2015-09-25 18:03:04 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b67b624..dd13865 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -991,10 +991,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
     unsigned long flags;
+    u32 sts;
 
     /* unmask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts &= ~DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.host_masked = 0;
 }
@@ -1003,10 +1006,13 @@ static void dma_msi_mask(struct irq_desc *desc)
 {
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
+    u32 sts;
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts |= DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.host_masked = 1;
 }
@@ -2006,6 +2012,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2019,7 +2026,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhiUv-0004iD-HJ; Thu, 01 Oct 2015 18:22: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 1ZhiUt-0004hl-UF
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:28 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	51/99-01748-3E97D065; Thu, 01 Oct 2015 18:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1443723745!47065652!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18178 invoked from network); 1 Oct 2015 18:22:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUr-0006Mw-CL
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiUr-0002yy-0i
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:25 +0000
Date: Thu, 01 Oct 2015 18:22:25 +0000
Message-Id: <E1ZhiUr-0002yy-0i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] vt-d: fix IM bit mask and unmask
	of Fault Event Control Register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6307ebcbd7d3c2db3adb087d1d614b97cb5e64cc
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Mon Sep 28 17:38:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:38:09 2015 +0200

    vt-d: fix IM bit mask and unmask of Fault Event Control Register
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    
    vt-d: fix IM bit unmask of Fault Event Control Register in init_vtd_hw()
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    master commit: 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9
    master date: 2015-09-25 09:08:22 +0200
    master commit: 26b300bd727ef00a8f60329212a83c3b027a48f7
    master date: 2015-09-25 18:03:04 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b67b624..dd13865 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -991,10 +991,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
     unsigned long flags;
+    u32 sts;
 
     /* unmask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts &= ~DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.host_masked = 0;
 }
@@ -1003,10 +1006,13 @@ static void dma_msi_mask(struct irq_desc *desc)
 {
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
+    u32 sts;
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts |= DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.host_masked = 1;
 }
@@ -2006,6 +2012,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2019,7 +2026,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18: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 1ZhiV5-0004ji-Jo; Thu, 01 Oct 2015 18: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 1ZhiV4-0004jR-2P
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:38 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	8D/94-30270-DE97D065; Thu, 01 Oct 2015 18:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1443723755!39245253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27233 invoked from network); 1 Oct 2015 18:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22:36 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiV1-0006N4-LG
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiV1-0002zL-IR
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:35 +0000
Date: Thu, 01 Oct 2015 18:22:35 +0000
Message-Id: <E1ZhiV1-0002zL-IR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxc: arm: Check the index
	before accessing the bank
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae9bedcb9b23642896aa362e990fb740cd17d9cc
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Sep 17 18:36:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Sep 28 16:40:29 2015 +0100

    tools/libxc: arm: Check the index before accessing the bank
    
    When creating a guest with more than 3GB of memory, the 2 banks will be
    used and the loop with overrunning. The code will fail later on because
    Xen will deny to populate the region:
    
    domainbuilder: detail: xc_dom_devicetree_mem: called
    domainbuilder: detail: xc_dom_mem_init: mem 3096 MB, pages 0xc1800 pages, 4k each
    domainbuilder: detail: xc_dom_mem_init: 0xc1800 pages
    domainbuilder: detail: xc_dom_boot_mem_init: called
    domainbuilder: detail: set_mode: guest xen-3.0-aarch64, address size 64
    domainbuilder: detail: xc_dom_malloc            : 14384 kB
    domainbuilder: detail: populate_guest_memory: populating RAM @0000000040000000-0000000100000000 (3072MB)
    domainbuilder: detail: populate_one_size: populated 0x3/0x3 entries with shift 18
    domainbuilder: detail: populate_guest_memory: populating RAM @0000000200000000-0000000201800000 (24MB)
    domainbuilder: detail: populate_one_size: populated 0xc/0xc entries with shift 9
    domainbuilder: detail: populate_guest_memory: populating RAM @0000007fad41c000-0007fb39dd42c000 (2141954816MB)
    domainbuilder: detail: populate_one_size: populated 0x100/0x1e4 entries with shift 0
    domainbuilder: detail: populate_guest_memory: Not enough RAM
    
    This is because we are currently accessing the bank before checking the
    validity of the index. AFAICT, on  Debian Jessie, the compiler (gcc 4.9.2) is
    assuming that it's not necessary to verify the index because it's used
    before. This is a valid assumption because the operand of && are
    execute from from left to right.
    
    Re-order the checks to verify the validity of the index before accessing
    the bank.
    
    The problem has been present since the introduction of the multi-bank
    feature in commit 45d9867837f099e9eed4189dac5ed39d1fe2ed49 " tools: arm:
    prepare domain builder for multiple banks of guest RAM".
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit ed5c2c05cfa557b2391aef9557864d8d958d8d84)
---
 tools/libxc/xc_dom_arm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index b00d667..aeaba54 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -460,7 +460,7 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         dom->p2m_host[pfn] = INVALID_P2M_ENTRY;
 
     /* setup initial p2m and allocate guest memory */
-    for ( i = 0; dom->rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
+    for ( i = 0; i < GUEST_RAM_BANKS && dom->rambank_size[i]; i++ )
     {
         if ((rc = populate_guest_memory(dom,
                                         bankbase[i] >> XC_PAGE_SHIFT,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18: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 1ZhiV5-0004ji-Jo; Thu, 01 Oct 2015 18: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 1ZhiV4-0004jR-2P
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:38 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	8D/94-30270-DE97D065; Thu, 01 Oct 2015 18:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1443723755!39245253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27233 invoked from network); 1 Oct 2015 18:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22:36 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiV1-0006N4-LG
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiV1-0002zL-IR
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:35 +0000
Date: Thu, 01 Oct 2015 18:22:35 +0000
Message-Id: <E1ZhiV1-0002zL-IR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxc: arm: Check the index
	before accessing the bank
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae9bedcb9b23642896aa362e990fb740cd17d9cc
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Sep 17 18:36:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Sep 28 16:40:29 2015 +0100

    tools/libxc: arm: Check the index before accessing the bank
    
    When creating a guest with more than 3GB of memory, the 2 banks will be
    used and the loop with overrunning. The code will fail later on because
    Xen will deny to populate the region:
    
    domainbuilder: detail: xc_dom_devicetree_mem: called
    domainbuilder: detail: xc_dom_mem_init: mem 3096 MB, pages 0xc1800 pages, 4k each
    domainbuilder: detail: xc_dom_mem_init: 0xc1800 pages
    domainbuilder: detail: xc_dom_boot_mem_init: called
    domainbuilder: detail: set_mode: guest xen-3.0-aarch64, address size 64
    domainbuilder: detail: xc_dom_malloc            : 14384 kB
    domainbuilder: detail: populate_guest_memory: populating RAM @0000000040000000-0000000100000000 (3072MB)
    domainbuilder: detail: populate_one_size: populated 0x3/0x3 entries with shift 18
    domainbuilder: detail: populate_guest_memory: populating RAM @0000000200000000-0000000201800000 (24MB)
    domainbuilder: detail: populate_one_size: populated 0xc/0xc entries with shift 9
    domainbuilder: detail: populate_guest_memory: populating RAM @0000007fad41c000-0007fb39dd42c000 (2141954816MB)
    domainbuilder: detail: populate_one_size: populated 0x100/0x1e4 entries with shift 0
    domainbuilder: detail: populate_guest_memory: Not enough RAM
    
    This is because we are currently accessing the bank before checking the
    validity of the index. AFAICT, on  Debian Jessie, the compiler (gcc 4.9.2) is
    assuming that it's not necessary to verify the index because it's used
    before. This is a valid assumption because the operand of && are
    execute from from left to right.
    
    Re-order the checks to verify the validity of the index before accessing
    the bank.
    
    The problem has been present since the introduction of the multi-bank
    feature in commit 45d9867837f099e9eed4189dac5ed39d1fe2ed49 " tools: arm:
    prepare domain builder for multiple banks of guest RAM".
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit ed5c2c05cfa557b2391aef9557864d8d958d8d84)
---
 tools/libxc/xc_dom_arm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index b00d667..aeaba54 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -460,7 +460,7 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         dom->p2m_host[pfn] = INVALID_P2M_ENTRY;
 
     /* setup initial p2m and allocate guest memory */
-    for ( i = 0; dom->rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
+    for ( i = 0; i < GUEST_RAM_BANKS && dom->rambank_size[i]; i++ )
     {
         if ((rc = populate_guest_memory(dom,
                                         bankbase[i] >> XC_PAGE_SHIFT,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhiVG-0004lS-MG; Thu, 01 Oct 2015 18:22: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 1ZhiVE-0004l3-No
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:48 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	8C/46-28221-8F97D065; Thu, 01 Oct 2015 18:22:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1443723766!22524803!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7973 invoked from network); 1 Oct 2015 18:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22: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 1ZhiVB-0006NC-Uo
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVB-0002zk-Sr
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:45 +0000
Date: Thu, 01 Oct 2015 18:22:45 +0000
Message-Id: <E1ZhiVB-0002zk-Sr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxl: introduce
	libxl_get_online_socketmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8452c3ea98bfd4a445361cc9c3e1ae5a3dbd793a
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:50 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:52 2015 +0100

    tools/libxl: introduce libxl_get_online_socketmap
    
    It sets the bit on the given bitmap if the corresponding socket is
    available and clears the bit when the corresponding socket is not
    available.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit d0596394462484a277330b2e43f0b46efb815452)
---
 tools/libxl/libxl.h       |    7 ++++---
 tools/libxl/libxl_utils.c |   22 ++++++++++++++++++++++
 tools/libxl/libxl_utils.h |    2 ++
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 5f9047c..fa5aedd 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -807,11 +807,12 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
 #define LIBXL_HAVE_PCITOPOLOGY 1
 
 /*
- * LIBXL_HAVE_SOCKET_BITMAP_ALLOC
+ * LIBXL_HAVE_SOCKET_BITMAP
  *
- * If this is defined, then libxl_socket_bitmap_alloc exists.
+ * If this is defined, then libxl_socket_bitmap_alloc and
+ * libxl_get_online_socketmap exist.
  */
-#define LIBXL_HAVE_SOCKET_BITMAP_ALLOC 1
+#define LIBXL_HAVE_SOCKET_BITMAP 1
 
 /*
  * LIBXL_HAVE_SRM_V2
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index bfc9699..408ec85 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -886,6 +886,28 @@ int libxl_socket_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *socketmap,
 
 }
 
+int libxl_get_online_socketmap(libxl_ctx *ctx, libxl_bitmap *socketmap)
+{
+    libxl_cputopology *tinfo = NULL;
+    int nr_cpus = 0, i, rc = 0;
+
+    tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
+    if (tinfo == NULL) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    libxl_bitmap_set_none(socketmap);
+    for (i = 0; i < nr_cpus; i++)
+        if (tinfo[i].socket != XEN_INVALID_SOCKET_ID
+            && !libxl_bitmap_test(socketmap, tinfo[i].socket))
+            libxl_bitmap_set(socketmap, tinfo[i].socket);
+
+ out:
+    libxl_cputopology_list_free(tinfo, nr_cpus);
+    return rc;
+}
+
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             const libxl_bitmap *nodemap,
                             libxl_bitmap *cpumap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 1e5ca8a..339ebdf 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -143,6 +143,8 @@ int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
                             int max_nodes);
 int libxl_socket_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *socketmap,
                               int max_sockets);
+/* Fill socketmap with the CPU topology information on the system. */
+int libxl_get_online_socketmap(libxl_ctx *ctx, libxl_bitmap *socketmap);
 
 /* Populate cpumap with the cpus spanned by the nodes in nodemap */
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:22:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhiVG-0004lS-MG; Thu, 01 Oct 2015 18:22: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 1ZhiVE-0004l3-No
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:48 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	8C/46-28221-8F97D065; Thu, 01 Oct 2015 18:22:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1443723766!22524803!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7973 invoked from network); 1 Oct 2015 18:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22: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 1ZhiVB-0006NC-Uo
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVB-0002zk-Sr
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:45 +0000
Date: Thu, 01 Oct 2015 18:22:45 +0000
Message-Id: <E1ZhiVB-0002zk-Sr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxl: introduce
	libxl_get_online_socketmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8452c3ea98bfd4a445361cc9c3e1ae5a3dbd793a
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:50 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:52 2015 +0100

    tools/libxl: introduce libxl_get_online_socketmap
    
    It sets the bit on the given bitmap if the corresponding socket is
    available and clears the bit when the corresponding socket is not
    available.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit d0596394462484a277330b2e43f0b46efb815452)
---
 tools/libxl/libxl.h       |    7 ++++---
 tools/libxl/libxl_utils.c |   22 ++++++++++++++++++++++
 tools/libxl/libxl_utils.h |    2 ++
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 5f9047c..fa5aedd 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -807,11 +807,12 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
 #define LIBXL_HAVE_PCITOPOLOGY 1
 
 /*
- * LIBXL_HAVE_SOCKET_BITMAP_ALLOC
+ * LIBXL_HAVE_SOCKET_BITMAP
  *
- * If this is defined, then libxl_socket_bitmap_alloc exists.
+ * If this is defined, then libxl_socket_bitmap_alloc and
+ * libxl_get_online_socketmap exist.
  */
-#define LIBXL_HAVE_SOCKET_BITMAP_ALLOC 1
+#define LIBXL_HAVE_SOCKET_BITMAP 1
 
 /*
  * LIBXL_HAVE_SRM_V2
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index bfc9699..408ec85 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -886,6 +886,28 @@ int libxl_socket_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *socketmap,
 
 }
 
+int libxl_get_online_socketmap(libxl_ctx *ctx, libxl_bitmap *socketmap)
+{
+    libxl_cputopology *tinfo = NULL;
+    int nr_cpus = 0, i, rc = 0;
+
+    tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
+    if (tinfo == NULL) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    libxl_bitmap_set_none(socketmap);
+    for (i = 0; i < nr_cpus; i++)
+        if (tinfo[i].socket != XEN_INVALID_SOCKET_ID
+            && !libxl_bitmap_test(socketmap, tinfo[i].socket))
+            libxl_bitmap_set(socketmap, tinfo[i].socket);
+
+ out:
+    libxl_cputopology_list_free(tinfo, nr_cpus);
+    return rc;
+}
+
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             const libxl_bitmap *nodemap,
                             libxl_bitmap *cpumap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 1e5ca8a..339ebdf 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -143,6 +143,8 @@ int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
                             int max_nodes);
 int libxl_socket_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *socketmap,
                               int max_sockets);
+/* Fill socketmap with the CPU topology information on the system. */
+int libxl_get_online_socketmap(libxl_ctx *ctx, libxl_bitmap *socketmap);
 
 /* Populate cpumap with the cpus spanned by the nodes in nodemap */
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiVR-0004n9-R1; Thu, 01 Oct 2015 18:23: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 1ZhiVP-0004mr-Td
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:00 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	AC/DF-12889-30A7D065; Thu, 01 Oct 2015 18:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1443723776!48768422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 742 invoked from network); 1 Oct 2015 18:22:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22: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 1ZhiVM-0006NK-9L
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVM-000307-7N
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:56 +0000
Date: Thu, 01 Oct 2015 18:22:56 +0000
Message-Id: <E1ZhiVM-000307-7N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxl: fix socket display
	error for CMT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e56cca18f33ad58bdafb0a5dcede4bf9953a786e
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:51 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:52 2015 +0100

    tools/libxl: fix socket display error for CMT
    
    When displaying the CMT information for all the sockets, we assume socket
    number is continuous. This is not true in the hotplug case. For instance,
    when the 3rd socket is plugged out on a 4-socket system, the available
    sockets numbers are 1,2,4 but current we will display the CMT
    information for socket 1,2,3.
    
    The fix is getting the socket bitmap for all the sockets on the system
    first and then displaying CMT information for_each_set_bit in that bitmap.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    (cherry picked from commit a4943f6bdd2bcef9e20020a74e41aaeb77e42905)
---
 tools/libxl/xl_cmdimpl.c |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 7dbf37f..c61d2dc 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8183,7 +8183,7 @@ static int psr_cmt_get_mem_bandwidth(uint32_t domid,
 
 static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
                                       libxl_psr_cmt_type type,
-                                      uint32_t nr_sockets)
+                                      libxl_bitmap *socketmap)
 {
     char *domain_name;
     uint32_t socketid;
@@ -8196,7 +8196,7 @@ static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
     printf("%-40s %5d", domain_name, dominfo->domid);
     free(domain_name);
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
+    libxl_for_each_set_bit(socketid, *socketmap) {
         switch (type) {
         case LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY:
             if (!libxl_psr_cmt_get_sample(ctx, dominfo->domid, type, socketid,
@@ -8219,9 +8219,9 @@ static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
 
 static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
 {
-    uint32_t i, socketid, nr_sockets, total_rmid;
+    uint32_t i, socketid, total_rmid;
     uint32_t l3_cache_size;
-    libxl_physinfo info;
+    libxl_bitmap socketmap;
     int rc, nr_domains;
 
     if (!libxl_psr_cmt_enabled(ctx)) {
@@ -8235,41 +8235,39 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         return -1;
     }
 
-    libxl_physinfo_init(&info);
-    rc = libxl_get_physinfo(ctx, &info);
+    libxl_bitmap_init(&socketmap);
+    libxl_socket_bitmap_alloc(ctx, &socketmap, 0);
+    rc = libxl_get_online_socketmap(ctx, &socketmap);
     if (rc < 0) {
-        fprintf(stderr, "Failed getting physinfo, rc: %d\n", rc);
-        libxl_physinfo_dispose(&info);
-        return -1;
+        fprintf(stderr, "Failed getting available sockets, rc: %d\n", rc);
+        goto out;
     }
-    nr_sockets = info.nr_cpus / info.threads_per_core / info.cores_per_socket;
-    libxl_physinfo_dispose(&info);
 
     rc = libxl_psr_cmt_get_total_rmid(ctx, &total_rmid);
     if (rc < 0) {
         fprintf(stderr, "Failed to get max RMID value\n");
-        return -1;
+        goto out;
     }
 
     printf("Total RMID: %d\n", total_rmid);
 
     /* Header */
     printf("%-40s %5s", "Name", "ID");
-    for (socketid = 0; socketid < nr_sockets; socketid++)
+    libxl_for_each_set_bit(socketid, socketmap)
         printf("%14s %d", "Socket", socketid);
     printf("\n");
 
     if (type == LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY) {
             /* Total L3 cache size */
             printf("%-46s", "Total L3 Cache Size");
-            for (socketid = 0; socketid < nr_sockets; socketid++) {
+            libxl_for_each_set_bit(socketid, socketmap) {
                 rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid,
                                                      &l3_cache_size);
                 if (rc < 0) {
                     fprintf(stderr,
                             "Failed to get system l3 cache size for socket:%d\n",
                             socketid);
-                    return -1;
+                    goto out;
                 }
                 printf("%13u KB", l3_cache_size);
             }
@@ -8283,9 +8281,10 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         libxl_dominfo_init(&dominfo);
         if (libxl_domain_info(ctx, &dominfo, domid)) {
             fprintf(stderr, "Failed to get domain info for %d\n", domid);
-            return -1;
+            rc = -1;
+            goto out;
         }
-        psr_cmt_print_domain_info(&dominfo, type, nr_sockets);
+        psr_cmt_print_domain_info(&dominfo, type, &socketmap);
         libxl_dominfo_dispose(&dominfo);
     }
     else
@@ -8293,13 +8292,17 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         libxl_dominfo *list;
         if (!(list = libxl_list_domain(ctx, &nr_domains))) {
             fprintf(stderr, "Failed to get domain info for domain list.\n");
-            return -1;
+            rc = -1;
+            goto out;
         }
         for (i = 0; i < nr_domains; i++)
-            psr_cmt_print_domain_info(list + i, type, nr_sockets);
+            psr_cmt_print_domain_info(list + i, type, &socketmap);
         libxl_dominfo_list_free(list, nr_domains);
     }
-    return 0;
+
+out:
+    libxl_bitmap_dispose(&socketmap);
+    return rc;
 }
 
 int main_psr_cmt_attach(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiVR-0004n9-R1; Thu, 01 Oct 2015 18:23: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 1ZhiVP-0004mr-Td
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:00 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	AC/DF-12889-30A7D065; Thu, 01 Oct 2015 18:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1443723776!48768422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 742 invoked from network); 1 Oct 2015 18:22:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2015 18:22: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 1ZhiVM-0006NK-9L
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVM-000307-7N
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:22:56 +0000
Date: Thu, 01 Oct 2015 18:22:56 +0000
Message-Id: <E1ZhiVM-000307-7N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxl: fix socket display
	error for CMT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e56cca18f33ad58bdafb0a5dcede4bf9953a786e
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:51 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:52 2015 +0100

    tools/libxl: fix socket display error for CMT
    
    When displaying the CMT information for all the sockets, we assume socket
    number is continuous. This is not true in the hotplug case. For instance,
    when the 3rd socket is plugged out on a 4-socket system, the available
    sockets numbers are 1,2,4 but current we will display the CMT
    information for socket 1,2,3.
    
    The fix is getting the socket bitmap for all the sockets on the system
    first and then displaying CMT information for_each_set_bit in that bitmap.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    (cherry picked from commit a4943f6bdd2bcef9e20020a74e41aaeb77e42905)
---
 tools/libxl/xl_cmdimpl.c |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 7dbf37f..c61d2dc 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8183,7 +8183,7 @@ static int psr_cmt_get_mem_bandwidth(uint32_t domid,
 
 static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
                                       libxl_psr_cmt_type type,
-                                      uint32_t nr_sockets)
+                                      libxl_bitmap *socketmap)
 {
     char *domain_name;
     uint32_t socketid;
@@ -8196,7 +8196,7 @@ static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
     printf("%-40s %5d", domain_name, dominfo->domid);
     free(domain_name);
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
+    libxl_for_each_set_bit(socketid, *socketmap) {
         switch (type) {
         case LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY:
             if (!libxl_psr_cmt_get_sample(ctx, dominfo->domid, type, socketid,
@@ -8219,9 +8219,9 @@ static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
 
 static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
 {
-    uint32_t i, socketid, nr_sockets, total_rmid;
+    uint32_t i, socketid, total_rmid;
     uint32_t l3_cache_size;
-    libxl_physinfo info;
+    libxl_bitmap socketmap;
     int rc, nr_domains;
 
     if (!libxl_psr_cmt_enabled(ctx)) {
@@ -8235,41 +8235,39 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         return -1;
     }
 
-    libxl_physinfo_init(&info);
-    rc = libxl_get_physinfo(ctx, &info);
+    libxl_bitmap_init(&socketmap);
+    libxl_socket_bitmap_alloc(ctx, &socketmap, 0);
+    rc = libxl_get_online_socketmap(ctx, &socketmap);
     if (rc < 0) {
-        fprintf(stderr, "Failed getting physinfo, rc: %d\n", rc);
-        libxl_physinfo_dispose(&info);
-        return -1;
+        fprintf(stderr, "Failed getting available sockets, rc: %d\n", rc);
+        goto out;
     }
-    nr_sockets = info.nr_cpus / info.threads_per_core / info.cores_per_socket;
-    libxl_physinfo_dispose(&info);
 
     rc = libxl_psr_cmt_get_total_rmid(ctx, &total_rmid);
     if (rc < 0) {
         fprintf(stderr, "Failed to get max RMID value\n");
-        return -1;
+        goto out;
     }
 
     printf("Total RMID: %d\n", total_rmid);
 
     /* Header */
     printf("%-40s %5s", "Name", "ID");
-    for (socketid = 0; socketid < nr_sockets; socketid++)
+    libxl_for_each_set_bit(socketid, socketmap)
         printf("%14s %d", "Socket", socketid);
     printf("\n");
 
     if (type == LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY) {
             /* Total L3 cache size */
             printf("%-46s", "Total L3 Cache Size");
-            for (socketid = 0; socketid < nr_sockets; socketid++) {
+            libxl_for_each_set_bit(socketid, socketmap) {
                 rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid,
                                                      &l3_cache_size);
                 if (rc < 0) {
                     fprintf(stderr,
                             "Failed to get system l3 cache size for socket:%d\n",
                             socketid);
-                    return -1;
+                    goto out;
                 }
                 printf("%13u KB", l3_cache_size);
             }
@@ -8283,9 +8281,10 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         libxl_dominfo_init(&dominfo);
         if (libxl_domain_info(ctx, &dominfo, domid)) {
             fprintf(stderr, "Failed to get domain info for %d\n", domid);
-            return -1;
+            rc = -1;
+            goto out;
         }
-        psr_cmt_print_domain_info(&dominfo, type, nr_sockets);
+        psr_cmt_print_domain_info(&dominfo, type, &socketmap);
         libxl_dominfo_dispose(&dominfo);
     }
     else
@@ -8293,13 +8292,17 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         libxl_dominfo *list;
         if (!(list = libxl_list_domain(ctx, &nr_domains))) {
             fprintf(stderr, "Failed to get domain info for domain list.\n");
-            return -1;
+            rc = -1;
+            goto out;
         }
         for (i = 0; i < nr_domains; i++)
-            psr_cmt_print_domain_info(list + i, type, nr_sockets);
+            psr_cmt_print_domain_info(list + i, type, &socketmap);
         libxl_dominfo_list_free(list, nr_domains);
     }
-    return 0;
+
+out:
+    libxl_bitmap_dispose(&socketmap);
+    return rc;
 }
 
 int main_psr_cmt_attach(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhiVa-0004oM-Tg; Thu, 01 Oct 2015 18:23: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 1ZhiVZ-0004o9-KV
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:09 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	39/55-32641-C0A7D065; Thu, 01 Oct 2015 18:23:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1443723786!49347965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4178 invoked from network); 1 Oct 2015 18:23:07 -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;
	1 Oct 2015 18:23:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVW-0006Nv-P6
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVW-00030i-Kz
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:06 +0000
Date: Thu, 01 Oct 2015 18:23:06 +0000
Message-Id: <E1ZhiVW-00030i-Kz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxl: return socket id from
	libxl_psr_cat_get_l3_info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 029375fe5e08cff5fe2634878ae62ed4780a6fcf
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:52 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:53 2015 +0100

    tools/libxl: return socket id from libxl_psr_cat_get_l3_info
    
    The entries returned from libxl_psr_cat_get_l3_info are assumed
    to be socket-continuous. But this is not true in the hotplug case.
    
    This patch gets the socket bitmap for all the sockets on the system
    first and stores the socket id in the structure libxl_psr_cat_info in
    libxl_psr_cat_get_l3_info. The xl or similar consumers then can display
    socket information correctly.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 30e7a6fde8d4810a230324b89125b4bdc8e5374d)
---
 tools/libxl/libxl_psr.c     |   23 ++++++++++++++++++-----
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |   41 ++++++++++++++++++++---------------------
 3 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 3378239..30740a1 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,30 +339,43 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i, nr_sockets;
+    int i = 0, socket, nr_sockets;
+    libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
+    libxl_bitmap_init(&socketmap);
+
     rc = libxl__count_physical_sockets(gc, &nr_sockets);
     if (rc) {
         LOGE(ERROR, "failed to get system socket count");
         goto out;
     }
 
+    libxl_socket_bitmap_alloc(ctx, &socketmap, nr_sockets);
+    rc = libxl_get_online_socketmap(ctx, &socketmap);
+    if (rc < 0) {
+        LOGE(ERROR, "failed to get available sockets");
+        goto out;
+    }
+
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    for (i = 0; i < nr_sockets; i++) {
-        if (xc_psr_cat_get_l3_info(ctx->xch, i, &ptr[i].cos_max,
-                                                &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socket, socketmap) {
+        ptr[i].id = socket;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
+                                                     &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
             goto out;
         }
+        i++;
     }
 
     *info = ptr;
-    *nr = nr_sockets;
+    *nr = i;
 out:
+    libxl_bitmap_dispose(&socketmap);
     GC_FREE;
     return rc;
 }
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index ef346e7..502a148 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -790,6 +790,7 @@ libxl_psr_cbm_type = Enumeration("psr_cbm_type", [
     ])
 
 libxl_psr_cat_info = Struct("psr_cat_info", [
+    ("id", uint32),
     ("cos_max", uint32),
     ("cbm_len", uint32),
     ])
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c61d2dc..a4a168b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8375,35 +8375,35 @@ int main_psr_cmt_show(int argc, char **argv)
 static int psr_cat_hwinfo(void)
 {
     int rc;
-    int socketid, nr_sockets;
+    int i, nr;
     uint32_t l3_cache_size;
     libxl_psr_cat_info *info;
 
     printf("Cache Allocation Technology (CAT):\n");
 
-    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
+    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr);
     if (rc) {
         fprintf(stderr, "Failed to get cat info\n");
         return rc;
     }
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
-        rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+    for (i = 0; i < nr; i++) {
+        rc = libxl_psr_cmt_get_l3_cache_size(ctx, info[i].id, &l3_cache_size);
         if (rc) {
             fprintf(stderr, "Failed to get l3 cache size for socket:%d\n",
-                    socketid);
+                    info[i].id);
             goto out;
         }
-        printf("%-16s: %u\n", "Socket ID", socketid);
+        printf("%-16s: %u\n", "Socket ID", info[i].id);
         printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
-        printf("%-16s: %u\n", "Maximum COS", info->cos_max);
-        printf("%-16s: %u\n", "CBM length", info->cbm_len);
+        printf("%-16s: %u\n", "Maximum COS", info[i].cos_max);
+        printf("%-16s: %u\n", "CBM length", info[i].cbm_len);
         printf("%-16s: %#llx\n", "Default CBM",
-               (1ull << info->cbm_len) - 1);
+               (1ull << info[i].cbm_len) - 1);
     }
 
 out:
-    libxl_psr_cat_info_list_free(info, nr_sockets);
+    libxl_psr_cat_info_list_free(info, nr);
     return rc;
 }
 
@@ -8445,47 +8445,46 @@ static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid)
     return 0;
 }
 
-static int psr_cat_print_socket(uint32_t domid, uint32_t socketid,
-                                libxl_psr_cat_info *info)
+static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info)
 {
     int rc;
     uint32_t l3_cache_size;
 
-    rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+    rc = libxl_psr_cmt_get_l3_cache_size(ctx, info->id, &l3_cache_size);
     if (rc) {
         fprintf(stderr, "Failed to get l3 cache size for socket:%d\n",
-                socketid);
+                info->id);
         return -1;
     }
 
-    printf("%-16s: %u\n", "Socket ID", socketid);
+    printf("%-16s: %u\n", "Socket ID", info->id);
     printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
     printf("%-16s: %#llx\n", "Default CBM", (1ull << info->cbm_len) - 1);
     printf("%5s%25s%16s\n", "ID", "NAME", "CBM");
 
-    return psr_cat_print_domain_cbm(domid, socketid);
+    return psr_cat_print_domain_cbm(domid, info->id);
 }
 
 static int psr_cat_show(uint32_t domid)
 {
-    int socketid, nr_sockets;
+    int i, nr;
     int rc;
     libxl_psr_cat_info *info;
 
-    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
+    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr);
     if (rc) {
         fprintf(stderr, "Failed to get cat info\n");
         return rc;
     }
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
-        rc = psr_cat_print_socket(domid, socketid, info + socketid);
+    for (i = 0; i < nr; i++) {
+        rc = psr_cat_print_socket(domid, info + i);
         if (rc)
             goto out;
     }
 
 out:
-    libxl_psr_cat_info_list_free(info, nr_sockets);
+    libxl_psr_cat_info_list_free(info, nr);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhiVa-0004oM-Tg; Thu, 01 Oct 2015 18:23: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 1ZhiVZ-0004o9-KV
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:09 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	39/55-32641-C0A7D065; Thu, 01 Oct 2015 18:23:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1443723786!49347965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4178 invoked from network); 1 Oct 2015 18:23:07 -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;
	1 Oct 2015 18:23:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVW-0006Nv-P6
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVW-00030i-Kz
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:06 +0000
Date: Thu, 01 Oct 2015 18:23:06 +0000
Message-Id: <E1ZhiVW-00030i-Kz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxl: return socket id from
	libxl_psr_cat_get_l3_info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 029375fe5e08cff5fe2634878ae62ed4780a6fcf
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:52 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:53 2015 +0100

    tools/libxl: return socket id from libxl_psr_cat_get_l3_info
    
    The entries returned from libxl_psr_cat_get_l3_info are assumed
    to be socket-continuous. But this is not true in the hotplug case.
    
    This patch gets the socket bitmap for all the sockets on the system
    first and stores the socket id in the structure libxl_psr_cat_info in
    libxl_psr_cat_get_l3_info. The xl or similar consumers then can display
    socket information correctly.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 30e7a6fde8d4810a230324b89125b4bdc8e5374d)
---
 tools/libxl/libxl_psr.c     |   23 ++++++++++++++++++-----
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |   41 ++++++++++++++++++++---------------------
 3 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 3378239..30740a1 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,30 +339,43 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i, nr_sockets;
+    int i = 0, socket, nr_sockets;
+    libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
+    libxl_bitmap_init(&socketmap);
+
     rc = libxl__count_physical_sockets(gc, &nr_sockets);
     if (rc) {
         LOGE(ERROR, "failed to get system socket count");
         goto out;
     }
 
+    libxl_socket_bitmap_alloc(ctx, &socketmap, nr_sockets);
+    rc = libxl_get_online_socketmap(ctx, &socketmap);
+    if (rc < 0) {
+        LOGE(ERROR, "failed to get available sockets");
+        goto out;
+    }
+
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    for (i = 0; i < nr_sockets; i++) {
-        if (xc_psr_cat_get_l3_info(ctx->xch, i, &ptr[i].cos_max,
-                                                &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socket, socketmap) {
+        ptr[i].id = socket;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
+                                                     &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
             goto out;
         }
+        i++;
     }
 
     *info = ptr;
-    *nr = nr_sockets;
+    *nr = i;
 out:
+    libxl_bitmap_dispose(&socketmap);
     GC_FREE;
     return rc;
 }
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index ef346e7..502a148 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -790,6 +790,7 @@ libxl_psr_cbm_type = Enumeration("psr_cbm_type", [
     ])
 
 libxl_psr_cat_info = Struct("psr_cat_info", [
+    ("id", uint32),
     ("cos_max", uint32),
     ("cbm_len", uint32),
     ])
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c61d2dc..a4a168b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8375,35 +8375,35 @@ int main_psr_cmt_show(int argc, char **argv)
 static int psr_cat_hwinfo(void)
 {
     int rc;
-    int socketid, nr_sockets;
+    int i, nr;
     uint32_t l3_cache_size;
     libxl_psr_cat_info *info;
 
     printf("Cache Allocation Technology (CAT):\n");
 
-    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
+    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr);
     if (rc) {
         fprintf(stderr, "Failed to get cat info\n");
         return rc;
     }
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
-        rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+    for (i = 0; i < nr; i++) {
+        rc = libxl_psr_cmt_get_l3_cache_size(ctx, info[i].id, &l3_cache_size);
         if (rc) {
             fprintf(stderr, "Failed to get l3 cache size for socket:%d\n",
-                    socketid);
+                    info[i].id);
             goto out;
         }
-        printf("%-16s: %u\n", "Socket ID", socketid);
+        printf("%-16s: %u\n", "Socket ID", info[i].id);
         printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
-        printf("%-16s: %u\n", "Maximum COS", info->cos_max);
-        printf("%-16s: %u\n", "CBM length", info->cbm_len);
+        printf("%-16s: %u\n", "Maximum COS", info[i].cos_max);
+        printf("%-16s: %u\n", "CBM length", info[i].cbm_len);
         printf("%-16s: %#llx\n", "Default CBM",
-               (1ull << info->cbm_len) - 1);
+               (1ull << info[i].cbm_len) - 1);
     }
 
 out:
-    libxl_psr_cat_info_list_free(info, nr_sockets);
+    libxl_psr_cat_info_list_free(info, nr);
     return rc;
 }
 
@@ -8445,47 +8445,46 @@ static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid)
     return 0;
 }
 
-static int psr_cat_print_socket(uint32_t domid, uint32_t socketid,
-                                libxl_psr_cat_info *info)
+static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info)
 {
     int rc;
     uint32_t l3_cache_size;
 
-    rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+    rc = libxl_psr_cmt_get_l3_cache_size(ctx, info->id, &l3_cache_size);
     if (rc) {
         fprintf(stderr, "Failed to get l3 cache size for socket:%d\n",
-                socketid);
+                info->id);
         return -1;
     }
 
-    printf("%-16s: %u\n", "Socket ID", socketid);
+    printf("%-16s: %u\n", "Socket ID", info->id);
     printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
     printf("%-16s: %#llx\n", "Default CBM", (1ull << info->cbm_len) - 1);
     printf("%5s%25s%16s\n", "ID", "NAME", "CBM");
 
-    return psr_cat_print_domain_cbm(domid, socketid);
+    return psr_cat_print_domain_cbm(domid, info->id);
 }
 
 static int psr_cat_show(uint32_t domid)
 {
-    int socketid, nr_sockets;
+    int i, nr;
     int rc;
     libxl_psr_cat_info *info;
 
-    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
+    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr);
     if (rc) {
         fprintf(stderr, "Failed to get cat info\n");
         return rc;
     }
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
-        rc = psr_cat_print_socket(domid, socketid, info + socketid);
+    for (i = 0; i < nr; i++) {
+        rc = psr_cat_print_socket(domid, info + i);
         if (rc)
             goto out;
     }
 
 out:
-    libxl_psr_cat_info_list_free(info, nr_sockets);
+    libxl_psr_cat_info_list_free(info, nr);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiVo-0004qR-07; Thu, 01 Oct 2015 18:23: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 1ZhiVl-0004q7-TE
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:21 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	EA/B6-18744-91A7D065; Thu, 01 Oct 2015 18:23:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1443723797!54804025!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19917 invoked from network); 1 Oct 2015 18:23:18 -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;
	1 Oct 2015 18:23:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVh-0006O3-50
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVh-00031a-0z
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:17 +0000
Date: Thu, 01 Oct 2015 18:23:17 +0000
Message-Id: <E1ZhiVh-00031a-0z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxl: fix range check in
	main_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 45c6e842d3abbf265b417c59c4bb9044c2cdb2fc
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:53 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:53 2015 +0100

    tools/libxl: fix range check in main_psr_cat_cbm_set
    
    The 'end' should be inclusive.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit e364a9cecea0bf6c5b02bea674745cd37ea0ad5c)
---
 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 a4a168b..9a2870e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8515,7 +8515,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
         len = libxl_string_list_length(&socket_list);
         for (i = 0; i < len; i++) {
             parse_range(socket_list[i], &start, &end);
-            for (j = start; j < end; j++)
+            for (j = start; j <= end; j++)
                 libxl_bitmap_set(&target_map, j);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiVo-0004qR-07; Thu, 01 Oct 2015 18:23: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 1ZhiVl-0004q7-TE
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:21 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	EA/B6-18744-91A7D065; Thu, 01 Oct 2015 18:23:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1443723797!54804025!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19917 invoked from network); 1 Oct 2015 18:23:18 -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;
	1 Oct 2015 18:23:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVh-0006O3-50
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVh-00031a-0z
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:17 +0000
Date: Thu, 01 Oct 2015 18:23:17 +0000
Message-Id: <E1ZhiVh-00031a-0z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/libxl: fix range check in
	main_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 45c6e842d3abbf265b417c59c4bb9044c2cdb2fc
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:53 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:53 2015 +0100

    tools/libxl: fix range check in main_psr_cat_cbm_set
    
    The 'end' should be inclusive.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit e364a9cecea0bf6c5b02bea674745cd37ea0ad5c)
---
 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 a4a168b..9a2870e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8515,7 +8515,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
         len = libxl_string_list_length(&socket_list);
         for (i = 0; i < len; i++) {
             parse_range(socket_list[i], &start, &end);
-            for (j = start; j < end; j++)
+            for (j = start; j <= end; j++)
                 libxl_bitmap_set(&target_map, j);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiVv-0004rs-2Y; Thu, 01 Oct 2015 18:23: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 1ZhiVt-0004rW-TX
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:30 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	4B/A0-26043-12A7D065; Thu, 01 Oct 2015 18:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1443723807!54903839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9616 invoked from network); 1 Oct 2015 18:23:28 -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;
	1 Oct 2015 18:23: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 1ZhiVr-0006OB-JV
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVr-00031x-Ct
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:27 +0000
Date: Thu, 01 Oct 2015 18:23:27 +0000
Message-Id: <E1ZhiVr-00031x-Ct@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] docs: make xl-psr.markdown more
	precise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41c46dd10b4809b6cb015ab229b552ffee7730d6
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:54 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:54 2015 +0100

    docs: make xl-psr.markdown more precise
    
    Drop the chapter number as it can be confusing when it gets changed in
    the referred document.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- dropped hunk changing URL to specific revision, this is not
             needed now that the references do not include a specific
             chapter number ]
    
    (cherry picked from commit 7f732ffa2b4e5bea27be56ba1970a0025ac1124d)
---
 docs/misc/xl-psr.markdown |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xl-psr.markdown b/docs/misc/xl-psr.markdown
index 3545912..c32e25c 100644
--- a/docs/misc/xl-psr.markdown
+++ b/docs/misc/xl-psr.markdown
@@ -14,7 +14,7 @@ tracks cache utilization of memory accesses according to the RMID and reports
 monitored data via a counter register.
 
 For more detailed information please refer to Intel SDM chapter
-"17.14 - Platform Shared Resource Monitoring: Cache Monitoring Technology".
+"Platform Shared Resource Monitoring: Cache Monitoring Technology".
 
 In Xen's implementation, each domain in the system can be assigned a RMID
 independently, while RMID=0 is reserved for monitoring domains that don't
@@ -52,7 +52,7 @@ event type to monitor system total/local memory bandwidth. The same RMID can
 be used to monitor both cache usage and memory bandwidth at the same time.
 
 For more detailed information please refer to Intel SDM chapter
-"17.14 - Platform Shared Resource Monitoring: Cache Monitoring Technology".
+"Overview of Cache Monitoring Technology and Memory Bandwidth Monitoring".
 
 In Xen's implementation, MBM shares the same set of underlying monitoring
 service with CMT and can be used to monitor memory bandwidth on a per domain
@@ -92,7 +92,7 @@ For example, assuming a system with 8 portions and 3 domains:
    access to one quarter each.
 
 For more detailed information please refer to Intel SDM chapter
-"17.15 - Platform Shared Resource Control: Cache Allocation Technology".
+"Platform Shared Resource Control: Cache Allocation Technology".
 
 In Xen's implementation, CBM can be configured with libxl/xl interfaces but
 COS is maintained in hypervisor only. The cache partition granularity is per
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiVv-0004rs-2Y; Thu, 01 Oct 2015 18:23: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 1ZhiVt-0004rW-TX
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:30 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	4B/A0-26043-12A7D065; Thu, 01 Oct 2015 18:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1443723807!54903839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9616 invoked from network); 1 Oct 2015 18:23:28 -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;
	1 Oct 2015 18:23: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 1ZhiVr-0006OB-JV
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiVr-00031x-Ct
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:27 +0000
Date: Thu, 01 Oct 2015 18:23:27 +0000
Message-Id: <E1ZhiVr-00031x-Ct@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] docs: make xl-psr.markdown more
	precise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41c46dd10b4809b6cb015ab229b552ffee7730d6
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:54 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:54 2015 +0100

    docs: make xl-psr.markdown more precise
    
    Drop the chapter number as it can be confusing when it gets changed in
    the referred document.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- dropped hunk changing URL to specific revision, this is not
             needed now that the references do not include a specific
             chapter number ]
    
    (cherry picked from commit 7f732ffa2b4e5bea27be56ba1970a0025ac1124d)
---
 docs/misc/xl-psr.markdown |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xl-psr.markdown b/docs/misc/xl-psr.markdown
index 3545912..c32e25c 100644
--- a/docs/misc/xl-psr.markdown
+++ b/docs/misc/xl-psr.markdown
@@ -14,7 +14,7 @@ tracks cache utilization of memory accesses according to the RMID and reports
 monitored data via a counter register.
 
 For more detailed information please refer to Intel SDM chapter
-"17.14 - Platform Shared Resource Monitoring: Cache Monitoring Technology".
+"Platform Shared Resource Monitoring: Cache Monitoring Technology".
 
 In Xen's implementation, each domain in the system can be assigned a RMID
 independently, while RMID=0 is reserved for monitoring domains that don't
@@ -52,7 +52,7 @@ event type to monitor system total/local memory bandwidth. The same RMID can
 be used to monitor both cache usage and memory bandwidth at the same time.
 
 For more detailed information please refer to Intel SDM chapter
-"17.14 - Platform Shared Resource Monitoring: Cache Monitoring Technology".
+"Overview of Cache Monitoring Technology and Memory Bandwidth Monitoring".
 
 In Xen's implementation, MBM shares the same set of underlying monitoring
 service with CMT and can be used to monitor memory bandwidth on a per domain
@@ -92,7 +92,7 @@ For example, assuming a system with 8 portions and 3 domains:
    access to one quarter each.
 
 For more detailed information please refer to Intel SDM chapter
-"17.15 - Platform Shared Resource Control: Cache Allocation Technology".
+"Platform Shared Resource Control: Cache Allocation Technology".
 
 In Xen's implementation, CBM can be configured with libxl/xl interfaces but
 COS is maintained in hypervisor only. The cache partition granularity is per
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiW5-0004tm-5B; Thu, 01 Oct 2015 18:23: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 1ZhiW4-0004te-FU
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:40 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	2A/2C-16618-B2A7D065; Thu, 01 Oct 2015 18:23:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1443723818!21984624!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 24442 invoked from network); 1 Oct 2015 18:23:39 -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;
	1 Oct 2015 18:23:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiW1-0006OJ-UQ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiW1-00032m-SD
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:37 +0000
Date: Thu, 01 Oct 2015 18:23:37 +0000
Message-Id: <E1ZhiW1-00032m-SD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] docs/man: resort sections
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fc39c8824120711ccd6681999a7e121008291267
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:55 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:54 2015 +0100

    docs/man: resort sections
    
    Section 'IGNORED FOR COMPATIBILITY WITH XM' separates 'CACHE MONITORING
    TECHNOLOGY' and 'CACHE ALLOCATION TECHNOLOGY' but they really should be
    put together.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 61598449ae28fe89036a699fd524b73b9ca454ae)
---
 docs/man/xl.pod.1 |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index f22c3f3..d0cd612 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1509,18 +1509,6 @@ monitor types are:
 
 =back
 
-=head1 IGNORED FOR COMPATIBILITY WITH XM
-
-xl is mostly command-line compatible with the old xm utility used with
-the old Python xend.  For compatibility, the following options are
-ignored:
-
-=over 4
-
-=item B<xl migrate --live>
-
-=back
-
 =head2 CACHE ALLOCATION TECHNOLOGY
 
 Intel Broadwell and later server platforms offer capabilities to configure and
@@ -1553,6 +1541,18 @@ Show CAT settings for a certain domain or all domains.
 
 =back
 
+=head1 IGNORED FOR COMPATIBILITY WITH XM
+
+xl is mostly command-line compatible with the old xm utility used with
+the old Python xend.  For compatibility, the following options are
+ignored:
+
+=over 4
+
+=item B<xl migrate --live>
+
+=back
+
 =head1 TO BE DOCUMENTED
 
 We need better documentation for:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiW5-0004tm-5B; Thu, 01 Oct 2015 18:23: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 1ZhiW4-0004te-FU
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:40 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	2A/2C-16618-B2A7D065; Thu, 01 Oct 2015 18:23:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1443723818!21984624!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 24442 invoked from network); 1 Oct 2015 18:23:39 -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;
	1 Oct 2015 18:23:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiW1-0006OJ-UQ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiW1-00032m-SD
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:37 +0000
Date: Thu, 01 Oct 2015 18:23:37 +0000
Message-Id: <E1ZhiW1-00032m-SD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] docs/man: resort sections
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fc39c8824120711ccd6681999a7e121008291267
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:55 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:59:54 2015 +0100

    docs/man: resort sections
    
    Section 'IGNORED FOR COMPATIBILITY WITH XM' separates 'CACHE MONITORING
    TECHNOLOGY' and 'CACHE ALLOCATION TECHNOLOGY' but they really should be
    put together.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 61598449ae28fe89036a699fd524b73b9ca454ae)
---
 docs/man/xl.pod.1 |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index f22c3f3..d0cd612 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1509,18 +1509,6 @@ monitor types are:
 
 =back
 
-=head1 IGNORED FOR COMPATIBILITY WITH XM
-
-xl is mostly command-line compatible with the old xm utility used with
-the old Python xend.  For compatibility, the following options are
-ignored:
-
-=over 4
-
-=item B<xl migrate --live>
-
-=back
-
 =head2 CACHE ALLOCATION TECHNOLOGY
 
 Intel Broadwell and later server platforms offer capabilities to configure and
@@ -1553,6 +1541,18 @@ Show CAT settings for a certain domain or all domains.
 
 =back
 
+=head1 IGNORED FOR COMPATIBILITY WITH XM
+
+xl is mostly command-line compatible with the old xm utility used with
+the old Python xend.  For compatibility, the following options are
+ignored:
+
+=over 4
+
+=item B<xl migrate --live>
+
+=back
+
 =head1 TO BE DOCUMENTED
 
 We need better documentation for:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiWF-0004vi-89; Thu, 01 Oct 2015 18:23:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiWE-0004vW-PJ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:50 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	C4/F4-29649-63A7D065; Thu, 01 Oct 2015 18:23:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1443723828!49467612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17655 invoked from network); 1 Oct 2015 18:23:49 -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;
	1 Oct 2015 18:23: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 1ZhiWC-0006OW-7A
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiWC-00033a-63
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:48 +0000
Date: Thu, 01 Oct 2015 18:23:48 +0000
Message-Id: <E1ZhiWC-00033a-63@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] QEMU_UPSTREAM_REVISION update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e275fbcbe91fe904a335e049cdc439456df75b14
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Sep 29 11:49:34 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Sep 29 11:49:34 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index 77f83a2..5a3774e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -254,7 +254,7 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0-rc3
+QEMU_UPSTREAM_REVISION ?= cc31b41210ed66b07822a8c534053273d249dbe6
 MINIOS_UPSTREAM_REVISION ?= b36bcb370d611ad7f41e8c21d061e6291e088c58
 # Fri Jun 26 11:58:40 2015 +0100
 # Correct printf formatting for tpm_tis message.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 01 18:23:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2015 18:23: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 1ZhiWF-0004vi-89; Thu, 01 Oct 2015 18:23:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiWE-0004vW-PJ
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:50 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	C4/F4-29649-63A7D065; Thu, 01 Oct 2015 18:23:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1443723828!49467612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17655 invoked from network); 1 Oct 2015 18:23:49 -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;
	1 Oct 2015 18:23: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 1ZhiWC-0006OW-7A
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhiWC-00033a-63
	for xen-changelog@lists.xensource.com; Thu, 01 Oct 2015 18:23:48 +0000
Date: Thu, 01 Oct 2015 18:23:48 +0000
Message-Id: <E1ZhiWC-00033a-63@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] QEMU_UPSTREAM_REVISION update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e275fbcbe91fe904a335e049cdc439456df75b14
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Sep 29 11:49:34 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Sep 29 11:49:34 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index 77f83a2..5a3774e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -254,7 +254,7 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0-rc3
+QEMU_UPSTREAM_REVISION ?= cc31b41210ed66b07822a8c534053273d249dbe6
 MINIOS_UPSTREAM_REVISION ?= b36bcb370d611ad7f41e8c21d061e6291e088c58
 # Fri Jun 26 11:58:40 2015 +0100
 # Correct printf formatting for tpm_tis message.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:22:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12: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 1ZhzLl-0004gX-2y; Fri, 02 Oct 2015 12:22: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 1ZhzLj-0004gH-Ag
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:07 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	09/1B-10422-EE67E065; Fri, 02 Oct 2015 12:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1443788525!36584898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9723 invoked from network); 2 Oct 2015 12:22:06 -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;
	2 Oct 2015 12:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzLh-0001v9-1O
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzLf-0005Ho-PL
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:04 +0000
Date: Fri, 02 Oct 2015 12:22:03 +0000
Message-Id: <E1ZhzLf-0005Ho-PL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] libxl: handle read-only drives
	with qemu-xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0619913669efc834877c9d08c98ed58cb8459e7e
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Sep 22 16:56:18 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Sep 22 16:56:18 2015 +0100

    libxl: handle read-only drives with qemu-xen
    
    The current libxl code doesn't deal with read-only drives at all.
    
    Upstream QEMU and qemu-xen only support read-only cdrom drives: make
    sure to specify "readonly=on" for cdrom drives and return error in case
    the user requested a non-cdrom read-only drive.
    
    This is XSA-142, discovered by Lin Liu
    (https://bugzilla.redhat.com/show_bug.cgi?id=1257893).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    
    Backport to Xen 4.5 and earlier, apropos of report and review from
    Michael Young.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index b4ce523..d74fb14 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -797,13 +797,18 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             if (disks[i].is_cdrom) {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
                     drive = libxl__sprintf
-                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback,id=ide-%i",
-                         disk, dev_number);
+                        (gc, "if=ide,index=%d,readonly=%s,media=cdrom,cache=writeback,id=ide-%i",
+                         disk, disks[i].readwrite ? "off" : "on", dev_number);
                 else
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback,id=ide-%i",
-                         disks[i].pdev_path, disk, format, dev_number);
+                        (gc, "file=%s,if=ide,index=%d,readonly=%s,media=cdrom,format=%s,cache=writeback,id=ide-%i",
+                         disks[i].pdev_path, disk, disks[i].readwrite ? "off" : "on", format, dev_number);
             } else {
+                if (!disks[i].readwrite) {
+                    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "qemu-xen doesn't support read-only disk drivers");
+                    return NULL;
+                }
+
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
                     LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "cannot support"
                                " empty disk format for %s", disks[i].vdev);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:22:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12: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 1ZhzLl-0004gX-2y; Fri, 02 Oct 2015 12:22: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 1ZhzLj-0004gH-Ag
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:07 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	09/1B-10422-EE67E065; Fri, 02 Oct 2015 12:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1443788525!36584898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9723 invoked from network); 2 Oct 2015 12:22:06 -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;
	2 Oct 2015 12:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzLh-0001v9-1O
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzLf-0005Ho-PL
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:04 +0000
Date: Fri, 02 Oct 2015 12:22:03 +0000
Message-Id: <E1ZhzLf-0005Ho-PL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] libxl: handle read-only drives
	with qemu-xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0619913669efc834877c9d08c98ed58cb8459e7e
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Sep 22 16:56:18 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Sep 22 16:56:18 2015 +0100

    libxl: handle read-only drives with qemu-xen
    
    The current libxl code doesn't deal with read-only drives at all.
    
    Upstream QEMU and qemu-xen only support read-only cdrom drives: make
    sure to specify "readonly=on" for cdrom drives and return error in case
    the user requested a non-cdrom read-only drive.
    
    This is XSA-142, discovered by Lin Liu
    (https://bugzilla.redhat.com/show_bug.cgi?id=1257893).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    
    Backport to Xen 4.5 and earlier, apropos of report and review from
    Michael Young.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index b4ce523..d74fb14 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -797,13 +797,18 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             if (disks[i].is_cdrom) {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
                     drive = libxl__sprintf
-                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback,id=ide-%i",
-                         disk, dev_number);
+                        (gc, "if=ide,index=%d,readonly=%s,media=cdrom,cache=writeback,id=ide-%i",
+                         disk, disks[i].readwrite ? "off" : "on", dev_number);
                 else
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback,id=ide-%i",
-                         disks[i].pdev_path, disk, format, dev_number);
+                        (gc, "file=%s,if=ide,index=%d,readonly=%s,media=cdrom,format=%s,cache=writeback,id=ide-%i",
+                         disks[i].pdev_path, disk, disks[i].readwrite ? "off" : "on", format, dev_number);
             } else {
+                if (!disks[i].readwrite) {
+                    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "qemu-xen doesn't support read-only disk drivers");
+                    return NULL;
+                }
+
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
                     LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "cannot support"
                                " empty disk format for %s", disks[i].vdev);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhzLv-0004iO-5U; Fri, 02 Oct 2015 12:22: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 1ZhzLt-0004i8-PL
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:17 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	72/20-05269-9F67E065; Fri, 02 Oct 2015 12:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1443788535!16941229!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4502 invoked from network); 2 Oct 2015 12:22: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;
	2 Oct 2015 12:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzLr-0001vJ-AA
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzLr-0005Ih-8T
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:15 +0000
Date: Fri, 02 Oct 2015 12:22:15 +0000
Message-Id: <E1ZhzLr-0005Ih-8T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] efi: introduce
	efi_arch_flush_dcache_area
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bfa874d7ce12e2903a050ed8173687f75cae789e
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Sep 23 09:06:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:06:00 2015 +0200

    efi: introduce efi_arch_flush_dcache_area
    
    Objects loaded by FileHandle->Read need to be flushed from dcache,
    otherwise copy_from_paddr will read stale data when copying the kernel,
    causing a failure to boot.
    
    Introduce efi_arch_flush_dcache_area and call it from read_file.
    
    This commit introduces no functional changes on x86.
    
    Reported-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 0d6a3c755374f04f6dd25373da28291a8f35bede
    master date: 2015-09-09 15:29:06 +0200
---
 xen/arch/arm/efi/efi-boot.h |    7 +++++++
 xen/arch/x86/efi/efi-boot.h |    2 ++
 xen/common/efi/boot.c       |    2 ++
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index cf9c3c6..7a84fa8 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -9,6 +9,7 @@
 #include <asm/smp.h>
 
 void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size);
+void __flush_dcache_area(const void *vaddr, unsigned long size);
 
 #define DEVICE_TREE_GUID \
 {0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
@@ -570,6 +571,12 @@ static void __init efi_arch_video_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
                                        EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info)
 {
 }
+
+static void efi_arch_flush_dcache_area(const void *vaddr, UINTN size)
+{
+    __flush_dcache_area(vaddr, size);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 2dd69f6..4c7f383 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -640,6 +640,8 @@ static bool_t __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
     return 1; /* x86 always uses a config file */
 }
 
+static void efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { }
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 532ed8c..2a3cd78 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -526,6 +526,8 @@ static bool_t __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
         PrintErrMesg(name, ret);
     }
 
+    efi_arch_flush_dcache_area(file->ptr, file->size);
+
     return 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 Fri Oct 02 12:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhzLv-0004iO-5U; Fri, 02 Oct 2015 12:22: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 1ZhzLt-0004i8-PL
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:17 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	72/20-05269-9F67E065; Fri, 02 Oct 2015 12:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1443788535!16941229!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4502 invoked from network); 2 Oct 2015 12:22: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;
	2 Oct 2015 12:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzLr-0001vJ-AA
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzLr-0005Ih-8T
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:15 +0000
Date: Fri, 02 Oct 2015 12:22:15 +0000
Message-Id: <E1ZhzLr-0005Ih-8T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] efi: introduce
	efi_arch_flush_dcache_area
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bfa874d7ce12e2903a050ed8173687f75cae789e
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Sep 23 09:06:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:06:00 2015 +0200

    efi: introduce efi_arch_flush_dcache_area
    
    Objects loaded by FileHandle->Read need to be flushed from dcache,
    otherwise copy_from_paddr will read stale data when copying the kernel,
    causing a failure to boot.
    
    Introduce efi_arch_flush_dcache_area and call it from read_file.
    
    This commit introduces no functional changes on x86.
    
    Reported-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 0d6a3c755374f04f6dd25373da28291a8f35bede
    master date: 2015-09-09 15:29:06 +0200
---
 xen/arch/arm/efi/efi-boot.h |    7 +++++++
 xen/arch/x86/efi/efi-boot.h |    2 ++
 xen/common/efi/boot.c       |    2 ++
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index cf9c3c6..7a84fa8 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -9,6 +9,7 @@
 #include <asm/smp.h>
 
 void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size);
+void __flush_dcache_area(const void *vaddr, unsigned long size);
 
 #define DEVICE_TREE_GUID \
 {0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
@@ -570,6 +571,12 @@ static void __init efi_arch_video_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
                                        EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info)
 {
 }
+
+static void efi_arch_flush_dcache_area(const void *vaddr, UINTN size)
+{
+    __flush_dcache_area(vaddr, size);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 2dd69f6..4c7f383 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -640,6 +640,8 @@ static bool_t __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
     return 1; /* x86 always uses a config file */
 }
 
+static void efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { }
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 532ed8c..2a3cd78 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -526,6 +526,8 @@ static bool_t __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
         PrintErrMesg(name, ret);
     }
 
+    efi_arch_flush_dcache_area(file->ptr, file->size);
+
     return 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 Fri Oct 02 12:22:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:22: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 1ZhzM6-0004ks-8I; Fri, 02 Oct 2015 12:22: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 1ZhzM4-0004kT-Cp
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:28 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	E8/63-24494-3077E065; Fri, 02 Oct 2015 12:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1443788546!35346167!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21934 invoked from network); 2 Oct 2015 12:22:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:22:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzM1-0001vX-R0
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzM1-0005J3-He
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:25 +0000
Date: Fri, 02 Oct 2015 12:22:25 +0000
Message-Id: <E1ZhzM1-0005J3-He@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/hvm: fix saved pmtimer and
	hpet values
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe842225f2d2dd71c97cff7ce2cea157328c4e9c
Author:     Kouya Shimura <kouya@jp.fujitsu.com>
AuthorDate: Wed Sep 23 09:07:18 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:07:18 2015 +0200

    x86/hvm: fix saved pmtimer and hpet values
    
    The ACPI PM timer is sometimes broken on live migration.
    Since vcpu->arch.hvm_vcpu.guest_time is always zero in other than
    "delay for missed ticks mode". Even in "delay for missed ticks mode",
    vcpu's guest_time field is not valid (i.e. zero) when
    the state of vcpu is "blocked". (see pt_save_timer function)
    
    The original author (Tim Deegan) of pmtimer_save() must have intended
    that it saves the last scheduled time of the vcpu. Unfortunately it was
    already implied this bug. FYI, there is no other timer mode than
    "delay for missed ticks mode" then.
    
    For consistency with HPET, pmtimer_save() should refer hvm_get_guest_time()
    to update the counter as well as hpet_save() does.
    
    Without this patch, the clock of windows server 2012R2 without HPET
    might leap forward several minutes on live migration.
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    
    Retain use of ->arch.hvm_vcpu.guest_time when non-zero. Do the inverse
    adjustment for vHPET.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Kouya Shimura <kouya@jp.fujitsu.com>
    master commit: 244582a01dcb49fa30083725964a066937cc94f2
    master date: 2015-09-11 16:24:56 +0200
---
 xen/arch/x86/hvm/hpet.c    |    4 +++-
 xen/arch/x86/hvm/pmtimer.c |   10 ++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index bdfc6fc..9ca8259 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -506,11 +506,13 @@ const struct hvm_mmio_handler hpet_mmio_handler = {
 static int hpet_save(struct domain *d, hvm_domain_context_t *h)
 {
     HPETState *hp = domain_vhpet(d);
+    struct vcpu *v = pt_global_vcpu_target(d);
     int rc;
     uint64_t guest_time;
 
     write_lock(&hp->lock);
-    guest_time = guest_time_hpet(hp);
+    guest_time = (v->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(v)) /
+                 STIME_PER_HPET_TICK;
 
     /* Write the proper value into the main counter */
     if ( hpet_enabled(hp) )
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 6ad2797..0f79e84 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -250,10 +250,12 @@ static int pmtimer_save(struct domain *d, hvm_domain_context_t *h)
 
     spin_lock(&s->lock);
 
-    /* Update the counter to the guest's current time.  We always save
-     * with the domain paused, so the saved time should be after the
-     * last_gtime, but just in case, make sure we only go forwards */
-    x = ((s->vcpu->arch.hvm_vcpu.guest_time - s->last_gtime) * s->scale) >> 32;
+    /*
+     * Update the counter to the guest's current time.  Make sure it only
+     * goes forwards.
+     */
+    x = (((s->vcpu->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(s->vcpu)) -
+          s->last_gtime) * s->scale) >> 32;
     if ( x < 1UL<<31 )
         s->pm.tmr_val += x;
     if ( (s->pm.tmr_val & TMR_VAL_MSB) != msb )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:22:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:22: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 1ZhzM6-0004ks-8I; Fri, 02 Oct 2015 12:22: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 1ZhzM4-0004kT-Cp
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:28 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	E8/63-24494-3077E065; Fri, 02 Oct 2015 12:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1443788546!35346167!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21934 invoked from network); 2 Oct 2015 12:22:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:22:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzM1-0001vX-R0
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzM1-0005J3-He
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:25 +0000
Date: Fri, 02 Oct 2015 12:22:25 +0000
Message-Id: <E1ZhzM1-0005J3-He@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/hvm: fix saved pmtimer and
	hpet values
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe842225f2d2dd71c97cff7ce2cea157328c4e9c
Author:     Kouya Shimura <kouya@jp.fujitsu.com>
AuthorDate: Wed Sep 23 09:07:18 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:07:18 2015 +0200

    x86/hvm: fix saved pmtimer and hpet values
    
    The ACPI PM timer is sometimes broken on live migration.
    Since vcpu->arch.hvm_vcpu.guest_time is always zero in other than
    "delay for missed ticks mode". Even in "delay for missed ticks mode",
    vcpu's guest_time field is not valid (i.e. zero) when
    the state of vcpu is "blocked". (see pt_save_timer function)
    
    The original author (Tim Deegan) of pmtimer_save() must have intended
    that it saves the last scheduled time of the vcpu. Unfortunately it was
    already implied this bug. FYI, there is no other timer mode than
    "delay for missed ticks mode" then.
    
    For consistency with HPET, pmtimer_save() should refer hvm_get_guest_time()
    to update the counter as well as hpet_save() does.
    
    Without this patch, the clock of windows server 2012R2 without HPET
    might leap forward several minutes on live migration.
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    
    Retain use of ->arch.hvm_vcpu.guest_time when non-zero. Do the inverse
    adjustment for vHPET.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Kouya Shimura <kouya@jp.fujitsu.com>
    master commit: 244582a01dcb49fa30083725964a066937cc94f2
    master date: 2015-09-11 16:24:56 +0200
---
 xen/arch/x86/hvm/hpet.c    |    4 +++-
 xen/arch/x86/hvm/pmtimer.c |   10 ++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index bdfc6fc..9ca8259 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -506,11 +506,13 @@ const struct hvm_mmio_handler hpet_mmio_handler = {
 static int hpet_save(struct domain *d, hvm_domain_context_t *h)
 {
     HPETState *hp = domain_vhpet(d);
+    struct vcpu *v = pt_global_vcpu_target(d);
     int rc;
     uint64_t guest_time;
 
     write_lock(&hp->lock);
-    guest_time = guest_time_hpet(hp);
+    guest_time = (v->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(v)) /
+                 STIME_PER_HPET_TICK;
 
     /* Write the proper value into the main counter */
     if ( hpet_enabled(hp) )
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 6ad2797..0f79e84 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -250,10 +250,12 @@ static int pmtimer_save(struct domain *d, hvm_domain_context_t *h)
 
     spin_lock(&s->lock);
 
-    /* Update the counter to the guest's current time.  We always save
-     * with the domain paused, so the saved time should be after the
-     * last_gtime, but just in case, make sure we only go forwards */
-    x = ((s->vcpu->arch.hvm_vcpu.guest_time - s->last_gtime) * s->scale) >> 32;
+    /*
+     * Update the counter to the guest's current time.  Make sure it only
+     * goes forwards.
+     */
+    x = (((s->vcpu->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(s->vcpu)) -
+          s->last_gtime) * s->scale) >> 32;
     if ( x < 1UL<<31 )
         s->pm.tmr_val += x;
     if ( (s->pm.tmr_val & TMR_VAL_MSB) != msb )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:22:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:22: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 1ZhzMG-0004mz-Ar; Fri, 02 Oct 2015 12:22: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 1ZhzME-0004mW-Qn
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:38 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	60/7A-30270-D077E065; Fri, 02 Oct 2015 12:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1443788556!36585084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14459 invoked from network); 2 Oct 2015 12:22:37 -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;
	2 Oct 2015 12:22:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMC-0001vf-5N
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMC-0005JP-3J
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:36 +0000
Date: Fri, 02 Oct 2015 12:22:36 +0000
Message-Id: <E1ZhzMC-0005JP-3J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m: fix mismatched unlock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33562a45c6497b53fb0cd42b9a1433dba6c3273e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 23 09:07:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:07:52 2015 +0200

    x86/p2m: fix mismatched unlock
    
    Luckily, due to gfn_unlock() currently mapping to p2m_unlock(), this is
    only a cosmetic issue right now.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 1f180822ad3fe83fe293393ec175f14ded98f082
    master date: 2015-09-14 13:39:19 +0200
---
 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 6b9e806..181acc7 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -825,7 +825,7 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
     omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
     if ( p2m_is_grant(ot) || p2m_is_foreign(ot) )
     {
-        p2m_unlock(p2m);
+        gfn_unlock(p2m, gfn, 0);
         domain_crash(d);
         return -ENOENT;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:22:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:22: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 1ZhzMG-0004mz-Ar; Fri, 02 Oct 2015 12:22: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 1ZhzME-0004mW-Qn
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:38 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	60/7A-30270-D077E065; Fri, 02 Oct 2015 12:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1443788556!36585084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14459 invoked from network); 2 Oct 2015 12:22:37 -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;
	2 Oct 2015 12:22:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMC-0001vf-5N
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMC-0005JP-3J
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:36 +0000
Date: Fri, 02 Oct 2015 12:22:36 +0000
Message-Id: <E1ZhzMC-0005JP-3J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m: fix mismatched unlock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33562a45c6497b53fb0cd42b9a1433dba6c3273e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 23 09:07:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:07:52 2015 +0200

    x86/p2m: fix mismatched unlock
    
    Luckily, due to gfn_unlock() currently mapping to p2m_unlock(), this is
    only a cosmetic issue right now.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 1f180822ad3fe83fe293393ec175f14ded98f082
    master date: 2015-09-14 13:39:19 +0200
---
 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 6b9e806..181acc7 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -825,7 +825,7 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
     omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
     if ( p2m_is_grant(ot) || p2m_is_foreign(ot) )
     {
-        p2m_unlock(p2m);
+        gfn_unlock(p2m, gfn, 0);
         domain_crash(d);
         return -ENOENT;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:22:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:22: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 1ZhzMR-0004pC-DL; Fri, 02 Oct 2015 12:22:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMP-0004oh-PZ
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:49 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	FE/6E-01753-9177E065; Fri, 02 Oct 2015 12:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1443788566!49788822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16710 invoked from network); 2 Oct 2015 12:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:22:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMM-0001vn-G3
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMM-0005Jo-CM
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:46 +0000
Date: Fri, 02 Oct 2015 12:22:46 +0000
Message-Id: <E1ZhzMM-0005Jo-CM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/MSI: fail if no hardware
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bda02ca86f323779e5be700eb4de50bbcd8e7e63
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 23 09:08:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:08:22 2015 +0200

    x86/MSI: fail if no hardware support
    
    This is to guard against buggy callers (luckily Dom0 only) invoking
    the respective hypercall for a device not being MSI-capable.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c7d5d5d8ea1ecbd6ef8b47dace4dec825f0f6e48
    master date: 2015-09-16 11:20:27 +0200
---
 xen/arch/x86/msi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 7410d03..255e859 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -566,6 +566,8 @@ static int msi_capability_init(struct pci_dev *dev,
 
     ASSERT(spin_is_locked(&pcidevs_lock));
     pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
+    if ( !pos )
+        return -ENODEV;
     control = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
     maxvec = multi_msi_capable(control);
     if ( nvec > maxvec )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:22:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:22: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 1ZhzMR-0004pC-DL; Fri, 02 Oct 2015 12:22:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMP-0004oh-PZ
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:49 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	FE/6E-01753-9177E065; Fri, 02 Oct 2015 12:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1443788566!49788822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16710 invoked from network); 2 Oct 2015 12:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:22:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMM-0001vn-G3
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMM-0005Jo-CM
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:46 +0000
Date: Fri, 02 Oct 2015 12:22:46 +0000
Message-Id: <E1ZhzMM-0005Jo-CM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/MSI: fail if no hardware
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bda02ca86f323779e5be700eb4de50bbcd8e7e63
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 23 09:08:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:08:22 2015 +0200

    x86/MSI: fail if no hardware support
    
    This is to guard against buggy callers (luckily Dom0 only) invoking
    the respective hypercall for a device not being MSI-capable.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c7d5d5d8ea1ecbd6ef8b47dace4dec825f0f6e48
    master date: 2015-09-16 11:20:27 +0200
---
 xen/arch/x86/msi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 7410d03..255e859 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -566,6 +566,8 @@ static int msi_capability_init(struct pci_dev *dev,
 
     ASSERT(spin_is_locked(&pcidevs_lock));
     pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
+    if ( !pos )
+        return -ENODEV;
     control = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
     maxvec = multi_msi_capable(control);
     if ( nvec > maxvec )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:23:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23: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 1ZhzMb-0004rJ-Fn; Fri, 02 Oct 2015 12:23: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 1ZhzMa-0004r6-I4
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:00 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	82/57-28791-3277E065; Fri, 02 Oct 2015 12:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1443788576!55075378!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7561 invoked from network); 2 Oct 2015 12:22:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:22:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMW-0001vv-Pk
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMW-0005KC-N0
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:56 +0000
Date: Fri, 02 Oct 2015 12:22:56 +0000
Message-Id: <E1ZhzMW-0005KC-N0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/sysctl: don't clobber memory
	if NCAPINTS > ARRAY_SIZE(pi->hw_cap)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9bed9188dd5b0923988615021b3bec17522ec985
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Sep 23 09:08:49 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:08:49 2015 +0200

    x86/sysctl: don't clobber memory if NCAPINTS > ARRAY_SIZE(pi->hw_cap)
    
    There is no current problem, as both NCAPINTS and pi->hw_cap are 8 entries,
    but the limit should be calculated appropriately so as to avoid hypervisor
    stack corruption if the two do get out of sync.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c373b912e74659f0e0898ae93e89513694cfd94e
    master date: 2015-09-16 11:22:00 +0200
---
 xen/arch/x86/sysctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 57ad992..168e474 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -75,7 +75,8 @@ long cpu_down_helper(void *data)
 
 void arch_do_physinfo(xen_sysctl_physinfo_t *pi)
 {
-    memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4);
+    memcpy(pi->hw_cap, boot_cpu_data.x86_capability,
+           min(sizeof(pi->hw_cap), sizeof(boot_cpu_data.x86_capability)));
     if ( hvm_enabled )
         pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm;
     if ( iommu_enabled )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:23:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23: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 1ZhzMb-0004rJ-Fn; Fri, 02 Oct 2015 12:23: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 1ZhzMa-0004r6-I4
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:00 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	82/57-28791-3277E065; Fri, 02 Oct 2015 12:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1443788576!55075378!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7561 invoked from network); 2 Oct 2015 12:22:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:22:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMW-0001vv-Pk
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMW-0005KC-N0
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:22:56 +0000
Date: Fri, 02 Oct 2015 12:22:56 +0000
Message-Id: <E1ZhzMW-0005KC-N0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/sysctl: don't clobber memory
	if NCAPINTS > ARRAY_SIZE(pi->hw_cap)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9bed9188dd5b0923988615021b3bec17522ec985
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Sep 23 09:08:49 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 23 09:08:49 2015 +0200

    x86/sysctl: don't clobber memory if NCAPINTS > ARRAY_SIZE(pi->hw_cap)
    
    There is no current problem, as both NCAPINTS and pi->hw_cap are 8 entries,
    but the limit should be calculated appropriately so as to avoid hypervisor
    stack corruption if the two do get out of sync.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c373b912e74659f0e0898ae93e89513694cfd94e
    master date: 2015-09-16 11:22:00 +0200
---
 xen/arch/x86/sysctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 57ad992..168e474 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -75,7 +75,8 @@ long cpu_down_helper(void *data)
 
 void arch_do_physinfo(xen_sysctl_physinfo_t *pi)
 {
-    memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4);
+    memcpy(pi->hw_cap, boot_cpu_data.x86_capability,
+           min(sizeof(pi->hw_cap), sizeof(boot_cpu_data.x86_capability)));
     if ( hvm_enabled )
         pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm;
     if ( iommu_enabled )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:23:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhzMk-0004tD-Ic; Fri, 02 Oct 2015 12:23: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 1ZhzMk-0004sw-04
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:10 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	46/0F-01753-D277E065; Fri, 02 Oct 2015 12:23:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1443788587!49721187!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 16761 invoked from network); 2 Oct 2015 12:23:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:23:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMh-0001wW-3G
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMh-0005L9-0u
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:07 +0000
Date: Fri, 02 Oct 2015 12:23:07 +0000
Message-Id: <E1ZhzMh-0005L9-0u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: arm: correctly handle vtimer
	traps from userspace
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b0d3714cb4c2d422775ea63b300de0edfe26f06
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Mar 30 12:12:23 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:00 2015 +0100

    xen: arm: correctly handle vtimer traps from userspace
    
    Previously 32-bit userspace on 32-bit kernel and 64-bit userspace on
    64-bit kernel could access these registers irrespective of whether the
    kernel had configured them to be allowed to. To fix this:
    
     - Userspace access to CNTP_CTL_EL0 and CNTP_TVAL_EL0 should be gated
       on CNTKCTL_EL1.EL0PTEN.
     - Userspace access to CNTPCT_EL0 should be gated on
       CNTKCTL_EL1.EL0PCTEN.
    
    When we do not handle an access we now silently inject an undef even
    in debug mode since the debugging messages are not helpful (we have
    handled the access, by explicitly choosing not to).
    
    The usermode accessibility check is rather repetitive, so a helper
    macro is introduced.
    
    Since HSR_EC_CP15_64 cannot be taken from a guest in AArch64 mode
    except due to a hardware bug switch the associated check to a BUG_ON
    (which will be switched to something more appropriate in a subsequent
    patch)
    
    Fix a coding style issue in HSR_CPREG64(CNTPCT) while touching similar
    code.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    (cherry picked from commit d306211e2131eb2d160522f21f21fceaa9dd054c)
    
    Conflicts:
    	xen/arch/arm/traps.c
---
 xen/arch/arm/traps.c            |   28 ++++++++-----------------
 xen/arch/arm/vtimer.c           |   43 +++++++++++++++++++++++++-------------
 xen/include/asm-arm/processor.h |    6 +++++
 3 files changed, 43 insertions(+), 34 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 4063a80..944e241 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1579,11 +1579,7 @@ static void do_cp15_32(struct cpu_user_regs *regs,
     case HSR_CPREG32(CNTP_CTL):
     case HSR_CPREG32(CNTP_TVAL):
         if ( !vtimer_emulate(regs, hsr) )
-        {
-            dprintk(XENLOG_ERR,
-                    "failed emulation of 32-bit vtimer CP register access\n");
-            domain_crash_synchronous();
-        }
+            goto undef_cp15_32;
         break;
     case HSR_CPREG32(ACTLR):
         if ( cp32.read )
@@ -1626,6 +1622,7 @@ static void do_cp15_32(struct cpu_user_regs *regs,
         gdprintk(XENLOG_ERR, "unhandled 32-bit CP15 access %#x\n",
                  hsr.bits & HSR_CP32_REGS_MASK);
 #endif
+ undef_cp15_32:
         inject_undef_exception(regs, hsr.len);
         return;
     }
@@ -1645,11 +1642,7 @@ static void do_cp15_64(struct cpu_user_regs *regs,
     {
     case HSR_CPREG64(CNTPCT):
         if ( !vtimer_emulate(regs, hsr) )
-        {
-            dprintk(XENLOG_ERR,
-                    "failed emulation of 64-bit vtimer CP register access\n");
-            domain_crash_synchronous();
-        }
+            goto undef_cp15_64;
         break;
     default:
         {
@@ -1663,6 +1656,7 @@ static void do_cp15_64(struct cpu_user_regs *regs,
             gdprintk(XENLOG_ERR, "unhandled 64-bit CP15 access %#x\n",
                      hsr.bits & HSR_CP64_REGS_MASK);
 #endif
+ undef_cp15_64:
             inject_undef_exception(regs, hsr.len);
             return;
         }
@@ -1830,11 +1824,7 @@ static void do_sysreg(struct cpu_user_regs *regs,
     case HSR_SYSREG_CNTP_CTL_EL0:
     case HSR_SYSREG_CNTP_TVAL_EL0:
         if ( !vtimer_emulate(regs, hsr) )
-        {
-            dprintk(XENLOG_ERR,
-                    "failed emulation of 64-bit vtimer sysreg access\n");
-            domain_crash_synchronous();
-        }
+            goto undef_sysreg;
         break;
     case HSR_SYSREG_ICC_SGI1R_EL1:
         if ( !vgic_emulate(regs, hsr) )
@@ -1853,8 +1843,8 @@ static void do_sysreg(struct cpu_user_regs *regs,
     default:
  bad_sysreg:
         {
-            struct hsr_sysreg sysreg = hsr.sysreg;
 #ifndef NDEBUG
+            struct hsr_sysreg sysreg = hsr.sysreg;
 
             gdprintk(XENLOG_ERR,
                      "%s %d, %d, c%d, c%d, %d %s x%d @ 0x%"PRIregister"\n",
@@ -1867,7 +1857,8 @@ static void do_sysreg(struct cpu_user_regs *regs,
             gdprintk(XENLOG_ERR, "unhandled 64-bit sysreg access %#x\n",
                      hsr.bits & HSR_SYSREG_REGS_MASK);
 #endif
-            inject_undef_exception(regs, sysreg.len);
+ undef_sysreg:
+            inject_undef_exception(regs, hsr.sysreg.len);
             return;
         }
     }
@@ -2040,8 +2031,7 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
         do_cp15_32(regs, hsr);
         break;
     case HSR_EC_CP15_64:
-        if ( !is_32bit_domain(current->domain) )
-            goto bad_trap;
+        BUG_ON(!psr_mode_is_32bit(regs->cpsr));
         do_cp15_64(regs, hsr);
         break;
     case HSR_EC_CP14_32:
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 2e95ceb..592cfab 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -30,6 +30,14 @@
 extern s_time_t ticks_to_ns(uint64_t ticks);
 extern uint64_t ns_to_ticks(s_time_t ns);
 
+/*
+ * Check if regs is allowed access, user_gate is tail end of a
+ * CNTKCTL_EL1_ bit name which gates user access
+ */
+#define ACCESS_ALLOWED(regs, user_gate) \
+    ( !psr_mode_is_user(regs) || \
+      (READ_SYSREG(CNTKCTL_EL1) & CNTKCTL_EL1_##user_gate) )
+
 static void phys_timer_expired(void *data)
 {
     struct vtimer *t = data;
@@ -122,9 +130,13 @@ int virt_timer_restore(struct vcpu *v)
     return 0;
 }
 
-static void vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read)
+static int vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read)
 {
     struct vcpu *v = current;
+
+    if ( !ACCESS_ALLOWED(regs, EL0PTEN) )
+        return 0;
+
     if ( read )
     {
         *r = v->arch.phys_timer.ctl;
@@ -144,13 +156,17 @@ static void vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read)
         else
             stop_timer(&v->arch.phys_timer.timer);
     }
+    return 1;
 }
 
-static void vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
+static int vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
 {
     struct vcpu *v = current;
     s_time_t now;
 
+    if ( !ACCESS_ALLOWED(regs, EL0PTEN) )
+        return 0;
+
     now = NOW() - v->domain->arch.phys_timer_base.offset;
 
     if ( read )
@@ -168,6 +184,7 @@ static void vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
                       v->domain->arch.phys_timer_base.offset);
         }
     }
+    return 1;
 }
 
 static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read)
@@ -178,6 +195,8 @@ static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read)
 
     if ( read )
     {
+        if ( !ACCESS_ALLOWED(regs, EL0PCTEN) )
+            return 0;
         now = NOW() - v->domain->arch.phys_timer_base.offset;
         ticks = ns_to_ticks(now);
         *r = ticks;
@@ -199,12 +218,10 @@ static int vtimer_emulate_cp32(struct cpu_user_regs *regs, union hsr hsr)
     switch ( hsr.bits & HSR_CP32_REGS_MASK )
     {
     case HSR_CPREG32(CNTP_CTL):
-        vtimer_cntp_ctl(regs, r, cp32.read);
-        return 1;
+        return vtimer_cntp_ctl(regs, r, cp32.read);
 
     case HSR_CPREG32(CNTP_TVAL):
-        vtimer_cntp_tval(regs, r, cp32.read);
-        return 1;
+        return vtimer_cntp_tval(regs, r, cp32.read);
 
     default:
         return 0;
@@ -221,7 +238,7 @@ static int vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
     {
     case HSR_CPREG64(CNTPCT):
-        if (!vtimer_cntpct(regs, &x, cp64.read))
+        if ( !vtimer_cntpct(regs, &x, cp64.read) )
             return 0;
 
         if ( cp64.read )
@@ -246,12 +263,14 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
     switch ( hsr.bits & HSR_SYSREG_REGS_MASK )
     {
     case HSR_SYSREG_CNTP_CTL_EL0:
-        vtimer_cntp_ctl(regs, &r, sysreg.read);
+        if ( !vtimer_cntp_ctl(regs, &r, sysreg.read) )
+            return 0;
         if ( sysreg.read )
             *x = r;
         return 1;
     case HSR_SYSREG_CNTP_TVAL_EL0:
-        vtimer_cntp_tval(regs, &r, sysreg.read);
+        if ( !vtimer_cntp_tval(regs, &r, sysreg.read) )
+            return 0;
         if ( sysreg.read )
             *x = r;
         return 1;
@@ -271,17 +290,11 @@ int vtimer_emulate(struct cpu_user_regs *regs, union hsr hsr)
 
     switch (hsr.ec) {
     case HSR_EC_CP15_32:
-        if ( !is_32bit_domain(current->domain) )
-            return 0;
         return vtimer_emulate_cp32(regs, hsr);
     case HSR_EC_CP15_64:
-        if ( !is_32bit_domain(current->domain) )
-            return 0;
         return vtimer_emulate_cp64(regs, hsr);
 #ifdef CONFIG_ARM_64
     case HSR_EC_SYSREG:
-        if ( is_32bit_domain(current->domain) )
-            return 0;
         return vtimer_emulate_sysreg(regs, hsr);
 #endif
     default:
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index fcd26fb..b7e88a6 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -558,6 +558,12 @@ union hsr {
 #define CNTHCTL_PA      (1u<<0)  /* Kernel/user access to physical counter */
 #define CNTHCTL_TA      (1u<<1)  /* Kernel/user access to CNTP timer */
 
+/* Time counter kernel control register */
+#define CNTKCTL_EL1_EL0PCTEN (1u<<0) /* Expose phys counters to EL0 */
+#define CNTKCTL_EL1_EL0VCTEN (1u<<1) /* Expose virt counters to EL0 */
+#define CNTKCTL_EL1_EL0VTEN  (1u<<8) /* Expose virt timer registers to EL0 */
+#define CNTKCTL_EL1_EL0PTEN  (1u<<9) /* Expose phys timer registers to EL0 */
+
 /* Timer control registers */
 #define CNTx_CTL_ENABLE   (1u<<0)  /* Enable timer */
 #define CNTx_CTL_MASK     (1u<<1)  /* Mask IRQ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:23:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhzMk-0004tD-Ic; Fri, 02 Oct 2015 12:23: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 1ZhzMk-0004sw-04
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:10 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	46/0F-01753-D277E065; Fri, 02 Oct 2015 12:23:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1443788587!49721187!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 16761 invoked from network); 2 Oct 2015 12:23:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:23:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMh-0001wW-3G
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMh-0005L9-0u
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:07 +0000
Date: Fri, 02 Oct 2015 12:23:07 +0000
Message-Id: <E1ZhzMh-0005L9-0u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: arm: correctly handle vtimer
	traps from userspace
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b0d3714cb4c2d422775ea63b300de0edfe26f06
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Mar 30 12:12:23 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:00 2015 +0100

    xen: arm: correctly handle vtimer traps from userspace
    
    Previously 32-bit userspace on 32-bit kernel and 64-bit userspace on
    64-bit kernel could access these registers irrespective of whether the
    kernel had configured them to be allowed to. To fix this:
    
     - Userspace access to CNTP_CTL_EL0 and CNTP_TVAL_EL0 should be gated
       on CNTKCTL_EL1.EL0PTEN.
     - Userspace access to CNTPCT_EL0 should be gated on
       CNTKCTL_EL1.EL0PCTEN.
    
    When we do not handle an access we now silently inject an undef even
    in debug mode since the debugging messages are not helpful (we have
    handled the access, by explicitly choosing not to).
    
    The usermode accessibility check is rather repetitive, so a helper
    macro is introduced.
    
    Since HSR_EC_CP15_64 cannot be taken from a guest in AArch64 mode
    except due to a hardware bug switch the associated check to a BUG_ON
    (which will be switched to something more appropriate in a subsequent
    patch)
    
    Fix a coding style issue in HSR_CPREG64(CNTPCT) while touching similar
    code.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    (cherry picked from commit d306211e2131eb2d160522f21f21fceaa9dd054c)
    
    Conflicts:
    	xen/arch/arm/traps.c
---
 xen/arch/arm/traps.c            |   28 ++++++++-----------------
 xen/arch/arm/vtimer.c           |   43 +++++++++++++++++++++++++-------------
 xen/include/asm-arm/processor.h |    6 +++++
 3 files changed, 43 insertions(+), 34 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 4063a80..944e241 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1579,11 +1579,7 @@ static void do_cp15_32(struct cpu_user_regs *regs,
     case HSR_CPREG32(CNTP_CTL):
     case HSR_CPREG32(CNTP_TVAL):
         if ( !vtimer_emulate(regs, hsr) )
-        {
-            dprintk(XENLOG_ERR,
-                    "failed emulation of 32-bit vtimer CP register access\n");
-            domain_crash_synchronous();
-        }
+            goto undef_cp15_32;
         break;
     case HSR_CPREG32(ACTLR):
         if ( cp32.read )
@@ -1626,6 +1622,7 @@ static void do_cp15_32(struct cpu_user_regs *regs,
         gdprintk(XENLOG_ERR, "unhandled 32-bit CP15 access %#x\n",
                  hsr.bits & HSR_CP32_REGS_MASK);
 #endif
+ undef_cp15_32:
         inject_undef_exception(regs, hsr.len);
         return;
     }
@@ -1645,11 +1642,7 @@ static void do_cp15_64(struct cpu_user_regs *regs,
     {
     case HSR_CPREG64(CNTPCT):
         if ( !vtimer_emulate(regs, hsr) )
-        {
-            dprintk(XENLOG_ERR,
-                    "failed emulation of 64-bit vtimer CP register access\n");
-            domain_crash_synchronous();
-        }
+            goto undef_cp15_64;
         break;
     default:
         {
@@ -1663,6 +1656,7 @@ static void do_cp15_64(struct cpu_user_regs *regs,
             gdprintk(XENLOG_ERR, "unhandled 64-bit CP15 access %#x\n",
                      hsr.bits & HSR_CP64_REGS_MASK);
 #endif
+ undef_cp15_64:
             inject_undef_exception(regs, hsr.len);
             return;
         }
@@ -1830,11 +1824,7 @@ static void do_sysreg(struct cpu_user_regs *regs,
     case HSR_SYSREG_CNTP_CTL_EL0:
     case HSR_SYSREG_CNTP_TVAL_EL0:
         if ( !vtimer_emulate(regs, hsr) )
-        {
-            dprintk(XENLOG_ERR,
-                    "failed emulation of 64-bit vtimer sysreg access\n");
-            domain_crash_synchronous();
-        }
+            goto undef_sysreg;
         break;
     case HSR_SYSREG_ICC_SGI1R_EL1:
         if ( !vgic_emulate(regs, hsr) )
@@ -1853,8 +1843,8 @@ static void do_sysreg(struct cpu_user_regs *regs,
     default:
  bad_sysreg:
         {
-            struct hsr_sysreg sysreg = hsr.sysreg;
 #ifndef NDEBUG
+            struct hsr_sysreg sysreg = hsr.sysreg;
 
             gdprintk(XENLOG_ERR,
                      "%s %d, %d, c%d, c%d, %d %s x%d @ 0x%"PRIregister"\n",
@@ -1867,7 +1857,8 @@ static void do_sysreg(struct cpu_user_regs *regs,
             gdprintk(XENLOG_ERR, "unhandled 64-bit sysreg access %#x\n",
                      hsr.bits & HSR_SYSREG_REGS_MASK);
 #endif
-            inject_undef_exception(regs, sysreg.len);
+ undef_sysreg:
+            inject_undef_exception(regs, hsr.sysreg.len);
             return;
         }
     }
@@ -2040,8 +2031,7 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
         do_cp15_32(regs, hsr);
         break;
     case HSR_EC_CP15_64:
-        if ( !is_32bit_domain(current->domain) )
-            goto bad_trap;
+        BUG_ON(!psr_mode_is_32bit(regs->cpsr));
         do_cp15_64(regs, hsr);
         break;
     case HSR_EC_CP14_32:
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 2e95ceb..592cfab 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -30,6 +30,14 @@
 extern s_time_t ticks_to_ns(uint64_t ticks);
 extern uint64_t ns_to_ticks(s_time_t ns);
 
+/*
+ * Check if regs is allowed access, user_gate is tail end of a
+ * CNTKCTL_EL1_ bit name which gates user access
+ */
+#define ACCESS_ALLOWED(regs, user_gate) \
+    ( !psr_mode_is_user(regs) || \
+      (READ_SYSREG(CNTKCTL_EL1) & CNTKCTL_EL1_##user_gate) )
+
 static void phys_timer_expired(void *data)
 {
     struct vtimer *t = data;
@@ -122,9 +130,13 @@ int virt_timer_restore(struct vcpu *v)
     return 0;
 }
 
-static void vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read)
+static int vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read)
 {
     struct vcpu *v = current;
+
+    if ( !ACCESS_ALLOWED(regs, EL0PTEN) )
+        return 0;
+
     if ( read )
     {
         *r = v->arch.phys_timer.ctl;
@@ -144,13 +156,17 @@ static void vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read)
         else
             stop_timer(&v->arch.phys_timer.timer);
     }
+    return 1;
 }
 
-static void vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
+static int vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
 {
     struct vcpu *v = current;
     s_time_t now;
 
+    if ( !ACCESS_ALLOWED(regs, EL0PTEN) )
+        return 0;
+
     now = NOW() - v->domain->arch.phys_timer_base.offset;
 
     if ( read )
@@ -168,6 +184,7 @@ static void vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
                       v->domain->arch.phys_timer_base.offset);
         }
     }
+    return 1;
 }
 
 static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read)
@@ -178,6 +195,8 @@ static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read)
 
     if ( read )
     {
+        if ( !ACCESS_ALLOWED(regs, EL0PCTEN) )
+            return 0;
         now = NOW() - v->domain->arch.phys_timer_base.offset;
         ticks = ns_to_ticks(now);
         *r = ticks;
@@ -199,12 +218,10 @@ static int vtimer_emulate_cp32(struct cpu_user_regs *regs, union hsr hsr)
     switch ( hsr.bits & HSR_CP32_REGS_MASK )
     {
     case HSR_CPREG32(CNTP_CTL):
-        vtimer_cntp_ctl(regs, r, cp32.read);
-        return 1;
+        return vtimer_cntp_ctl(regs, r, cp32.read);
 
     case HSR_CPREG32(CNTP_TVAL):
-        vtimer_cntp_tval(regs, r, cp32.read);
-        return 1;
+        return vtimer_cntp_tval(regs, r, cp32.read);
 
     default:
         return 0;
@@ -221,7 +238,7 @@ static int vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
     {
     case HSR_CPREG64(CNTPCT):
-        if (!vtimer_cntpct(regs, &x, cp64.read))
+        if ( !vtimer_cntpct(regs, &x, cp64.read) )
             return 0;
 
         if ( cp64.read )
@@ -246,12 +263,14 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
     switch ( hsr.bits & HSR_SYSREG_REGS_MASK )
     {
     case HSR_SYSREG_CNTP_CTL_EL0:
-        vtimer_cntp_ctl(regs, &r, sysreg.read);
+        if ( !vtimer_cntp_ctl(regs, &r, sysreg.read) )
+            return 0;
         if ( sysreg.read )
             *x = r;
         return 1;
     case HSR_SYSREG_CNTP_TVAL_EL0:
-        vtimer_cntp_tval(regs, &r, sysreg.read);
+        if ( !vtimer_cntp_tval(regs, &r, sysreg.read) )
+            return 0;
         if ( sysreg.read )
             *x = r;
         return 1;
@@ -271,17 +290,11 @@ int vtimer_emulate(struct cpu_user_regs *regs, union hsr hsr)
 
     switch (hsr.ec) {
     case HSR_EC_CP15_32:
-        if ( !is_32bit_domain(current->domain) )
-            return 0;
         return vtimer_emulate_cp32(regs, hsr);
     case HSR_EC_CP15_64:
-        if ( !is_32bit_domain(current->domain) )
-            return 0;
         return vtimer_emulate_cp64(regs, hsr);
 #ifdef CONFIG_ARM_64
     case HSR_EC_SYSREG:
-        if ( is_32bit_domain(current->domain) )
-            return 0;
         return vtimer_emulate_sysreg(regs, hsr);
 #endif
     default:
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index fcd26fb..b7e88a6 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -558,6 +558,12 @@ union hsr {
 #define CNTHCTL_PA      (1u<<0)  /* Kernel/user access to physical counter */
 #define CNTHCTL_TA      (1u<<1)  /* Kernel/user access to CNTP timer */
 
+/* Time counter kernel control register */
+#define CNTKCTL_EL1_EL0PCTEN (1u<<0) /* Expose phys counters to EL0 */
+#define CNTKCTL_EL1_EL0VCTEN (1u<<1) /* Expose virt counters to EL0 */
+#define CNTKCTL_EL1_EL0VTEN  (1u<<8) /* Expose virt timer registers to EL0 */
+#define CNTKCTL_EL1_EL0PTEN  (1u<<9) /* Expose phys timer registers to EL0 */
+
 /* Timer control registers */
 #define CNTx_CTL_ENABLE   (1u<<0)  /* Enable timer */
 #define CNTx_CTL_MASK     (1u<<1)  /* Mask IRQ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:23:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhzMu-0004v8-NC; Fri, 02 Oct 2015 12:23:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMt-0004uy-Vv
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:20 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	C0/5B-29649-7377E065; Fri, 02 Oct 2015 12:23:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1443788597!15104488!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 2588 invoked from network); 2 Oct 2015 12:23:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:23:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMr-0001we-DH
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMr-0005MK-AG
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:17 +0000
Date: Fri, 02 Oct 2015 12:23:17 +0000
Message-Id: <E1ZhzMr-0005MK-AG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: arm: handle accesses to
	CNTP_CVAL_EL0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 12cc60d994fd1a6a95766015b587ec252ee2bc9c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Mar 30 12:12:24 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:07 2015 +0100

    xen: arm: handle accesses to CNTP_CVAL_EL0
    
    All OSes we have run on top of Xen use CNTP_TVAL_EL0 but for
    completeness we really should handle CVAL too.
    
    In vtimer_emulate_cp64 pull the propagation of the 64-bit result into
    two 32-bit registers out of the switch to avoid duplicating for every
    register. We also need to initialise x now since previously the only
    register implemented register was R/O.
    
    While adding HSR_SYSREG_CNTP_CVAL_EL0 also move
    HSR_SYSREG_CNTP_CTL_EL0 so it is sorted correctly.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    (cherry picked from commit 9cfa8ebe2e82d38c2e0c32fa23ea920a43e414ca)
---
 xen/arch/arm/traps.c          |    2 +
 xen/arch/arm/vtimer.c         |   48 +++++++++++++++++++++++++++++++++++------
 xen/include/asm-arm/sysregs.h |    3 +-
 3 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 944e241..6425255 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1641,6 +1641,7 @@ static void do_cp15_64(struct cpu_user_regs *regs,
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
     {
     case HSR_CPREG64(CNTPCT):
+    case HSR_CPREG64(CNTP_CVAL):
         if ( !vtimer_emulate(regs, hsr) )
             goto undef_cp15_64;
         break;
@@ -1823,6 +1824,7 @@ static void do_sysreg(struct cpu_user_regs *regs,
         break;
     case HSR_SYSREG_CNTP_CTL_EL0:
     case HSR_SYSREG_CNTP_TVAL_EL0:
+    case HSR_SYSREG_CNTP_CVAL_EL0:
         if ( !vtimer_emulate(regs, hsr) )
             goto undef_sysreg;
         break;
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 592cfab..8a24bc6 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -187,6 +187,30 @@ static int vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
     return 1;
 }
 
+static int vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r, int read)
+{
+    struct vcpu *v = current;
+
+    if ( !ACCESS_ALLOWED(regs, EL0PTEN) )
+        return 0;
+
+    if ( read )
+    {
+        *r = ns_to_ticks(v->arch.phys_timer.cval);
+    }
+    else
+    {
+        v->arch.phys_timer.cval = ticks_to_ns(*r);
+        if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
+        {
+            v->arch.phys_timer.ctl &= ~CNTx_CTL_PENDING;
+            set_timer(&v->arch.phys_timer.timer,
+                      v->arch.phys_timer.cval +
+                      v->domain->arch.phys_timer_base.offset);
+        }
+    }
+    return 1;
+}
 static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read)
 {
     struct vcpu *v = current;
@@ -233,24 +257,31 @@ static int vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
     struct hsr_cp64 cp64 = hsr.cp64;
     uint32_t *r1 = (uint32_t *)select_user_reg(regs, cp64.reg1);
     uint32_t *r2 = (uint32_t *)select_user_reg(regs, cp64.reg2);
-    uint64_t x;
+    uint64_t x = (uint64_t)(*r1) | ((uint64_t)(*r2) << 32);
 
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
     {
     case HSR_CPREG64(CNTPCT):
         if ( !vtimer_cntpct(regs, &x, cp64.read) )
             return 0;
+        break;
 
-        if ( cp64.read )
-        {
-            *r1 = (uint32_t)(x & 0xffffffff);
-            *r2 = (uint32_t)(x >> 32);
-        }
-        return 1;
+    case HSR_CPREG64(CNTP_CVAL):
+        if ( !vtimer_cntp_cval(regs, &x, cp64.read) )
+            return 0;
+        break;
 
     default:
         return 0;
     }
+
+    if ( cp64.read )
+    {
+        *r1 = (uint32_t)(x & 0xffffffff);
+        *r2 = (uint32_t)(x >> 32);
+    }
+
+    return 1;
 }
 
 #ifdef CONFIG_ARM_64
@@ -275,6 +306,9 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
             *x = r;
         return 1;
 
+    case HSR_SYSREG_CNTP_CVAL_EL0:
+        return vtimer_cntp_cval(regs, x, sysreg.read);
+
     case HSR_SYSREG_CNTPCT_EL0:
         return vtimer_cntpct(regs, x, sysreg.read);
 
diff --git a/xen/include/asm-arm/sysregs.h b/xen/include/asm-arm/sysregs.h
index 169b7ac..df8e070 100644
--- a/xen/include/asm-arm/sysregs.h
+++ b/xen/include/asm-arm/sysregs.h
@@ -100,8 +100,9 @@
 #define HSR_SYSREG_PMOVSSET_EL0   HSR_SYSREG(3,3,c9,c14,3)
 
 #define HSR_SYSREG_CNTPCT_EL0     HSR_SYSREG(3,3,c14,c0,0)
-#define HSR_SYSREG_CNTP_CTL_EL0   HSR_SYSREG(3,3,c14,c2,1)
 #define HSR_SYSREG_CNTP_TVAL_EL0  HSR_SYSREG(3,3,c14,c2,0)
+#define HSR_SYSREG_CNTP_CTL_EL0   HSR_SYSREG(3,3,c14,c2,1)
+#define HSR_SYSREG_CNTP_CVAL_EL0  HSR_SYSREG(3,3,c14,c2,2)
 
 /*
  * GIC System register assembly aliases picked from kernel
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:23:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhzMu-0004v8-NC; Fri, 02 Oct 2015 12:23:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMt-0004uy-Vv
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:20 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	C0/5B-29649-7377E065; Fri, 02 Oct 2015 12:23:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1443788597!15104488!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 2588 invoked from network); 2 Oct 2015 12:23:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2015 12:23:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMr-0001we-DH
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzMr-0005MK-AG
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:17 +0000
Date: Fri, 02 Oct 2015 12:23:17 +0000
Message-Id: <E1ZhzMr-0005MK-AG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: arm: handle accesses to
	CNTP_CVAL_EL0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 12cc60d994fd1a6a95766015b587ec252ee2bc9c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Mar 30 12:12:24 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:07 2015 +0100

    xen: arm: handle accesses to CNTP_CVAL_EL0
    
    All OSes we have run on top of Xen use CNTP_TVAL_EL0 but for
    completeness we really should handle CVAL too.
    
    In vtimer_emulate_cp64 pull the propagation of the 64-bit result into
    two 32-bit registers out of the switch to avoid duplicating for every
    register. We also need to initialise x now since previously the only
    register implemented register was R/O.
    
    While adding HSR_SYSREG_CNTP_CVAL_EL0 also move
    HSR_SYSREG_CNTP_CTL_EL0 so it is sorted correctly.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    (cherry picked from commit 9cfa8ebe2e82d38c2e0c32fa23ea920a43e414ca)
---
 xen/arch/arm/traps.c          |    2 +
 xen/arch/arm/vtimer.c         |   48 +++++++++++++++++++++++++++++++++++------
 xen/include/asm-arm/sysregs.h |    3 +-
 3 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 944e241..6425255 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1641,6 +1641,7 @@ static void do_cp15_64(struct cpu_user_regs *regs,
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
     {
     case HSR_CPREG64(CNTPCT):
+    case HSR_CPREG64(CNTP_CVAL):
         if ( !vtimer_emulate(regs, hsr) )
             goto undef_cp15_64;
         break;
@@ -1823,6 +1824,7 @@ static void do_sysreg(struct cpu_user_regs *regs,
         break;
     case HSR_SYSREG_CNTP_CTL_EL0:
     case HSR_SYSREG_CNTP_TVAL_EL0:
+    case HSR_SYSREG_CNTP_CVAL_EL0:
         if ( !vtimer_emulate(regs, hsr) )
             goto undef_sysreg;
         break;
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 592cfab..8a24bc6 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -187,6 +187,30 @@ static int vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
     return 1;
 }
 
+static int vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r, int read)
+{
+    struct vcpu *v = current;
+
+    if ( !ACCESS_ALLOWED(regs, EL0PTEN) )
+        return 0;
+
+    if ( read )
+    {
+        *r = ns_to_ticks(v->arch.phys_timer.cval);
+    }
+    else
+    {
+        v->arch.phys_timer.cval = ticks_to_ns(*r);
+        if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
+        {
+            v->arch.phys_timer.ctl &= ~CNTx_CTL_PENDING;
+            set_timer(&v->arch.phys_timer.timer,
+                      v->arch.phys_timer.cval +
+                      v->domain->arch.phys_timer_base.offset);
+        }
+    }
+    return 1;
+}
 static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read)
 {
     struct vcpu *v = current;
@@ -233,24 +257,31 @@ static int vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
     struct hsr_cp64 cp64 = hsr.cp64;
     uint32_t *r1 = (uint32_t *)select_user_reg(regs, cp64.reg1);
     uint32_t *r2 = (uint32_t *)select_user_reg(regs, cp64.reg2);
-    uint64_t x;
+    uint64_t x = (uint64_t)(*r1) | ((uint64_t)(*r2) << 32);
 
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
     {
     case HSR_CPREG64(CNTPCT):
         if ( !vtimer_cntpct(regs, &x, cp64.read) )
             return 0;
+        break;
 
-        if ( cp64.read )
-        {
-            *r1 = (uint32_t)(x & 0xffffffff);
-            *r2 = (uint32_t)(x >> 32);
-        }
-        return 1;
+    case HSR_CPREG64(CNTP_CVAL):
+        if ( !vtimer_cntp_cval(regs, &x, cp64.read) )
+            return 0;
+        break;
 
     default:
         return 0;
     }
+
+    if ( cp64.read )
+    {
+        *r1 = (uint32_t)(x & 0xffffffff);
+        *r2 = (uint32_t)(x >> 32);
+    }
+
+    return 1;
 }
 
 #ifdef CONFIG_ARM_64
@@ -275,6 +306,9 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
             *x = r;
         return 1;
 
+    case HSR_SYSREG_CNTP_CVAL_EL0:
+        return vtimer_cntp_cval(regs, x, sysreg.read);
+
     case HSR_SYSREG_CNTPCT_EL0:
         return vtimer_cntpct(regs, x, sysreg.read);
 
diff --git a/xen/include/asm-arm/sysregs.h b/xen/include/asm-arm/sysregs.h
index 169b7ac..df8e070 100644
--- a/xen/include/asm-arm/sysregs.h
+++ b/xen/include/asm-arm/sysregs.h
@@ -100,8 +100,9 @@
 #define HSR_SYSREG_PMOVSSET_EL0   HSR_SYSREG(3,3,c9,c14,3)
 
 #define HSR_SYSREG_CNTPCT_EL0     HSR_SYSREG(3,3,c14,c0,0)
-#define HSR_SYSREG_CNTP_CTL_EL0   HSR_SYSREG(3,3,c14,c2,1)
 #define HSR_SYSREG_CNTP_TVAL_EL0  HSR_SYSREG(3,3,c14,c2,0)
+#define HSR_SYSREG_CNTP_CTL_EL0   HSR_SYSREG(3,3,c14,c2,1)
+#define HSR_SYSREG_CNTP_CVAL_EL0  HSR_SYSREG(3,3,c14,c2,2)
 
 /*
  * GIC System register assembly aliases picked from kernel
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:23:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhzN4-0004wj-Pu; Fri, 02 Oct 2015 12:23:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzN4-0004wb-5Z
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:30 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	63/93-03819-1477E065; Fri, 02 Oct 2015 12:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1443788608!39444577!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27169 invoked from network); 2 Oct 2015 12:23:28 -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;
	2 Oct 2015 12:23:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzN1-0001wm-TC
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzN1-0005Ml-L8
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:27 +0000
Date: Fri, 02 Oct 2015 12:23:27 +0000
Message-Id: <E1ZhzN1-0005Ml-L8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: arm: always omit guest user
	stack in vcpu_show_execution_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 c562986357d04c49aaa8c678f27b0a70294dffef
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Mar 30 12:12:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:08 2015 +0100

    xen: arm: always omit guest user stack in vcpu_show_execution_state
    
    Using !usr_mode(regs) only catches arm32 usr mode and not arm64 user
    mode, switch to psr_mode_is_user instead.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    (cherry picked from commit ceb7d6b66de21810a837389911eb2f40c1ca6222)
---
 xen/arch/arm/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 6425255..2a8a442 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1031,7 +1031,7 @@ void vcpu_show_execution_state(struct vcpu *v)
     vcpu_pause(v); /* acceptably dangerous */
 
     vcpu_show_registers(v);
-    if ( !usr_mode(&v->arch.cpu_info->guest_cpu_user_regs) )
+    if ( !psr_mode_is_user(&v->arch.cpu_info->guest_cpu_user_regs) )
         show_guest_stack(v, &v->arch.cpu_info->guest_cpu_user_regs);
 
     vcpu_unpause(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 Fri Oct 02 12:23:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZhzN4-0004wj-Pu; Fri, 02 Oct 2015 12:23:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzN4-0004wb-5Z
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:30 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	63/93-03819-1477E065; Fri, 02 Oct 2015 12:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1443788608!39444577!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27169 invoked from network); 2 Oct 2015 12:23:28 -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;
	2 Oct 2015 12:23:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzN1-0001wm-TC
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzN1-0005Ml-L8
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:27 +0000
Date: Fri, 02 Oct 2015 12:23:27 +0000
Message-Id: <E1ZhzN1-0005Ml-L8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: arm: always omit guest user
	stack in vcpu_show_execution_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 c562986357d04c49aaa8c678f27b0a70294dffef
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Mar 30 12:12:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:08 2015 +0100

    xen: arm: always omit guest user stack in vcpu_show_execution_state
    
    Using !usr_mode(regs) only catches arm32 usr mode and not arm64 user
    mode, switch to psr_mode_is_user instead.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    (cherry picked from commit ceb7d6b66de21810a837389911eb2f40c1ca6222)
---
 xen/arch/arm/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 6425255..2a8a442 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1031,7 +1031,7 @@ void vcpu_show_execution_state(struct vcpu *v)
     vcpu_pause(v); /* acceptably dangerous */
 
     vcpu_show_registers(v);
-    if ( !usr_mode(&v->arch.cpu_info->guest_cpu_user_regs) )
+    if ( !psr_mode_is_user(&v->arch.cpu_info->guest_cpu_user_regs) )
         show_guest_stack(v, &v->arch.cpu_info->guest_cpu_user_regs);
 
     vcpu_unpause(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 Fri Oct 02 12:23:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23: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 1ZhzNF-0004ya-Se; Fri, 02 Oct 2015 12:23: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 1ZhzNE-0004yM-Kh
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:40 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	1B/F8-15765-C477E065; Fri, 02 Oct 2015 12:23:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1443788618!28532462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16359 invoked from network); 2 Oct 2015 12:23:39 -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;
	2 Oct 2015 12:23:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNC-0001wu-6n
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNC-0005NA-4L
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:38 +0000
Date: Fri, 02 Oct 2015 12:23:38 +0000
Message-Id: <E1ZhzNC-0005NA-4L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: arm: bootfdt: Avoid reading
	off the front of *_cells array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f72ab694c5a6143aac965e912351ae6350dd1089
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jul 16 09:50:07 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:08 2015 +0100

    xen: arm: bootfdt: Avoid reading off the front of *_cells array
    
    In device_tree_for_each_node the call to the callback was using
    {address,size}_cells[depth - 1], which at depth 0 could read off the
    front of the array.
    
    We already handled this correctly in the rest of the loop so fixup
    this instance as well.
    
    Reported-by: Chris (Christopher) Brand <chris.brand@broadcom.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Chris (Christopher) Brand <chris.brand@broadcom.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    (cherry picked from commit 989f3939bd16a0e1669c179b6c5c264812a25fc2)
---
 xen/arch/arm/bootfdt.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index e100233..74d208b 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -100,6 +100,7 @@ static int __init device_tree_for_each_node(const void *fdt,
           node = fdt_next_node(fdt, node, &depth) )
     {
         const char *name = fdt_get_name(fdt, node, NULL);
+        u32 as, ss;
 
         if ( depth >= DEVICE_TREE_MAX_DEPTH )
         {
@@ -108,14 +109,15 @@ static int __init device_tree_for_each_node(const void *fdt,
             continue;
         }
 
-        address_cells[depth] = device_tree_get_u32(fdt, node, "#address-cells",
-                                depth > 0 ? address_cells[depth-1] : 0);
-        size_cells[depth] = device_tree_get_u32(fdt, node, "#size-cells",
-                                depth > 0 ? size_cells[depth-1] : 0);
+        as = depth > 0 ? address_cells[depth-1] : 0;
+        ss = depth > 0 ? size_cells[depth-1] : 0;
 
+        address_cells[depth] = device_tree_get_u32(fdt, node,
+                                                   "#address-cells", as);
+        size_cells[depth] = device_tree_get_u32(fdt, node,
+                                                "#size-cells", ss);
 
-        ret = func(fdt, node, name, depth,
-                   address_cells[depth-1], size_cells[depth-1], data);
+        ret = func(fdt, node, name, depth, as, ss, data);
         if ( ret != 0 )
             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 Fri Oct 02 12:23:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23: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 1ZhzNF-0004ya-Se; Fri, 02 Oct 2015 12:23: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 1ZhzNE-0004yM-Kh
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:40 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	1B/F8-15765-C477E065; Fri, 02 Oct 2015 12:23:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1443788618!28532462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16359 invoked from network); 2 Oct 2015 12:23:39 -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;
	2 Oct 2015 12:23:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNC-0001wu-6n
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNC-0005NA-4L
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:38 +0000
Date: Fri, 02 Oct 2015 12:23:38 +0000
Message-Id: <E1ZhzNC-0005NA-4L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen: arm: bootfdt: Avoid reading
	off the front of *_cells array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f72ab694c5a6143aac965e912351ae6350dd1089
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jul 16 09:50:07 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:08 2015 +0100

    xen: arm: bootfdt: Avoid reading off the front of *_cells array
    
    In device_tree_for_each_node the call to the callback was using
    {address,size}_cells[depth - 1], which at depth 0 could read off the
    front of the array.
    
    We already handled this correctly in the rest of the loop so fixup
    this instance as well.
    
    Reported-by: Chris (Christopher) Brand <chris.brand@broadcom.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Chris (Christopher) Brand <chris.brand@broadcom.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    (cherry picked from commit 989f3939bd16a0e1669c179b6c5c264812a25fc2)
---
 xen/arch/arm/bootfdt.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index e100233..74d208b 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -100,6 +100,7 @@ static int __init device_tree_for_each_node(const void *fdt,
           node = fdt_next_node(fdt, node, &depth) )
     {
         const char *name = fdt_get_name(fdt, node, NULL);
+        u32 as, ss;
 
         if ( depth >= DEVICE_TREE_MAX_DEPTH )
         {
@@ -108,14 +109,15 @@ static int __init device_tree_for_each_node(const void *fdt,
             continue;
         }
 
-        address_cells[depth] = device_tree_get_u32(fdt, node, "#address-cells",
-                                depth > 0 ? address_cells[depth-1] : 0);
-        size_cells[depth] = device_tree_get_u32(fdt, node, "#size-cells",
-                                depth > 0 ? size_cells[depth-1] : 0);
+        as = depth > 0 ? address_cells[depth-1] : 0;
+        ss = depth > 0 ? size_cells[depth-1] : 0;
 
+        address_cells[depth] = device_tree_get_u32(fdt, node,
+                                                   "#address-cells", as);
+        size_cells[depth] = device_tree_get_u32(fdt, node,
+                                                "#size-cells", ss);
 
-        ret = func(fdt, node, name, depth,
-                   address_cells[depth-1], size_cells[depth-1], data);
+        ret = func(fdt, node, name, depth, as, ss, data);
         if ( ret != 0 )
             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 Fri Oct 02 12:23:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23: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 1ZhzNP-00050S-VD; Fri, 02 Oct 2015 12:23:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNO-000508-Mq
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:50 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	B9/8B-24856-5577E065; Fri, 02 Oct 2015 12:23:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1443788628!23738085!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19525 invoked from network); 2 Oct 2015 12:23:49 -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;
	2 Oct 2015 12:23:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNM-0001x2-Gx
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNM-0005NW-Ep
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:48 +0000
Date: Fri, 02 Oct 2015 12:23:48 +0000
Message-Id: <E1ZhzNM-0005NW-Ep@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/arm: vgic: Correctly emulate
	write when byte is used
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b147f96ae69cadafc853a544a7526b1740b053c
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 22 21:18:48 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:08 2015 +0100

    xen/arm: vgic: Correctly emulate write when byte is used
    
    When a guest is writing a byte, the value will be located in bits[7:0]
    of the register.
    
    Although the current implementation is expecting the byte at the Nth
    byte of the register where N = address & 4;
    
    When the address is not 4-byte aligned, the corresponding byte in the
    internal state will always be set to zero rather.
    
    Note that byte access are only used for GICD_IPRIORITYR and
    GICD_ITARGETSR. So the worst things that could happen is not setting the
    priority correctly and ignore the target vCPU written.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 3f214fea76acc6cbc1101fe1815cee795483a67d)
---
 xen/include/asm-arm/vgic.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 74d5a4e..cbe035e 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -161,10 +161,10 @@ static inline void vgic_byte_write(uint32_t *reg, uint32_t var, int offset)
 {
     int byte = offset & 0x3;
 
-    var &= (0xff << (8*byte));
+    var &= 0xff;
 
     *reg &= ~(0xff << (8*byte));
-    *reg |= var;
+    *reg |= (var << (8*byte));
 }
 
 enum gic_sgi_mode;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:23:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:23: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 1ZhzNP-00050S-VD; Fri, 02 Oct 2015 12:23:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNO-000508-Mq
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:50 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	B9/8B-24856-5577E065; Fri, 02 Oct 2015 12:23:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1443788628!23738085!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19525 invoked from network); 2 Oct 2015 12:23:49 -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;
	2 Oct 2015 12:23:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNM-0001x2-Gx
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNM-0005NW-Ep
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:48 +0000
Date: Fri, 02 Oct 2015 12:23:48 +0000
Message-Id: <E1ZhzNM-0005NW-Ep@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/arm: vgic: Correctly emulate
	write when byte is used
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b147f96ae69cadafc853a544a7526b1740b053c
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 22 21:18:48 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 13:37:08 2015 +0100

    xen/arm: vgic: Correctly emulate write when byte is used
    
    When a guest is writing a byte, the value will be located in bits[7:0]
    of the register.
    
    Although the current implementation is expecting the byte at the Nth
    byte of the register where N = address & 4;
    
    When the address is not 4-byte aligned, the corresponding byte in the
    internal state will always be set to zero rather.
    
    Note that byte access are only used for GICD_IPRIORITYR and
    GICD_ITARGETSR. So the worst things that could happen is not setting the
    priority correctly and ignore the target vCPU written.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 3f214fea76acc6cbc1101fe1815cee795483a67d)
---
 xen/include/asm-arm/vgic.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 74d5a4e..cbe035e 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -161,10 +161,10 @@ static inline void vgic_byte_write(uint32_t *reg, uint32_t var, int offset)
 {
     int byte = offset & 0x3;
 
-    var &= (0xff << (8*byte));
+    var &= 0xff;
 
     *reg &= ~(0xff << (8*byte));
-    *reg |= var;
+    *reg |= (var << (8*byte));
 }
 
 enum gic_sgi_mode;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 02 12:24:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:24: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 1ZhzNa-00052A-1t; Fri, 02 Oct 2015 12:24: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 1ZhzNZ-000522-D9
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:24:01 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	BB/C4-25435-0677E065; Fri, 02 Oct 2015 12:24:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1443788639!55105848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22280 invoked from network); 2 Oct 2015 12:23:59 -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;
	2 Oct 2015 12:23:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNW-0001xB-Ss
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNW-0005Ns-QC
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:58 +0000
Date: Fri, 02 Oct 2015 12:23:58 +0000
Message-Id: <E1ZhzNW-0005Ns-QC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/arm: vgic-v2: Map the GIC
	virtual CPU interface with the correct size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0297baf5b5b6724e006e761249694444204dacfb
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Sep 25 14:10:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 14:36:32 2015 +0100

    xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
    
    On GICv2, the GIC virtual CPU interface is at minimum 8KB. Due some to
    some necessary quirk for GIC using 64KB stride, we are mapping the
    region in 2 time.
    The first mapping is 4KB and the second one is 8KB, i.e 12KB in total.
    Although the minimum supported size (and widely used) is 8KB. This means
    that we are mapping 4KB more to any guest using GICv2.
    
    While this looks scary at first glance, the GIC virtual CPU interface is
    most frequently at the end the GIC I/O region. So we will most likely
    map an an unused I/O region or a mirrored version of GICV for platform
    using 64KB stride.
    
    Nonetheless, fix the second mapping to only map 4KB.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (Backported from 493a67ee4a3fd9420e94fa2cf108e2a27961202b)
---
 xen/arch/arm/gic-v2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 31fb81a..ac64f7f 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -446,10 +446,10 @@ static int gicv2v_setup(struct domain *d)
 
     if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
         ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
-                               2, paddr_to_pfn(gicv2.vbase + PAGE_SIZE));
+                               1, paddr_to_pfn(gicv2.vbase + PAGE_SIZE));
     else
         ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
-                               2, paddr_to_pfn(gicv2.vbase + 16*PAGE_SIZE));
+                               1, paddr_to_pfn(gicv2.vbase + 16*PAGE_SIZE));
 
     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 Fri Oct 02 12:24:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2015 12:24: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 1ZhzNa-00052A-1t; Fri, 02 Oct 2015 12:24: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 1ZhzNZ-000522-D9
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:24:01 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	BB/C4-25435-0677E065; Fri, 02 Oct 2015 12:24:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1443788639!55105848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22280 invoked from network); 2 Oct 2015 12:23:59 -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;
	2 Oct 2015 12:23:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNW-0001xB-Ss
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZhzNW-0005Ns-QC
	for xen-changelog@lists.xensource.com; Fri, 02 Oct 2015 12:23:58 +0000
Date: Fri, 02 Oct 2015 12:23:58 +0000
Message-Id: <E1ZhzNW-0005Ns-QC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/arm: vgic-v2: Map the GIC
	virtual CPU interface with the correct size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0297baf5b5b6724e006e761249694444204dacfb
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Sep 25 14:10:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Sep 25 14:36:32 2015 +0100

    xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
    
    On GICv2, the GIC virtual CPU interface is at minimum 8KB. Due some to
    some necessary quirk for GIC using 64KB stride, we are mapping the
    region in 2 time.
    The first mapping is 4KB and the second one is 8KB, i.e 12KB in total.
    Although the minimum supported size (and widely used) is 8KB. This means
    that we are mapping 4KB more to any guest using GICv2.
    
    While this looks scary at first glance, the GIC virtual CPU interface is
    most frequently at the end the GIC I/O region. So we will most likely
    map an an unused I/O region or a mirrored version of GICV for platform
    using 64KB stride.
    
    Nonetheless, fix the second mapping to only map 4KB.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (Backported from 493a67ee4a3fd9420e94fa2cf108e2a27961202b)
---
 xen/arch/arm/gic-v2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 31fb81a..ac64f7f 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -446,10 +446,10 @@ static int gicv2v_setup(struct domain *d)
 
     if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
         ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
-                               2, paddr_to_pfn(gicv2.vbase + PAGE_SIZE));
+                               1, paddr_to_pfn(gicv2.vbase + PAGE_SIZE));
     else
         ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
-                               2, paddr_to_pfn(gicv2.vbase + 16*PAGE_SIZE));
+                               1, paddr_to_pfn(gicv2.vbase + 16*PAGE_SIZE));
 
     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 Sat Oct 03 20:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20: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 1ZiTJr-0005Fb-2j; Sat, 03 Oct 2015 20:22:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJo-0005FW-UC
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:09 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	B6/1F-03819-0F830165; Sat, 03 Oct 2015 20:22:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1443903726!34388357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3004 invoked from network); 3 Oct 2015 20:22:07 -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;
	3 Oct 2015 20:22:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJm-0003j9-DU
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJk-0000sR-F0
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:04 +0000
Date: Sat, 03 Oct 2015 20:22:04 +0000
Message-Id: <E1ZiTJk-0000sR-F0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: fix path to p2m-ept.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 b3da0f4e9a13e29e4dccfa14cd133d1a8e6ed47d
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Sep 28 17:28:19 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:28:19 2015 +0200

    MAINTAINERS: fix path to p2m-ept.c
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e430ade..f008a8c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -202,7 +202,7 @@ M:	Jun Nakajima <jun.nakajima@intel.com>
 M:	Kevin Tian <kevin.tian@intel.com>
 S:	Supported
 F:	xen/arch/x86/hvm/vmx/
-F:	xen/arch/x86/mm/hap/p2m-ept.c
+F:	xen/arch/x86/mm/p2m-ept.c
 F:	xen/include/asm-x86/hvm/vmx/
 
 IOMMU VENDOR INDEPENDENT CODE
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:22:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20: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 1ZiTJr-0005Fb-2j; Sat, 03 Oct 2015 20:22:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJo-0005FW-UC
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:09 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	B6/1F-03819-0F830165; Sat, 03 Oct 2015 20:22:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1443903726!34388357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3004 invoked from network); 3 Oct 2015 20:22:07 -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;
	3 Oct 2015 20:22:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJm-0003j9-DU
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJk-0000sR-F0
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:04 +0000
Date: Sat, 03 Oct 2015 20:22:04 +0000
Message-Id: <E1ZiTJk-0000sR-F0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: fix path to p2m-ept.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 b3da0f4e9a13e29e4dccfa14cd133d1a8e6ed47d
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Sep 28 17:28:19 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:28:19 2015 +0200

    MAINTAINERS: fix path to p2m-ept.c
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e430ade..f008a8c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -202,7 +202,7 @@ M:	Jun Nakajima <jun.nakajima@intel.com>
 M:	Kevin Tian <kevin.tian@intel.com>
 S:	Supported
 F:	xen/arch/x86/hvm/vmx/
-F:	xen/arch/x86/mm/hap/p2m-ept.c
+F:	xen/arch/x86/mm/p2m-ept.c
 F:	xen/include/asm-x86/hvm/vmx/
 
 IOMMU VENDOR INDEPENDENT CODE
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:22:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZiTK1-0005GC-5F; Sat, 03 Oct 2015 20:22: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 1ZiTK0-0005G2-3h
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:20 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	E0/6F-01753-BF830165; Sat, 03 Oct 2015 20:22:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1443903737!45593122!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29605 invoked from network); 3 Oct 2015 20:22:18 -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;
	3 Oct 2015 20:22:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJw-0003jD-W5
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJw-0000tZ-MN
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:16 +0000
Date: Sat, 03 Oct 2015 20:22:16 +0000
Message-Id: <E1ZiTJw-0000tZ-MN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cleanup domain builder declarations
	and related users
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d3bcd64d9eb741b4d4df45de97e318fcf836c36
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Sep 28 17:28:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:28:35 2015 +0200

    cleanup domain builder declarations and related users
    
    There are several unused function and structure declarations in the
    hypervisor related to domain building. Remove them.
    
    Use an enum for elf_dom_parms.pae instead of just hard coding the
    values when setting the information and adjust the code to use those
    instead of own macros (hypervisor and tools).
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_binloader.c     |    2 +-
 tools/libxc/xc_dom_elfloader.c     |    8 ++++----
 tools/libxc/xc_dom_x86.c           |    6 +++---
 tools/libxc/xg_private.h           |    6 ------
 xen/arch/x86/domain_build.c        |    6 +++---
 xen/common/libelf/libelf-dominfo.c |    8 ++++----
 xen/include/xen/elf.h              |   21 ---------------------
 xen/include/xen/libelf.h           |    9 ++++++++-
 xen/include/xen/sched.h            |   23 -----------------------
 9 files changed, 23 insertions(+), 66 deletions(-)

diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xc_dom_binloader.c
index 740601a..d6f7f2a 100644
--- a/tools/libxc/xc_dom_binloader.c
+++ b/tools/libxc/xc_dom_binloader.c
@@ -238,7 +238,7 @@ static int xc_dom_parse_bin_kernel(struct xc_dom_image *dom)
         {
             DOMPRINTF("%s: PAE fixup", __FUNCTION__);
             dom->guest_type = "xen-3.0-x86_32p";
-            dom->parms.pae  = 2;
+            dom->parms.pae  = XEN_PAE_EXTCR3;
         }
         break;
     }
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 66ea9d6..82524c9 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -61,14 +61,14 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     case EM_386:
         switch ( dom->parms.pae )
         {
-        case 3 /* PAEKERN_bimodal */:
+        case XEN_PAE_BIMODAL:
             if ( strstr(dom->xen_caps, "xen-3.0-x86_32p") )
                 return "xen-3.0-x86_32p";
             return "xen-3.0-x86_32";
-        case PAEKERN_extended_cr3:
-        case PAEKERN_yes:
+        case XEN_PAE_EXTCR3:
+        case XEN_PAE_YES:
             return "xen-3.0-x86_32p";
-        case PAEKERN_no:
+        case XEN_PAE_NO:
         default:
             return "xen-3.0-x86_32";
         }
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 05fb0ce..e2f3792 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -249,7 +249,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
     xen_pfn_t pgpfn;
     xen_pfn_t l3mfn = xc_dom_p2m_guest(dom, l3pfn);
 
-    if ( dom->parms.pae == 1 )
+    if ( dom->parms.pae == XEN_PAE_YES )
     {
         if ( l3mfn >= 0x100000 )
             l3mfn = move_l3_below_4G(dom, l3pfn, l3mfn);
@@ -602,8 +602,8 @@ static int vcpu_x86_32(struct xc_dom_image *dom, void *ptr)
     ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
 
     ctxt->flags = VGCF_in_kernel_X86_32 | VGCF_online_X86_32;
-    if ( dom->parms.pae == 2 /* extended_cr3 */ ||
-         dom->parms.pae == 3 /* bimodal */ )
+    if ( dom->parms.pae == XEN_PAE_EXTCR3 ||
+         dom->parms.pae == XEN_PAE_BIMODAL )
         ctxt->vm_assist |= (1UL << VMASST_TYPE_pae_extended_cr3);
 
     cr3_pfn = xc_dom_p2m_guest(dom, dom->pgtables_seg.pfn);
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index 07eeb67..5544897 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -165,12 +165,6 @@ static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,
 #define MFN_MASK_X86    ((1ULL << (MADDR_BITS_X86 - PAGE_SHIFT_X86)) - 1)
 #define MADDR_MASK_X86  (MFN_MASK_X86 << PAGE_SHIFT_X86)
 
-
-#define PAEKERN_no           0
-#define PAEKERN_yes          1
-#define PAEKERN_extended_cr3 2
-#define PAEKERN_bimodal      3
-
 int pin_table(xc_interface *xch, unsigned int type, unsigned long mfn,
               domid_t dom);
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 18cf6aa..cd27864 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -953,8 +953,8 @@ int __init construct_dom0(
     compat32   = 0;
     machine = elf_uval(&elf, elf.ehdr, e_machine);
     printk(" Xen  kernel: 64-bit, lsb, compat32\n");
-    if (elf_32bit(&elf) && parms.pae == PAEKERN_bimodal)
-        parms.pae = PAEKERN_extended_cr3;
+    if (elf_32bit(&elf) && parms.pae == XEN_PAE_BIMODAL)
+        parms.pae = XEN_PAE_EXTCR3;
     if (elf_32bit(&elf) && parms.pae && machine == EM_386)
     {
         compat32 = 1;
@@ -1005,7 +1005,7 @@ int __init construct_dom0(
 
     nr_pages = compute_dom0_nr_pages(d, &parms, initrd_len);
 
-    if ( parms.pae == PAEKERN_extended_cr3 )
+    if ( parms.pae == XEN_PAE_EXTCR3 )
             set_bit(VMASST_TYPE_pae_extended_cr3, &d->vm_assist);
 
     if ( (parms.virt_hv_start_low != UNSET_ADDR) && elf_32bit(&elf) )
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index f929968..3de1c23 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -172,9 +172,9 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
         break;
     case XEN_ELFNOTE_PAE_MODE:
         if ( !strcmp(str, "yes") )
-            parms->pae = 2 /* extended_cr3 */;
+            parms->pae = XEN_PAE_EXTCR3;
         if ( strstr(str, "bimodal") )
-            parms->pae = 3 /* bimodal */;
+            parms->pae = XEN_PAE_BIMODAL;
         break;
     case XEN_ELFNOTE_BSD_SYMTAB:
         if ( !strcmp(str, "yes") )
@@ -317,9 +317,9 @@ elf_errorstatus elf_xen_parse_guest_info(struct elf_binary *elf,
         if ( !strcmp(name, "PAE") )
         {
             if ( !strcmp(value, "yes[extended-cr3]") )
-                parms->pae = 2 /* extended_cr3 */;
+                parms->pae = XEN_PAE_EXTCR3;
             else if ( !strncmp(value, "yes", 3) )
-                parms->pae = 1 /* yes */;
+                parms->pae = XEN_PAE_YES;
         }
         if ( !strcmp(name, "BSD_SYMTAB") )
             parms->bsd_symtab = 1;
diff --git a/xen/include/xen/elf.h b/xen/include/xen/elf.h
index 03faac7..4199b4d 100644
--- a/xen/include/xen/elf.h
+++ b/xen/include/xen/elf.h
@@ -34,25 +34,4 @@
 #define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz))
 #define ELFNOTE_NEXT(_n_) ((Elf_Note *)(ELFNOTE_DESC(_n_) + ELFNOTE_ALIGN((_n_)->descsz)))
 
-struct domain_setup_info;
-extern int loadelfimage(struct domain_setup_info *);
-extern int parseelfimage(struct domain_setup_info *);
-
-extern unsigned long long xen_elfnote_numeric(struct domain_setup_info *dsi,
-					      int type, int *defined);
-extern const char *xen_elfnote_string(struct domain_setup_info *dsi, int type);
-
-#ifdef CONFIG_COMPAT
-extern int elf32_sanity_check(const Elf32_Ehdr *ehdr);
-extern int loadelf32image(struct domain_setup_info *);
-extern int parseelf32image(struct domain_setup_info *);
-extern unsigned long long xen_elf32note_numeric(struct domain_setup_info *,
-						int type, int *defined);
-extern const char *xen_elf32note_string(struct domain_setup_info *, int type);
-#endif
-
-#ifdef Elf_Ehdr
-extern int elf_sanity_check(const Elf_Ehdr *ehdr);
-#endif
-
 #endif /* __XEN_ELF_H__ */
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index 6393040..d7045f6 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -393,6 +393,13 @@ enum xen_elfnote_type {
     XEN_ENT_STR  = 2
 };
 
+enum xen_pae_type {
+    XEN_PAE_NO      = 0,
+    XEN_PAE_YES     = 1,
+    XEN_PAE_EXTCR3  = 2,
+    XEN_PAE_BIMODAL = 3
+};
+
 struct xen_elfnote {
     enum xen_elfnote_type type;
     const char *name;
@@ -414,7 +421,7 @@ struct elf_dom_parms {
     char guest_ver[16];
     char xen_ver[16];
     char loader[16];
-    int pae; /* some kind of enum apparently */
+    enum xen_pae_type pae;
     bool bsd_symtab;
     uint64_t virt_base;
     uint64_t virt_entry;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 68819f8..3729b0f 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -463,29 +463,6 @@ struct domain
     struct vnuma_info *vnuma;
 };
 
-struct domain_setup_info
-{
-    /* Initialised by caller. */
-    unsigned long image_addr;
-    unsigned long image_len;
-    /* Initialised by loader: Public. */
-    unsigned long v_start;
-    unsigned long v_end;
-    unsigned long v_kernstart;
-    unsigned long v_kernend;
-    unsigned long v_kernentry;
-#define PAEKERN_no           0
-#define PAEKERN_yes          1
-#define PAEKERN_extended_cr3 2
-#define PAEKERN_bimodal      3
-    unsigned int  pae_kernel;
-    /* Initialised by loader: Private. */
-    unsigned long elf_paddr_offset;
-    unsigned int  load_symtab;
-    unsigned long symtab_addr;
-    unsigned long symtab_len;
-};
-
 /* Protect updates/reads (resp.) of domain_list and domain_hash. */
 extern spinlock_t domlist_update_lock;
 extern rcu_read_lock_t domlist_read_lock;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:22:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZiTK1-0005GC-5F; Sat, 03 Oct 2015 20:22: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 1ZiTK0-0005G2-3h
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:20 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	E0/6F-01753-BF830165; Sat, 03 Oct 2015 20:22:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1443903737!45593122!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29605 invoked from network); 3 Oct 2015 20:22:18 -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;
	3 Oct 2015 20:22:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJw-0003jD-W5
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTJw-0000tZ-MN
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:16 +0000
Date: Sat, 03 Oct 2015 20:22:16 +0000
Message-Id: <E1ZiTJw-0000tZ-MN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cleanup domain builder declarations
	and related users
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d3bcd64d9eb741b4d4df45de97e318fcf836c36
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Sep 28 17:28:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:28:35 2015 +0200

    cleanup domain builder declarations and related users
    
    There are several unused function and structure declarations in the
    hypervisor related to domain building. Remove them.
    
    Use an enum for elf_dom_parms.pae instead of just hard coding the
    values when setting the information and adjust the code to use those
    instead of own macros (hypervisor and tools).
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_binloader.c     |    2 +-
 tools/libxc/xc_dom_elfloader.c     |    8 ++++----
 tools/libxc/xc_dom_x86.c           |    6 +++---
 tools/libxc/xg_private.h           |    6 ------
 xen/arch/x86/domain_build.c        |    6 +++---
 xen/common/libelf/libelf-dominfo.c |    8 ++++----
 xen/include/xen/elf.h              |   21 ---------------------
 xen/include/xen/libelf.h           |    9 ++++++++-
 xen/include/xen/sched.h            |   23 -----------------------
 9 files changed, 23 insertions(+), 66 deletions(-)

diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xc_dom_binloader.c
index 740601a..d6f7f2a 100644
--- a/tools/libxc/xc_dom_binloader.c
+++ b/tools/libxc/xc_dom_binloader.c
@@ -238,7 +238,7 @@ static int xc_dom_parse_bin_kernel(struct xc_dom_image *dom)
         {
             DOMPRINTF("%s: PAE fixup", __FUNCTION__);
             dom->guest_type = "xen-3.0-x86_32p";
-            dom->parms.pae  = 2;
+            dom->parms.pae  = XEN_PAE_EXTCR3;
         }
         break;
     }
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 66ea9d6..82524c9 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -61,14 +61,14 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     case EM_386:
         switch ( dom->parms.pae )
         {
-        case 3 /* PAEKERN_bimodal */:
+        case XEN_PAE_BIMODAL:
             if ( strstr(dom->xen_caps, "xen-3.0-x86_32p") )
                 return "xen-3.0-x86_32p";
             return "xen-3.0-x86_32";
-        case PAEKERN_extended_cr3:
-        case PAEKERN_yes:
+        case XEN_PAE_EXTCR3:
+        case XEN_PAE_YES:
             return "xen-3.0-x86_32p";
-        case PAEKERN_no:
+        case XEN_PAE_NO:
         default:
             return "xen-3.0-x86_32";
         }
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 05fb0ce..e2f3792 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -249,7 +249,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
     xen_pfn_t pgpfn;
     xen_pfn_t l3mfn = xc_dom_p2m_guest(dom, l3pfn);
 
-    if ( dom->parms.pae == 1 )
+    if ( dom->parms.pae == XEN_PAE_YES )
     {
         if ( l3mfn >= 0x100000 )
             l3mfn = move_l3_below_4G(dom, l3pfn, l3mfn);
@@ -602,8 +602,8 @@ static int vcpu_x86_32(struct xc_dom_image *dom, void *ptr)
     ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
 
     ctxt->flags = VGCF_in_kernel_X86_32 | VGCF_online_X86_32;
-    if ( dom->parms.pae == 2 /* extended_cr3 */ ||
-         dom->parms.pae == 3 /* bimodal */ )
+    if ( dom->parms.pae == XEN_PAE_EXTCR3 ||
+         dom->parms.pae == XEN_PAE_BIMODAL )
         ctxt->vm_assist |= (1UL << VMASST_TYPE_pae_extended_cr3);
 
     cr3_pfn = xc_dom_p2m_guest(dom, dom->pgtables_seg.pfn);
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index 07eeb67..5544897 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -165,12 +165,6 @@ static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,
 #define MFN_MASK_X86    ((1ULL << (MADDR_BITS_X86 - PAGE_SHIFT_X86)) - 1)
 #define MADDR_MASK_X86  (MFN_MASK_X86 << PAGE_SHIFT_X86)
 
-
-#define PAEKERN_no           0
-#define PAEKERN_yes          1
-#define PAEKERN_extended_cr3 2
-#define PAEKERN_bimodal      3
-
 int pin_table(xc_interface *xch, unsigned int type, unsigned long mfn,
               domid_t dom);
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 18cf6aa..cd27864 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -953,8 +953,8 @@ int __init construct_dom0(
     compat32   = 0;
     machine = elf_uval(&elf, elf.ehdr, e_machine);
     printk(" Xen  kernel: 64-bit, lsb, compat32\n");
-    if (elf_32bit(&elf) && parms.pae == PAEKERN_bimodal)
-        parms.pae = PAEKERN_extended_cr3;
+    if (elf_32bit(&elf) && parms.pae == XEN_PAE_BIMODAL)
+        parms.pae = XEN_PAE_EXTCR3;
     if (elf_32bit(&elf) && parms.pae && machine == EM_386)
     {
         compat32 = 1;
@@ -1005,7 +1005,7 @@ int __init construct_dom0(
 
     nr_pages = compute_dom0_nr_pages(d, &parms, initrd_len);
 
-    if ( parms.pae == PAEKERN_extended_cr3 )
+    if ( parms.pae == XEN_PAE_EXTCR3 )
             set_bit(VMASST_TYPE_pae_extended_cr3, &d->vm_assist);
 
     if ( (parms.virt_hv_start_low != UNSET_ADDR) && elf_32bit(&elf) )
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index f929968..3de1c23 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -172,9 +172,9 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
         break;
     case XEN_ELFNOTE_PAE_MODE:
         if ( !strcmp(str, "yes") )
-            parms->pae = 2 /* extended_cr3 */;
+            parms->pae = XEN_PAE_EXTCR3;
         if ( strstr(str, "bimodal") )
-            parms->pae = 3 /* bimodal */;
+            parms->pae = XEN_PAE_BIMODAL;
         break;
     case XEN_ELFNOTE_BSD_SYMTAB:
         if ( !strcmp(str, "yes") )
@@ -317,9 +317,9 @@ elf_errorstatus elf_xen_parse_guest_info(struct elf_binary *elf,
         if ( !strcmp(name, "PAE") )
         {
             if ( !strcmp(value, "yes[extended-cr3]") )
-                parms->pae = 2 /* extended_cr3 */;
+                parms->pae = XEN_PAE_EXTCR3;
             else if ( !strncmp(value, "yes", 3) )
-                parms->pae = 1 /* yes */;
+                parms->pae = XEN_PAE_YES;
         }
         if ( !strcmp(name, "BSD_SYMTAB") )
             parms->bsd_symtab = 1;
diff --git a/xen/include/xen/elf.h b/xen/include/xen/elf.h
index 03faac7..4199b4d 100644
--- a/xen/include/xen/elf.h
+++ b/xen/include/xen/elf.h
@@ -34,25 +34,4 @@
 #define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz))
 #define ELFNOTE_NEXT(_n_) ((Elf_Note *)(ELFNOTE_DESC(_n_) + ELFNOTE_ALIGN((_n_)->descsz)))
 
-struct domain_setup_info;
-extern int loadelfimage(struct domain_setup_info *);
-extern int parseelfimage(struct domain_setup_info *);
-
-extern unsigned long long xen_elfnote_numeric(struct domain_setup_info *dsi,
-					      int type, int *defined);
-extern const char *xen_elfnote_string(struct domain_setup_info *dsi, int type);
-
-#ifdef CONFIG_COMPAT
-extern int elf32_sanity_check(const Elf32_Ehdr *ehdr);
-extern int loadelf32image(struct domain_setup_info *);
-extern int parseelf32image(struct domain_setup_info *);
-extern unsigned long long xen_elf32note_numeric(struct domain_setup_info *,
-						int type, int *defined);
-extern const char *xen_elf32note_string(struct domain_setup_info *, int type);
-#endif
-
-#ifdef Elf_Ehdr
-extern int elf_sanity_check(const Elf_Ehdr *ehdr);
-#endif
-
 #endif /* __XEN_ELF_H__ */
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index 6393040..d7045f6 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -393,6 +393,13 @@ enum xen_elfnote_type {
     XEN_ENT_STR  = 2
 };
 
+enum xen_pae_type {
+    XEN_PAE_NO      = 0,
+    XEN_PAE_YES     = 1,
+    XEN_PAE_EXTCR3  = 2,
+    XEN_PAE_BIMODAL = 3
+};
+
 struct xen_elfnote {
     enum xen_elfnote_type type;
     const char *name;
@@ -414,7 +421,7 @@ struct elf_dom_parms {
     char guest_ver[16];
     char xen_ver[16];
     char loader[16];
-    int pae; /* some kind of enum apparently */
+    enum xen_pae_type pae;
     bool bsd_symtab;
     uint64_t virt_base;
     uint64_t virt_entry;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 68819f8..3729b0f 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -463,29 +463,6 @@ struct domain
     struct vnuma_info *vnuma;
 };
 
-struct domain_setup_info
-{
-    /* Initialised by caller. */
-    unsigned long image_addr;
-    unsigned long image_len;
-    /* Initialised by loader: Public. */
-    unsigned long v_start;
-    unsigned long v_end;
-    unsigned long v_kernstart;
-    unsigned long v_kernend;
-    unsigned long v_kernentry;
-#define PAEKERN_no           0
-#define PAEKERN_yes          1
-#define PAEKERN_extended_cr3 2
-#define PAEKERN_bimodal      3
-    unsigned int  pae_kernel;
-    /* Initialised by loader: Private. */
-    unsigned long elf_paddr_offset;
-    unsigned int  load_symtab;
-    unsigned long symtab_addr;
-    unsigned long symtab_len;
-};
-
 /* Protect updates/reads (resp.) of domain_list and domain_hash. */
 extern spinlock_t domlist_update_lock;
 extern rcu_read_lock_t domlist_read_lock;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:22:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:22: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 1ZiTKB-0005HM-7s; Sat, 03 Oct 2015 20:22: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 1ZiTKA-0005H9-2i
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:30 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	FD/6D-00475-50930165; Sat, 03 Oct 2015 20:22:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1443903747!55435985!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20191 invoked from network); 3 Oct 2015 20:22:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:22:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTK7-0003jP-91
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTK7-0000tx-6I
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:27 +0000
Date: Sat, 03 Oct 2015 20:22:27 +0000
Message-Id: <E1ZiTK7-0000tx-6I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fine grained control of REP emulation
	optimizations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a1238d7cb73bc50f9ca1abede2b7cc59ec97bcd
Author:     Razvan Cojocaru <rcojocaru@bitdefender.com>
AuthorDate: Mon Sep 28 17:29:45 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:29:45 2015 +0200

    fine grained control of REP emulation optimizations
    
    Previously, if vm_event emulation support was enabled, then REP
    optimizations were disabled when emulating REP-compatible
    instructions. This patch allows fine-tuning of this behaviour by
    providing a dedicated libxc helper function.
    
    Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/include/xenctrl.h |   12 ++++++++++++
 tools/libxc/xc_monitor.c      |   13 +++++++++++++
 xen/arch/x86/hvm/emulate.c    |    2 +-
 xen/arch/x86/monitor.c        |    7 ++++++-
 xen/arch/x86/vm_event.c       |    2 ++
 xen/include/asm-x86/domain.h  |    1 +
 xen/include/public/domctl.h   |    1 +
 7 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 3482544..3bfa00b 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2428,6 +2428,18 @@ int xc_monitor_software_breakpoint(xc_interface *xch, domid_t domain_id,
 int xc_monitor_guest_request(xc_interface *xch, domid_t domain_id,
                              bool enable, bool sync);
 
+/**
+ * This function enables / disables emulation for each REP for a
+ * REP-compatible instruction.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domain_id the domain id one wants to get the node affinity of.
+ * @parm enable if 0 optimize when possible, else emulate each REP.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_monitor_emulate_each_rep(xc_interface *xch, domid_t domain_id,
+                                bool enable);
+
 /***
  * Memory sharing operations.
  *
diff --git a/tools/libxc/xc_monitor.c b/tools/libxc/xc_monitor.c
index 065669c..b1705dd 100644
--- a/tools/libxc/xc_monitor.c
+++ b/tools/libxc/xc_monitor.c
@@ -143,3 +143,16 @@ int xc_monitor_guest_request(xc_interface *xch, domid_t domain_id, bool enable,
 
     return do_domctl(xch, &domctl);
 }
+
+int xc_monitor_emulate_each_rep(xc_interface *xch, domid_t domain_id,
+                                bool enable)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_monitor_op;
+    domctl.domain = domain_id;
+    domctl.u.monitor_op.op = XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP;
+    domctl.u.monitor_op.event = enable;
+
+    return do_domctl(xch, &domctl);
+}
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 5934c72..39774b7 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -514,7 +514,7 @@ static int hvmemul_virtual_to_linear(
      * being triggered for repeated writes to a whole page.
      */
     *reps = min_t(unsigned long, *reps,
-                  unlikely(current->domain->arch.mem_access_emulate_enabled)
+                  unlikely(current->domain->arch.mem_access_emulate_each_rep)
                            ? 1 : 4096);
 
     reg = hvmemul_get_seg_reg(seg, hvmemul_ctxt);
diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c
index 3d52135..7611f7b 100644
--- a/xen/arch/x86/monitor.c
+++ b/xen/arch/x86/monitor.c
@@ -73,10 +73,15 @@ int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop)
     if ( rc )
         return rc;
 
-    if ( mop->op == XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES )
+    switch ( mop->op )
     {
+    case XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES:
         mop->event = capabilities;
         return 0;
+
+    case XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP:
+        d->arch.mem_access_emulate_each_rep = !!mop->event;
+        return 0;
     }
 
     /*
diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index e4e0aa4..c38d37b 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -54,6 +54,8 @@ void vm_event_cleanup_domain(struct domain *d)
         xfree(v->arch.vm_event);
         v->arch.vm_event = NULL;
     }
+
+    d->arch.mem_access_emulate_each_rep = 0;
 }
 
 void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v)
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index f0aeade..f1d7ed6 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -386,6 +386,7 @@ struct arch_domain
 
     /* Mem_access emulation control */
     bool_t mem_access_emulate_enabled;
+    bool_t mem_access_emulate_each_rep;
 } __cacheline_aligned;
 
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 794d4d5..ae241f2 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1007,6 +1007,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cmt_op_t);
 #define XEN_DOMCTL_MONITOR_OP_ENABLE            0
 #define XEN_DOMCTL_MONITOR_OP_DISABLE           1
 #define XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES  2
+#define XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP  3
 
 #define XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG         0
 #define XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR            1
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:22:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:22: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 1ZiTKB-0005HM-7s; Sat, 03 Oct 2015 20:22: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 1ZiTKA-0005H9-2i
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:30 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	FD/6D-00475-50930165; Sat, 03 Oct 2015 20:22:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1443903747!55435985!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20191 invoked from network); 3 Oct 2015 20:22:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:22:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTK7-0003jP-91
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTK7-0000tx-6I
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:27 +0000
Date: Sat, 03 Oct 2015 20:22:27 +0000
Message-Id: <E1ZiTK7-0000tx-6I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fine grained control of REP emulation
	optimizations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a1238d7cb73bc50f9ca1abede2b7cc59ec97bcd
Author:     Razvan Cojocaru <rcojocaru@bitdefender.com>
AuthorDate: Mon Sep 28 17:29:45 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 17:29:45 2015 +0200

    fine grained control of REP emulation optimizations
    
    Previously, if vm_event emulation support was enabled, then REP
    optimizations were disabled when emulating REP-compatible
    instructions. This patch allows fine-tuning of this behaviour by
    providing a dedicated libxc helper function.
    
    Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/include/xenctrl.h |   12 ++++++++++++
 tools/libxc/xc_monitor.c      |   13 +++++++++++++
 xen/arch/x86/hvm/emulate.c    |    2 +-
 xen/arch/x86/monitor.c        |    7 ++++++-
 xen/arch/x86/vm_event.c       |    2 ++
 xen/include/asm-x86/domain.h  |    1 +
 xen/include/public/domctl.h   |    1 +
 7 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 3482544..3bfa00b 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2428,6 +2428,18 @@ int xc_monitor_software_breakpoint(xc_interface *xch, domid_t domain_id,
 int xc_monitor_guest_request(xc_interface *xch, domid_t domain_id,
                              bool enable, bool sync);
 
+/**
+ * This function enables / disables emulation for each REP for a
+ * REP-compatible instruction.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domain_id the domain id one wants to get the node affinity of.
+ * @parm enable if 0 optimize when possible, else emulate each REP.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_monitor_emulate_each_rep(xc_interface *xch, domid_t domain_id,
+                                bool enable);
+
 /***
  * Memory sharing operations.
  *
diff --git a/tools/libxc/xc_monitor.c b/tools/libxc/xc_monitor.c
index 065669c..b1705dd 100644
--- a/tools/libxc/xc_monitor.c
+++ b/tools/libxc/xc_monitor.c
@@ -143,3 +143,16 @@ int xc_monitor_guest_request(xc_interface *xch, domid_t domain_id, bool enable,
 
     return do_domctl(xch, &domctl);
 }
+
+int xc_monitor_emulate_each_rep(xc_interface *xch, domid_t domain_id,
+                                bool enable)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_monitor_op;
+    domctl.domain = domain_id;
+    domctl.u.monitor_op.op = XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP;
+    domctl.u.monitor_op.event = enable;
+
+    return do_domctl(xch, &domctl);
+}
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 5934c72..39774b7 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -514,7 +514,7 @@ static int hvmemul_virtual_to_linear(
      * being triggered for repeated writes to a whole page.
      */
     *reps = min_t(unsigned long, *reps,
-                  unlikely(current->domain->arch.mem_access_emulate_enabled)
+                  unlikely(current->domain->arch.mem_access_emulate_each_rep)
                            ? 1 : 4096);
 
     reg = hvmemul_get_seg_reg(seg, hvmemul_ctxt);
diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c
index 3d52135..7611f7b 100644
--- a/xen/arch/x86/monitor.c
+++ b/xen/arch/x86/monitor.c
@@ -73,10 +73,15 @@ int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop)
     if ( rc )
         return rc;
 
-    if ( mop->op == XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES )
+    switch ( mop->op )
     {
+    case XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES:
         mop->event = capabilities;
         return 0;
+
+    case XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP:
+        d->arch.mem_access_emulate_each_rep = !!mop->event;
+        return 0;
     }
 
     /*
diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index e4e0aa4..c38d37b 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -54,6 +54,8 @@ void vm_event_cleanup_domain(struct domain *d)
         xfree(v->arch.vm_event);
         v->arch.vm_event = NULL;
     }
+
+    d->arch.mem_access_emulate_each_rep = 0;
 }
 
 void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v)
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index f0aeade..f1d7ed6 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -386,6 +386,7 @@ struct arch_domain
 
     /* Mem_access emulation control */
     bool_t mem_access_emulate_enabled;
+    bool_t mem_access_emulate_each_rep;
 } __cacheline_aligned;
 
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 794d4d5..ae241f2 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1007,6 +1007,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cmt_op_t);
 #define XEN_DOMCTL_MONITOR_OP_ENABLE            0
 #define XEN_DOMCTL_MONITOR_OP_DISABLE           1
 #define XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES  2
+#define XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP  3
 
 #define XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG         0
 #define XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR            1
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:22:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:22: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 1ZiTKL-0005Ic-AT; Sat, 03 Oct 2015 20:22:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKK-0005IR-9l
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:40 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	3C/8F-28791-F0930165; Sat, 03 Oct 2015 20:22:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1443903757!36633489!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25148 invoked from network); 3 Oct 2015 20:22: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;
	3 Oct 2015 20:22:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKH-0003jX-IF
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKH-0000uM-Gb
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:37 +0000
Date: Sat, 03 Oct 2015 20:22:37 +0000
Message-Id: <E1ZiTKH-0000uM-Gb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EPT: tighten conditions of IOMMU
	mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c0e4ad60850032c9bbd5d18b8446421c97e08e4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:25:29 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:25:29 2015 +0200

    x86/EPT: tighten conditions of IOMMU mapping updates
    
    Permission changes should also result in updates or TLB flushes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index e4d3d6b..d1a8c1b 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -668,6 +668,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     uint8_t ipat = 0;
     int need_modify_vtd_table = 1;
     int vtd_pte_present = 0;
+    unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
     enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
@@ -798,8 +799,9 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         new_entry.mfn = mfn_x(mfn);
 
         /* Safe to read-then-write because we hold the p2m lock */
-        if ( ept_entry->mfn == new_entry.mfn )
-             need_modify_vtd_table = 0;
+        if ( ept_entry->mfn == new_entry.mfn &&
+             p2m_get_iommu_flags(ept_entry->sa_p2mt) == iommu_flags )
+            need_modify_vtd_table = 0;
 
         ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
     }
@@ -830,11 +832,9 @@ out:
             iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present);
         else
         {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
+            if ( iommu_flags )
                 for ( i = 0; i < (1 << order); i++ )
-                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, flags);
+                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, iommu_flags);
             else
                 for ( i = 0; i < (1 << order); i++ )
                     iommu_unmap_page(d, gfn + 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 Sat Oct 03 20:22:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:22: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 1ZiTKL-0005Ic-AT; Sat, 03 Oct 2015 20:22:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKK-0005IR-9l
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:40 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	3C/8F-28791-F0930165; Sat, 03 Oct 2015 20:22:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1443903757!36633489!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25148 invoked from network); 3 Oct 2015 20:22: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;
	3 Oct 2015 20:22:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKH-0003jX-IF
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKH-0000uM-Gb
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:37 +0000
Date: Sat, 03 Oct 2015 20:22:37 +0000
Message-Id: <E1ZiTKH-0000uM-Gb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EPT: tighten conditions of IOMMU
	mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c0e4ad60850032c9bbd5d18b8446421c97e08e4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:25:29 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:25:29 2015 +0200

    x86/EPT: tighten conditions of IOMMU mapping updates
    
    Permission changes should also result in updates or TLB flushes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index e4d3d6b..d1a8c1b 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -668,6 +668,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     uint8_t ipat = 0;
     int need_modify_vtd_table = 1;
     int vtd_pte_present = 0;
+    unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
     enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
@@ -798,8 +799,9 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         new_entry.mfn = mfn_x(mfn);
 
         /* Safe to read-then-write because we hold the p2m lock */
-        if ( ept_entry->mfn == new_entry.mfn )
-             need_modify_vtd_table = 0;
+        if ( ept_entry->mfn == new_entry.mfn &&
+             p2m_get_iommu_flags(ept_entry->sa_p2mt) == iommu_flags )
+            need_modify_vtd_table = 0;
 
         ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
     }
@@ -830,11 +832,9 @@ out:
             iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present);
         else
         {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
+            if ( iommu_flags )
                 for ( i = 0; i < (1 << order); i++ )
-                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, flags);
+                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, iommu_flags);
             else
                 for ( i = 0; i < (1 << order); i++ )
                     iommu_unmap_page(d, gfn + 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 Sat Oct 03 20:22:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZiTKU-0005KC-Cv; Sat, 03 Oct 2015 20:22: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 1ZiTKT-0005Jz-Ro
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:49 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	71/B3-18107-91930165; Sat, 03 Oct 2015 20:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1443903768!39695666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5449 invoked from network); 3 Oct 2015 20:22:48 -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;
	3 Oct 2015 20:22:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKR-0003jf-QV
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKR-0000ul-OK
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:47 +0000
Date: Sat, 03 Oct 2015 20:22:47 +0000
Message-Id: <E1ZiTKR-0000ul-OK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-ept: adjust some types in
	ept_set_entry()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32f511afd2f69edd2ae1d55588ea50ebe8ece9ea
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:26:05 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:26:05 2015 +0200

    x86/p2m-ept: adjust some types in ept_set_entry()
    
    Use unsigned and bool_t as appropriate.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index d1a8c1b..ed4c493 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -662,12 +662,12 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 {
     ept_entry_t *table, *ept_entry = NULL;
     unsigned long gfn_remainder = gfn;
-    int i, target = order / EPT_TABLE_ORDER;
+    unsigned int i, target = order / EPT_TABLE_ORDER;
     int ret, rc = 0;
     bool_t direct_mmio = (p2mt == p2m_mmio_direct);
     uint8_t ipat = 0;
-    int need_modify_vtd_table = 1;
-    int vtd_pte_present = 0;
+    bool_t need_modify_vtd_table = 1;
+    bool_t vtd_pte_present = 0;
     unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
     enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
     ept_entry_t 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 Sat Oct 03 20:22:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZiTKU-0005KC-Cv; Sat, 03 Oct 2015 20:22: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 1ZiTKT-0005Jz-Ro
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:49 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	71/B3-18107-91930165; Sat, 03 Oct 2015 20:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1443903768!39695666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5449 invoked from network); 3 Oct 2015 20:22:48 -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;
	3 Oct 2015 20:22:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKR-0003jf-QV
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKR-0000ul-OK
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:47 +0000
Date: Sat, 03 Oct 2015 20:22:47 +0000
Message-Id: <E1ZiTKR-0000ul-OK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-ept: adjust some types in
	ept_set_entry()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32f511afd2f69edd2ae1d55588ea50ebe8ece9ea
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:26:05 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:26:05 2015 +0200

    x86/p2m-ept: adjust some types in ept_set_entry()
    
    Use unsigned and bool_t as appropriate.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index d1a8c1b..ed4c493 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -662,12 +662,12 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 {
     ept_entry_t *table, *ept_entry = NULL;
     unsigned long gfn_remainder = gfn;
-    int i, target = order / EPT_TABLE_ORDER;
+    unsigned int i, target = order / EPT_TABLE_ORDER;
     int ret, rc = 0;
     bool_t direct_mmio = (p2mt == p2m_mmio_direct);
     uint8_t ipat = 0;
-    int need_modify_vtd_table = 1;
-    int vtd_pte_present = 0;
+    bool_t need_modify_vtd_table = 1;
+    bool_t vtd_pte_present = 0;
     unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
     enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
     ept_entry_t 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 Sat Oct 03 20:23:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTKg-0005ML-FY; Sat, 03 Oct 2015 20:23:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKe-0005M5-OE
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:00 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	49/4B-05269-42930165; Sat, 03 Oct 2015 20:23:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1443903778!18021786!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18707 invoked from network); 3 Oct 2015 20:22:59 -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;
	3 Oct 2015 20:22:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKc-0003jn-5d
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKc-0000vD-3O
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:58 +0000
Date: Sat, 03 Oct 2015 20:22:58 +0000
Message-Id: <E1ZiTKc-0000vD-3O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: introduce
	libxl_get_online_socketmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0596394462484a277330b2e43f0b46efb815452
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:50 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:53:17 2015 +0100

    tools/libxl: introduce libxl_get_online_socketmap
    
    It sets the bit on the given bitmap if the corresponding socket is
    available and clears the bit when the corresponding socket is not
    available.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.h       |    7 ++++---
 tools/libxl/libxl_utils.c |   22 ++++++++++++++++++++++
 tools/libxl/libxl_utils.h |    2 ++
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index f0cc4e1..615b1de 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -814,11 +814,12 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
 #define LIBXL_HAVE_PCITOPOLOGY 1
 
 /*
- * LIBXL_HAVE_SOCKET_BITMAP_ALLOC
+ * LIBXL_HAVE_SOCKET_BITMAP
  *
- * If this is defined, then libxl_socket_bitmap_alloc exists.
+ * If this is defined, then libxl_socket_bitmap_alloc and
+ * libxl_get_online_socketmap exist.
  */
-#define LIBXL_HAVE_SOCKET_BITMAP_ALLOC 1
+#define LIBXL_HAVE_SOCKET_BITMAP 1
 
 /*
  * LIBXL_HAVE_SRM_V2
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index bfc9699..408ec85 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -886,6 +886,28 @@ int libxl_socket_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *socketmap,
 
 }
 
+int libxl_get_online_socketmap(libxl_ctx *ctx, libxl_bitmap *socketmap)
+{
+    libxl_cputopology *tinfo = NULL;
+    int nr_cpus = 0, i, rc = 0;
+
+    tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
+    if (tinfo == NULL) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    libxl_bitmap_set_none(socketmap);
+    for (i = 0; i < nr_cpus; i++)
+        if (tinfo[i].socket != XEN_INVALID_SOCKET_ID
+            && !libxl_bitmap_test(socketmap, tinfo[i].socket))
+            libxl_bitmap_set(socketmap, tinfo[i].socket);
+
+ out:
+    libxl_cputopology_list_free(tinfo, nr_cpus);
+    return rc;
+}
+
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             const libxl_bitmap *nodemap,
                             libxl_bitmap *cpumap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 1e5ca8a..339ebdf 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -143,6 +143,8 @@ int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
                             int max_nodes);
 int libxl_socket_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *socketmap,
                               int max_sockets);
+/* Fill socketmap with the CPU topology information on the system. */
+int libxl_get_online_socketmap(libxl_ctx *ctx, libxl_bitmap *socketmap);
 
 /* Populate cpumap with the cpus spanned by the nodes in nodemap */
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTKg-0005ML-FY; Sat, 03 Oct 2015 20:23:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKe-0005M5-OE
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:00 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	49/4B-05269-42930165; Sat, 03 Oct 2015 20:23:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1443903778!18021786!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18707 invoked from network); 3 Oct 2015 20:22:59 -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;
	3 Oct 2015 20:22:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKc-0003jn-5d
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKc-0000vD-3O
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:22:58 +0000
Date: Sat, 03 Oct 2015 20:22:58 +0000
Message-Id: <E1ZiTKc-0000vD-3O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: introduce
	libxl_get_online_socketmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0596394462484a277330b2e43f0b46efb815452
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:50 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:53:17 2015 +0100

    tools/libxl: introduce libxl_get_online_socketmap
    
    It sets the bit on the given bitmap if the corresponding socket is
    available and clears the bit when the corresponding socket is not
    available.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.h       |    7 ++++---
 tools/libxl/libxl_utils.c |   22 ++++++++++++++++++++++
 tools/libxl/libxl_utils.h |    2 ++
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index f0cc4e1..615b1de 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -814,11 +814,12 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
 #define LIBXL_HAVE_PCITOPOLOGY 1
 
 /*
- * LIBXL_HAVE_SOCKET_BITMAP_ALLOC
+ * LIBXL_HAVE_SOCKET_BITMAP
  *
- * If this is defined, then libxl_socket_bitmap_alloc exists.
+ * If this is defined, then libxl_socket_bitmap_alloc and
+ * libxl_get_online_socketmap exist.
  */
-#define LIBXL_HAVE_SOCKET_BITMAP_ALLOC 1
+#define LIBXL_HAVE_SOCKET_BITMAP 1
 
 /*
  * LIBXL_HAVE_SRM_V2
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index bfc9699..408ec85 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -886,6 +886,28 @@ int libxl_socket_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *socketmap,
 
 }
 
+int libxl_get_online_socketmap(libxl_ctx *ctx, libxl_bitmap *socketmap)
+{
+    libxl_cputopology *tinfo = NULL;
+    int nr_cpus = 0, i, rc = 0;
+
+    tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
+    if (tinfo == NULL) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    libxl_bitmap_set_none(socketmap);
+    for (i = 0; i < nr_cpus; i++)
+        if (tinfo[i].socket != XEN_INVALID_SOCKET_ID
+            && !libxl_bitmap_test(socketmap, tinfo[i].socket))
+            libxl_bitmap_set(socketmap, tinfo[i].socket);
+
+ out:
+    libxl_cputopology_list_free(tinfo, nr_cpus);
+    return rc;
+}
+
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             const libxl_bitmap *nodemap,
                             libxl_bitmap *cpumap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 1e5ca8a..339ebdf 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -143,6 +143,8 @@ int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
                             int max_nodes);
 int libxl_socket_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *socketmap,
                               int max_sockets);
+/* Fill socketmap with the CPU topology information on the system. */
+int libxl_get_online_socketmap(libxl_ctx *ctx, libxl_bitmap *socketmap);
 
 /* Populate cpumap with the cpus spanned by the nodes in nodemap */
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTKq-0005OA-Ky; Sat, 03 Oct 2015 20:23:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKp-0005Nx-9L
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:11 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	78/7D-05979-E2930165; Sat, 03 Oct 2015 20:23:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1443903788!49978296!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14526 invoked from network); 3 Oct 2015 20:23:09 -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;
	3 Oct 2015 20:23:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKm-0003kO-GY
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKm-0000vl-DD
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:08 +0000
Date: Sat, 03 Oct 2015 20:23:08 +0000
Message-Id: <E1ZiTKm-0000vl-DD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: fix socket display error
	for CMT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4943f6bdd2bcef9e20020a74e41aaeb77e42905
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:51 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:56:12 2015 +0100

    tools/libxl: fix socket display error for CMT
    
    When displaying the CMT information for all the sockets, we assume socket
    number is continuous. This is not true in the hotplug case. For instance,
    when the 3rd socket is plugged out on a 4-socket system, the available
    sockets numbers are 1,2,4 but current we will display the CMT
    information for socket 1,2,3.
    
    The fix is getting the socket bitmap for all the sockets on the system
    first and then displaying CMT information for_each_set_bit in that bitmap.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4dfcd9c..d921147 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8221,7 +8221,7 @@ static int psr_cmt_get_mem_bandwidth(uint32_t domid,
 
 static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
                                       libxl_psr_cmt_type type,
-                                      uint32_t nr_sockets)
+                                      libxl_bitmap *socketmap)
 {
     char *domain_name;
     uint32_t socketid;
@@ -8234,7 +8234,7 @@ static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
     printf("%-40s %5d", domain_name, dominfo->domid);
     free(domain_name);
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
+    libxl_for_each_set_bit(socketid, *socketmap) {
         switch (type) {
         case LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY:
             if (!libxl_psr_cmt_get_sample(ctx, dominfo->domid, type, socketid,
@@ -8257,9 +8257,9 @@ static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
 
 static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
 {
-    uint32_t i, socketid, nr_sockets, total_rmid;
+    uint32_t i, socketid, total_rmid;
     uint32_t l3_cache_size;
-    libxl_physinfo info;
+    libxl_bitmap socketmap;
     int rc, nr_domains;
 
     if (!libxl_psr_cmt_enabled(ctx)) {
@@ -8273,41 +8273,39 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         return -1;
     }
 
-    libxl_physinfo_init(&info);
-    rc = libxl_get_physinfo(ctx, &info);
+    libxl_bitmap_init(&socketmap);
+    libxl_socket_bitmap_alloc(ctx, &socketmap, 0);
+    rc = libxl_get_online_socketmap(ctx, &socketmap);
     if (rc < 0) {
-        fprintf(stderr, "Failed getting physinfo, rc: %d\n", rc);
-        libxl_physinfo_dispose(&info);
-        return -1;
+        fprintf(stderr, "Failed getting available sockets, rc: %d\n", rc);
+        goto out;
     }
-    nr_sockets = info.nr_cpus / info.threads_per_core / info.cores_per_socket;
-    libxl_physinfo_dispose(&info);
 
     rc = libxl_psr_cmt_get_total_rmid(ctx, &total_rmid);
     if (rc < 0) {
         fprintf(stderr, "Failed to get max RMID value\n");
-        return -1;
+        goto out;
     }
 
     printf("Total RMID: %d\n", total_rmid);
 
     /* Header */
     printf("%-40s %5s", "Name", "ID");
-    for (socketid = 0; socketid < nr_sockets; socketid++)
+    libxl_for_each_set_bit(socketid, socketmap)
         printf("%14s %d", "Socket", socketid);
     printf("\n");
 
     if (type == LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY) {
             /* Total L3 cache size */
             printf("%-46s", "Total L3 Cache Size");
-            for (socketid = 0; socketid < nr_sockets; socketid++) {
+            libxl_for_each_set_bit(socketid, socketmap) {
                 rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid,
                                                      &l3_cache_size);
                 if (rc < 0) {
                     fprintf(stderr,
                             "Failed to get system l3 cache size for socket:%d\n",
                             socketid);
-                    return -1;
+                    goto out;
                 }
                 printf("%13u KB", l3_cache_size);
             }
@@ -8321,9 +8319,10 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         libxl_dominfo_init(&dominfo);
         if (libxl_domain_info(ctx, &dominfo, domid)) {
             fprintf(stderr, "Failed to get domain info for %d\n", domid);
-            return -1;
+            rc = -1;
+            goto out;
         }
-        psr_cmt_print_domain_info(&dominfo, type, nr_sockets);
+        psr_cmt_print_domain_info(&dominfo, type, &socketmap);
         libxl_dominfo_dispose(&dominfo);
     }
     else
@@ -8331,13 +8330,17 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         libxl_dominfo *list;
         if (!(list = libxl_list_domain(ctx, &nr_domains))) {
             fprintf(stderr, "Failed to get domain info for domain list.\n");
-            return -1;
+            rc = -1;
+            goto out;
         }
         for (i = 0; i < nr_domains; i++)
-            psr_cmt_print_domain_info(list + i, type, nr_sockets);
+            psr_cmt_print_domain_info(list + i, type, &socketmap);
         libxl_dominfo_list_free(list, nr_domains);
     }
-    return 0;
+
+out:
+    libxl_bitmap_dispose(&socketmap);
+    return rc;
 }
 
 int main_psr_cmt_attach(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTKq-0005OA-Ky; Sat, 03 Oct 2015 20:23:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKp-0005Nx-9L
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:11 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	78/7D-05979-E2930165; Sat, 03 Oct 2015 20:23:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1443903788!49978296!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14526 invoked from network); 3 Oct 2015 20:23:09 -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;
	3 Oct 2015 20:23:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKm-0003kO-GY
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKm-0000vl-DD
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:08 +0000
Date: Sat, 03 Oct 2015 20:23:08 +0000
Message-Id: <E1ZiTKm-0000vl-DD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: fix socket display error
	for CMT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4943f6bdd2bcef9e20020a74e41aaeb77e42905
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:51 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:56:12 2015 +0100

    tools/libxl: fix socket display error for CMT
    
    When displaying the CMT information for all the sockets, we assume socket
    number is continuous. This is not true in the hotplug case. For instance,
    when the 3rd socket is plugged out on a 4-socket system, the available
    sockets numbers are 1,2,4 but current we will display the CMT
    information for socket 1,2,3.
    
    The fix is getting the socket bitmap for all the sockets on the system
    first and then displaying CMT information for_each_set_bit in that bitmap.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4dfcd9c..d921147 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8221,7 +8221,7 @@ static int psr_cmt_get_mem_bandwidth(uint32_t domid,
 
 static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
                                       libxl_psr_cmt_type type,
-                                      uint32_t nr_sockets)
+                                      libxl_bitmap *socketmap)
 {
     char *domain_name;
     uint32_t socketid;
@@ -8234,7 +8234,7 @@ static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
     printf("%-40s %5d", domain_name, dominfo->domid);
     free(domain_name);
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
+    libxl_for_each_set_bit(socketid, *socketmap) {
         switch (type) {
         case LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY:
             if (!libxl_psr_cmt_get_sample(ctx, dominfo->domid, type, socketid,
@@ -8257,9 +8257,9 @@ static void psr_cmt_print_domain_info(libxl_dominfo *dominfo,
 
 static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
 {
-    uint32_t i, socketid, nr_sockets, total_rmid;
+    uint32_t i, socketid, total_rmid;
     uint32_t l3_cache_size;
-    libxl_physinfo info;
+    libxl_bitmap socketmap;
     int rc, nr_domains;
 
     if (!libxl_psr_cmt_enabled(ctx)) {
@@ -8273,41 +8273,39 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         return -1;
     }
 
-    libxl_physinfo_init(&info);
-    rc = libxl_get_physinfo(ctx, &info);
+    libxl_bitmap_init(&socketmap);
+    libxl_socket_bitmap_alloc(ctx, &socketmap, 0);
+    rc = libxl_get_online_socketmap(ctx, &socketmap);
     if (rc < 0) {
-        fprintf(stderr, "Failed getting physinfo, rc: %d\n", rc);
-        libxl_physinfo_dispose(&info);
-        return -1;
+        fprintf(stderr, "Failed getting available sockets, rc: %d\n", rc);
+        goto out;
     }
-    nr_sockets = info.nr_cpus / info.threads_per_core / info.cores_per_socket;
-    libxl_physinfo_dispose(&info);
 
     rc = libxl_psr_cmt_get_total_rmid(ctx, &total_rmid);
     if (rc < 0) {
         fprintf(stderr, "Failed to get max RMID value\n");
-        return -1;
+        goto out;
     }
 
     printf("Total RMID: %d\n", total_rmid);
 
     /* Header */
     printf("%-40s %5s", "Name", "ID");
-    for (socketid = 0; socketid < nr_sockets; socketid++)
+    libxl_for_each_set_bit(socketid, socketmap)
         printf("%14s %d", "Socket", socketid);
     printf("\n");
 
     if (type == LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY) {
             /* Total L3 cache size */
             printf("%-46s", "Total L3 Cache Size");
-            for (socketid = 0; socketid < nr_sockets; socketid++) {
+            libxl_for_each_set_bit(socketid, socketmap) {
                 rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid,
                                                      &l3_cache_size);
                 if (rc < 0) {
                     fprintf(stderr,
                             "Failed to get system l3 cache size for socket:%d\n",
                             socketid);
-                    return -1;
+                    goto out;
                 }
                 printf("%13u KB", l3_cache_size);
             }
@@ -8321,9 +8319,10 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         libxl_dominfo_init(&dominfo);
         if (libxl_domain_info(ctx, &dominfo, domid)) {
             fprintf(stderr, "Failed to get domain info for %d\n", domid);
-            return -1;
+            rc = -1;
+            goto out;
         }
-        psr_cmt_print_domain_info(&dominfo, type, nr_sockets);
+        psr_cmt_print_domain_info(&dominfo, type, &socketmap);
         libxl_dominfo_dispose(&dominfo);
     }
     else
@@ -8331,13 +8330,17 @@ static int psr_cmt_show(libxl_psr_cmt_type type, uint32_t domid)
         libxl_dominfo *list;
         if (!(list = libxl_list_domain(ctx, &nr_domains))) {
             fprintf(stderr, "Failed to get domain info for domain list.\n");
-            return -1;
+            rc = -1;
+            goto out;
         }
         for (i = 0; i < nr_domains; i++)
-            psr_cmt_print_domain_info(list + i, type, nr_sockets);
+            psr_cmt_print_domain_info(list + i, type, &socketmap);
         libxl_dominfo_list_free(list, nr_domains);
     }
-    return 0;
+
+out:
+    libxl_bitmap_dispose(&socketmap);
+    return rc;
 }
 
 int main_psr_cmt_attach(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTL1-0005Pc-Na; Sat, 03 Oct 2015 20:23:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTL0-0005PM-0V
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:22 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	75/FB-15765-93930165; Sat, 03 Oct 2015 20:23:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1443903799!55338588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16034 invoked from network); 3 Oct 2015 20:23:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:23:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKx-0003kW-4l
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKw-0000wg-QJ
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:19 +0000
Date: Sat, 03 Oct 2015 20:23:18 +0000
Message-Id: <E1ZiTKw-0000wg-QJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: return socket id from
	libxl_psr_cat_get_l3_info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 30e7a6fde8d4810a230324b89125b4bdc8e5374d
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:52 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:56:22 2015 +0100

    tools/libxl: return socket id from libxl_psr_cat_get_l3_info
    
    The entries returned from libxl_psr_cat_get_l3_info are assumed
    to be socket-continuous. But this is not true in the hotplug case.
    
    This patch gets the socket bitmap for all the sockets on the system
    first and stores the socket id in the structure libxl_psr_cat_info in
    libxl_psr_cat_get_l3_info. The xl or similar consumers then can display
    socket information correctly.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_psr.c     |   23 ++++++++++++++++++-----
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |   41 ++++++++++++++++++++---------------------
 3 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 3378239..30740a1 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,30 +339,43 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i, nr_sockets;
+    int i = 0, socket, nr_sockets;
+    libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
+    libxl_bitmap_init(&socketmap);
+
     rc = libxl__count_physical_sockets(gc, &nr_sockets);
     if (rc) {
         LOGE(ERROR, "failed to get system socket count");
         goto out;
     }
 
+    libxl_socket_bitmap_alloc(ctx, &socketmap, nr_sockets);
+    rc = libxl_get_online_socketmap(ctx, &socketmap);
+    if (rc < 0) {
+        LOGE(ERROR, "failed to get available sockets");
+        goto out;
+    }
+
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    for (i = 0; i < nr_sockets; i++) {
-        if (xc_psr_cat_get_l3_info(ctx->xch, i, &ptr[i].cos_max,
-                                                &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socket, socketmap) {
+        ptr[i].id = socket;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
+                                                     &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
             goto out;
         }
+        i++;
     }
 
     *info = ptr;
-    *nr = nr_sockets;
+    *nr = i;
 out:
+    libxl_bitmap_dispose(&socketmap);
     GC_FREE;
     return rc;
 }
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 96e2940..d6ef9a2 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -800,6 +800,7 @@ libxl_psr_cbm_type = Enumeration("psr_cbm_type", [
     ])
 
 libxl_psr_cat_info = Struct("psr_cat_info", [
+    ("id", uint32),
     ("cos_max", uint32),
     ("cbm_len", uint32),
     ])
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d921147..265b78c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8413,35 +8413,35 @@ int main_psr_cmt_show(int argc, char **argv)
 static int psr_cat_hwinfo(void)
 {
     int rc;
-    int socketid, nr_sockets;
+    int i, nr;
     uint32_t l3_cache_size;
     libxl_psr_cat_info *info;
 
     printf("Cache Allocation Technology (CAT):\n");
 
-    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
+    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr);
     if (rc) {
         fprintf(stderr, "Failed to get cat info\n");
         return rc;
     }
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
-        rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+    for (i = 0; i < nr; i++) {
+        rc = libxl_psr_cmt_get_l3_cache_size(ctx, info[i].id, &l3_cache_size);
         if (rc) {
             fprintf(stderr, "Failed to get l3 cache size for socket:%d\n",
-                    socketid);
+                    info[i].id);
             goto out;
         }
-        printf("%-16s: %u\n", "Socket ID", socketid);
+        printf("%-16s: %u\n", "Socket ID", info[i].id);
         printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
-        printf("%-16s: %u\n", "Maximum COS", info->cos_max);
-        printf("%-16s: %u\n", "CBM length", info->cbm_len);
+        printf("%-16s: %u\n", "Maximum COS", info[i].cos_max);
+        printf("%-16s: %u\n", "CBM length", info[i].cbm_len);
         printf("%-16s: %#llx\n", "Default CBM",
-               (1ull << info->cbm_len) - 1);
+               (1ull << info[i].cbm_len) - 1);
     }
 
 out:
-    libxl_psr_cat_info_list_free(info, nr_sockets);
+    libxl_psr_cat_info_list_free(info, nr);
     return rc;
 }
 
@@ -8483,47 +8483,46 @@ static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid)
     return 0;
 }
 
-static int psr_cat_print_socket(uint32_t domid, uint32_t socketid,
-                                libxl_psr_cat_info *info)
+static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info)
 {
     int rc;
     uint32_t l3_cache_size;
 
-    rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+    rc = libxl_psr_cmt_get_l3_cache_size(ctx, info->id, &l3_cache_size);
     if (rc) {
         fprintf(stderr, "Failed to get l3 cache size for socket:%d\n",
-                socketid);
+                info->id);
         return -1;
     }
 
-    printf("%-16s: %u\n", "Socket ID", socketid);
+    printf("%-16s: %u\n", "Socket ID", info->id);
     printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
     printf("%-16s: %#llx\n", "Default CBM", (1ull << info->cbm_len) - 1);
     printf("%5s%25s%16s\n", "ID", "NAME", "CBM");
 
-    return psr_cat_print_domain_cbm(domid, socketid);
+    return psr_cat_print_domain_cbm(domid, info->id);
 }
 
 static int psr_cat_show(uint32_t domid)
 {
-    int socketid, nr_sockets;
+    int i, nr;
     int rc;
     libxl_psr_cat_info *info;
 
-    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
+    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr);
     if (rc) {
         fprintf(stderr, "Failed to get cat info\n");
         return rc;
     }
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
-        rc = psr_cat_print_socket(domid, socketid, info + socketid);
+    for (i = 0; i < nr; i++) {
+        rc = psr_cat_print_socket(domid, info + i);
         if (rc)
             goto out;
     }
 
 out:
-    libxl_psr_cat_info_list_free(info, nr_sockets);
+    libxl_psr_cat_info_list_free(info, nr);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTL1-0005Pc-Na; Sat, 03 Oct 2015 20:23:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTL0-0005PM-0V
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:22 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	75/FB-15765-93930165; Sat, 03 Oct 2015 20:23:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1443903799!55338588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16034 invoked from network); 3 Oct 2015 20:23:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:23:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKx-0003kW-4l
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTKw-0000wg-QJ
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:19 +0000
Date: Sat, 03 Oct 2015 20:23:18 +0000
Message-Id: <E1ZiTKw-0000wg-QJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: return socket id from
	libxl_psr_cat_get_l3_info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 30e7a6fde8d4810a230324b89125b4bdc8e5374d
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:52 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:56:22 2015 +0100

    tools/libxl: return socket id from libxl_psr_cat_get_l3_info
    
    The entries returned from libxl_psr_cat_get_l3_info are assumed
    to be socket-continuous. But this is not true in the hotplug case.
    
    This patch gets the socket bitmap for all the sockets on the system
    first and stores the socket id in the structure libxl_psr_cat_info in
    libxl_psr_cat_get_l3_info. The xl or similar consumers then can display
    socket information correctly.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_psr.c     |   23 ++++++++++++++++++-----
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |   41 ++++++++++++++++++++---------------------
 3 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 3378239..30740a1 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,30 +339,43 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i, nr_sockets;
+    int i = 0, socket, nr_sockets;
+    libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
+    libxl_bitmap_init(&socketmap);
+
     rc = libxl__count_physical_sockets(gc, &nr_sockets);
     if (rc) {
         LOGE(ERROR, "failed to get system socket count");
         goto out;
     }
 
+    libxl_socket_bitmap_alloc(ctx, &socketmap, nr_sockets);
+    rc = libxl_get_online_socketmap(ctx, &socketmap);
+    if (rc < 0) {
+        LOGE(ERROR, "failed to get available sockets");
+        goto out;
+    }
+
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    for (i = 0; i < nr_sockets; i++) {
-        if (xc_psr_cat_get_l3_info(ctx->xch, i, &ptr[i].cos_max,
-                                                &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socket, socketmap) {
+        ptr[i].id = socket;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
+                                                     &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
             goto out;
         }
+        i++;
     }
 
     *info = ptr;
-    *nr = nr_sockets;
+    *nr = i;
 out:
+    libxl_bitmap_dispose(&socketmap);
     GC_FREE;
     return rc;
 }
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 96e2940..d6ef9a2 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -800,6 +800,7 @@ libxl_psr_cbm_type = Enumeration("psr_cbm_type", [
     ])
 
 libxl_psr_cat_info = Struct("psr_cat_info", [
+    ("id", uint32),
     ("cos_max", uint32),
     ("cbm_len", uint32),
     ])
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d921147..265b78c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8413,35 +8413,35 @@ int main_psr_cmt_show(int argc, char **argv)
 static int psr_cat_hwinfo(void)
 {
     int rc;
-    int socketid, nr_sockets;
+    int i, nr;
     uint32_t l3_cache_size;
     libxl_psr_cat_info *info;
 
     printf("Cache Allocation Technology (CAT):\n");
 
-    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
+    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr);
     if (rc) {
         fprintf(stderr, "Failed to get cat info\n");
         return rc;
     }
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
-        rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+    for (i = 0; i < nr; i++) {
+        rc = libxl_psr_cmt_get_l3_cache_size(ctx, info[i].id, &l3_cache_size);
         if (rc) {
             fprintf(stderr, "Failed to get l3 cache size for socket:%d\n",
-                    socketid);
+                    info[i].id);
             goto out;
         }
-        printf("%-16s: %u\n", "Socket ID", socketid);
+        printf("%-16s: %u\n", "Socket ID", info[i].id);
         printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
-        printf("%-16s: %u\n", "Maximum COS", info->cos_max);
-        printf("%-16s: %u\n", "CBM length", info->cbm_len);
+        printf("%-16s: %u\n", "Maximum COS", info[i].cos_max);
+        printf("%-16s: %u\n", "CBM length", info[i].cbm_len);
         printf("%-16s: %#llx\n", "Default CBM",
-               (1ull << info->cbm_len) - 1);
+               (1ull << info[i].cbm_len) - 1);
     }
 
 out:
-    libxl_psr_cat_info_list_free(info, nr_sockets);
+    libxl_psr_cat_info_list_free(info, nr);
     return rc;
 }
 
@@ -8483,47 +8483,46 @@ static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid)
     return 0;
 }
 
-static int psr_cat_print_socket(uint32_t domid, uint32_t socketid,
-                                libxl_psr_cat_info *info)
+static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info)
 {
     int rc;
     uint32_t l3_cache_size;
 
-    rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+    rc = libxl_psr_cmt_get_l3_cache_size(ctx, info->id, &l3_cache_size);
     if (rc) {
         fprintf(stderr, "Failed to get l3 cache size for socket:%d\n",
-                socketid);
+                info->id);
         return -1;
     }
 
-    printf("%-16s: %u\n", "Socket ID", socketid);
+    printf("%-16s: %u\n", "Socket ID", info->id);
     printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
     printf("%-16s: %#llx\n", "Default CBM", (1ull << info->cbm_len) - 1);
     printf("%5s%25s%16s\n", "ID", "NAME", "CBM");
 
-    return psr_cat_print_domain_cbm(domid, socketid);
+    return psr_cat_print_domain_cbm(domid, info->id);
 }
 
 static int psr_cat_show(uint32_t domid)
 {
-    int socketid, nr_sockets;
+    int i, nr;
     int rc;
     libxl_psr_cat_info *info;
 
-    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
+    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr);
     if (rc) {
         fprintf(stderr, "Failed to get cat info\n");
         return rc;
     }
 
-    for (socketid = 0; socketid < nr_sockets; socketid++) {
-        rc = psr_cat_print_socket(domid, socketid, info + socketid);
+    for (i = 0; i < nr; i++) {
+        rc = psr_cat_print_socket(domid, info + i);
         if (rc)
             goto out;
     }
 
 out:
-    libxl_psr_cat_info_list_free(info, nr_sockets);
+    libxl_psr_cat_info_list_free(info, nr);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTLB-0005R2-QA; Sat, 03 Oct 2015 20:23:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLA-0005Qn-4x
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:32 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	19/E7-00536-34930165; Sat, 03 Oct 2015 20:23:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1443903809!18800718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22022 invoked from network); 3 Oct 2015 20:23:30 -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;
	3 Oct 2015 20:23:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTL7-0003ke-GN
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTL7-0000x3-DI
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:29 +0000
Date: Sat, 03 Oct 2015 20:23:29 +0000
Message-Id: <E1ZiTL7-0000x3-DI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: fix range check in
	main_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 e364a9cecea0bf6c5b02bea674745cd37ea0ad5c
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:53 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:56:38 2015 +0100

    tools/libxl: fix range check in main_psr_cat_cbm_set
    
    The 'end' should be inclusive.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@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 265b78c..365798b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8553,7 +8553,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
         len = libxl_string_list_length(&socket_list);
         for (i = 0; i < len; i++) {
             parse_range(socket_list[i], &start, &end);
-            for (j = start; j < end; j++)
+            for (j = start; j <= end; j++)
                 libxl_bitmap_set(&target_map, j);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTLB-0005R2-QA; Sat, 03 Oct 2015 20:23:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLA-0005Qn-4x
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:32 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	19/E7-00536-34930165; Sat, 03 Oct 2015 20:23:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1443903809!18800718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22022 invoked from network); 3 Oct 2015 20:23:30 -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;
	3 Oct 2015 20:23:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTL7-0003ke-GN
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTL7-0000x3-DI
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:29 +0000
Date: Sat, 03 Oct 2015 20:23:29 +0000
Message-Id: <E1ZiTL7-0000x3-DI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: fix range check in
	main_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 e364a9cecea0bf6c5b02bea674745cd37ea0ad5c
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:53 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:56:38 2015 +0100

    tools/libxl: fix range check in main_psr_cat_cbm_set
    
    The 'end' should be inclusive.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@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 265b78c..365798b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8553,7 +8553,7 @@ int main_psr_cat_cbm_set(int argc, char **argv)
         len = libxl_string_list_length(&socket_list);
         for (i = 0; i < len; i++) {
             parse_range(socket_list[i], &start, &end);
-            for (j = start; j < end; j++)
+            for (j = start; j <= end; j++)
                 libxl_bitmap_set(&target_map, j);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTLL-0005SW-Se; Sat, 03 Oct 2015 20:23:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLK-0005SI-DE
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:42 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	04/60-10715-D4930165; Sat, 03 Oct 2015 20:23:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1443903820!52816772!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15544 invoked from network); 3 Oct 2015 20:23:40 -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;
	3 Oct 2015 20:23:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLH-0003km-Oq
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLH-0000xT-MQ
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:39 +0000
Date: Sat, 03 Oct 2015 20:23:39 +0000
Message-Id: <E1ZiTLH-0000xT-MQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: make xl-psr.markdown more precise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f732ffa2b4e5bea27be56ba1970a0025ac1124d
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:54 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:57:30 2015 +0100

    docs: make xl-psr.markdown more precise
    
    Drop the chapter number as it can be confusing when it gets changed in
    the referred document.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- dropped hunk changing URL to specific revision, this is not
             needed now that the references do not include a specific
             chapter number ]
---
 docs/misc/xl-psr.markdown |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xl-psr.markdown b/docs/misc/xl-psr.markdown
index 3545912..c32e25c 100644
--- a/docs/misc/xl-psr.markdown
+++ b/docs/misc/xl-psr.markdown
@@ -14,7 +14,7 @@ tracks cache utilization of memory accesses according to the RMID and reports
 monitored data via a counter register.
 
 For more detailed information please refer to Intel SDM chapter
-"17.14 - Platform Shared Resource Monitoring: Cache Monitoring Technology".
+"Platform Shared Resource Monitoring: Cache Monitoring Technology".
 
 In Xen's implementation, each domain in the system can be assigned a RMID
 independently, while RMID=0 is reserved for monitoring domains that don't
@@ -52,7 +52,7 @@ event type to monitor system total/local memory bandwidth. The same RMID can
 be used to monitor both cache usage and memory bandwidth at the same time.
 
 For more detailed information please refer to Intel SDM chapter
-"17.14 - Platform Shared Resource Monitoring: Cache Monitoring Technology".
+"Overview of Cache Monitoring Technology and Memory Bandwidth Monitoring".
 
 In Xen's implementation, MBM shares the same set of underlying monitoring
 service with CMT and can be used to monitor memory bandwidth on a per domain
@@ -92,7 +92,7 @@ For example, assuming a system with 8 portions and 3 domains:
    access to one quarter each.
 
 For more detailed information please refer to Intel SDM chapter
-"17.15 - Platform Shared Resource Control: Cache Allocation Technology".
+"Platform Shared Resource Control: Cache Allocation Technology".
 
 In Xen's implementation, CBM can be configured with libxl/xl interfaces but
 COS is maintained in hypervisor only. The cache partition granularity is per
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTLL-0005SW-Se; Sat, 03 Oct 2015 20:23:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLK-0005SI-DE
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:42 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	04/60-10715-D4930165; Sat, 03 Oct 2015 20:23:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1443903820!52816772!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15544 invoked from network); 3 Oct 2015 20:23:40 -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;
	3 Oct 2015 20:23:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLH-0003km-Oq
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLH-0000xT-MQ
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:39 +0000
Date: Sat, 03 Oct 2015 20:23:39 +0000
Message-Id: <E1ZiTLH-0000xT-MQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: make xl-psr.markdown more precise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f732ffa2b4e5bea27be56ba1970a0025ac1124d
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:54 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:57:30 2015 +0100

    docs: make xl-psr.markdown more precise
    
    Drop the chapter number as it can be confusing when it gets changed in
    the referred document.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- dropped hunk changing URL to specific revision, this is not
             needed now that the references do not include a specific
             chapter number ]
---
 docs/misc/xl-psr.markdown |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xl-psr.markdown b/docs/misc/xl-psr.markdown
index 3545912..c32e25c 100644
--- a/docs/misc/xl-psr.markdown
+++ b/docs/misc/xl-psr.markdown
@@ -14,7 +14,7 @@ tracks cache utilization of memory accesses according to the RMID and reports
 monitored data via a counter register.
 
 For more detailed information please refer to Intel SDM chapter
-"17.14 - Platform Shared Resource Monitoring: Cache Monitoring Technology".
+"Platform Shared Resource Monitoring: Cache Monitoring Technology".
 
 In Xen's implementation, each domain in the system can be assigned a RMID
 independently, while RMID=0 is reserved for monitoring domains that don't
@@ -52,7 +52,7 @@ event type to monitor system total/local memory bandwidth. The same RMID can
 be used to monitor both cache usage and memory bandwidth at the same time.
 
 For more detailed information please refer to Intel SDM chapter
-"17.14 - Platform Shared Resource Monitoring: Cache Monitoring Technology".
+"Overview of Cache Monitoring Technology and Memory Bandwidth Monitoring".
 
 In Xen's implementation, MBM shares the same set of underlying monitoring
 service with CMT and can be used to monitor memory bandwidth on a per domain
@@ -92,7 +92,7 @@ For example, assuming a system with 8 portions and 3 domains:
    access to one quarter each.
 
 For more detailed information please refer to Intel SDM chapter
-"17.15 - Platform Shared Resource Control: Cache Allocation Technology".
+"Platform Shared Resource Control: Cache Allocation Technology".
 
 In Xen's implementation, CBM can be configured with libxl/xl interfaces but
 COS is maintained in hypervisor only. The cache partition granularity is per
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTLW-0005U1-3F; Sat, 03 Oct 2015 20:23: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 1ZiTLU-0005Tq-Ku
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:52 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	AA/2F-26043-85930165; Sat, 03 Oct 2015 20:23:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1443903830!43984838!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 31070 invoked from network); 3 Oct 2015 20:23:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:23:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLS-0003ku-1v
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLR-0000xr-Vi
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:49 +0000
Date: Sat, 03 Oct 2015 20:23:49 +0000
Message-Id: <E1ZiTLR-0000xr-Vi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs/man: resort sections
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 61598449ae28fe89036a699fd524b73b9ca454ae
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:55 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:58:02 2015 +0100

    docs/man: resort sections
    
    Section 'IGNORED FOR COMPATIBILITY WITH XM' separates 'CACHE MONITORING
    TECHNOLOGY' and 'CACHE ALLOCATION TECHNOLOGY' but they really should be
    put together.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.pod.1 |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index f22c3f3..d0cd612 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1509,18 +1509,6 @@ monitor types are:
 
 =back
 
-=head1 IGNORED FOR COMPATIBILITY WITH XM
-
-xl is mostly command-line compatible with the old xm utility used with
-the old Python xend.  For compatibility, the following options are
-ignored:
-
-=over 4
-
-=item B<xl migrate --live>
-
-=back
-
 =head2 CACHE ALLOCATION TECHNOLOGY
 
 Intel Broadwell and later server platforms offer capabilities to configure and
@@ -1553,6 +1541,18 @@ Show CAT settings for a certain domain or all domains.
 
 =back
 
+=head1 IGNORED FOR COMPATIBILITY WITH XM
+
+xl is mostly command-line compatible with the old xm utility used with
+the old Python xend.  For compatibility, the following options are
+ignored:
+
+=over 4
+
+=item B<xl migrate --live>
+
+=back
+
 =head1 TO BE DOCUMENTED
 
 We need better documentation for:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:23:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:23: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 1ZiTLW-0005U1-3F; Sat, 03 Oct 2015 20:23: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 1ZiTLU-0005Tq-Ku
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:52 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	AA/2F-26043-85930165; Sat, 03 Oct 2015 20:23:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1443903830!43984838!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 31070 invoked from network); 3 Oct 2015 20:23:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:23:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLS-0003ku-1v
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLR-0000xr-Vi
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:23:49 +0000
Date: Sat, 03 Oct 2015 20:23:49 +0000
Message-Id: <E1ZiTLR-0000xr-Vi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs/man: resort sections
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 61598449ae28fe89036a699fd524b73b9ca454ae
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Tue Sep 29 15:49:55 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Sep 29 10:58:02 2015 +0100

    docs/man: resort sections
    
    Section 'IGNORED FOR COMPATIBILITY WITH XM' separates 'CACHE MONITORING
    TECHNOLOGY' and 'CACHE ALLOCATION TECHNOLOGY' but they really should be
    put together.
    
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.pod.1 |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index f22c3f3..d0cd612 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1509,18 +1509,6 @@ monitor types are:
 
 =back
 
-=head1 IGNORED FOR COMPATIBILITY WITH XM
-
-xl is mostly command-line compatible with the old xm utility used with
-the old Python xend.  For compatibility, the following options are
-ignored:
-
-=over 4
-
-=item B<xl migrate --live>
-
-=back
-
 =head2 CACHE ALLOCATION TECHNOLOGY
 
 Intel Broadwell and later server platforms offer capabilities to configure and
@@ -1553,6 +1541,18 @@ Show CAT settings for a certain domain or all domains.
 
 =back
 
+=head1 IGNORED FOR COMPATIBILITY WITH XM
+
+xl is mostly command-line compatible with the old xm utility used with
+the old Python xend.  For compatibility, the following options are
+ignored:
+
+=over 4
+
+=item B<xl migrate --live>
+
+=back
+
 =head1 TO BE DOCUMENTED
 
 We need better documentation for:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTLg-0005VS-5k; Sat, 03 Oct 2015 20:24:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLe-0005VH-Tx
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:03 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	CF/10-25435-26930165; Sat, 03 Oct 2015 20:24:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1443903840!43984855!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31214 invoked from network); 3 Oct 2015 20:24:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:24:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLc-0003l2-CQ
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLc-0000yE-9x
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:00 +0000
Date: Sat, 03 Oct 2015 20:24:00 +0000
Message-Id: <E1ZiTLc-0000yE-9x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] PVH Dom0 RMRR IOMMU mapping regression
	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 0e9e09880d5f65ccb178d6c5785305ecf5715bba
Author:     Elena Ufimtseva <elena.ufimtseva@oracle.com>
AuthorDate: Tue Sep 29 13:53:31 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 13:53:31 2015 +0200

    PVH Dom0 RMRR IOMMU mapping regression fix
    
    This patch addresses a regression introduced by commit
    5ae03990c120a7b3067a52d9784c9aa72c0705a6 in new set_identity_p2m_entry.
    RMRRs are not being mapped in IOMMU for PVH Dom0. This causes pages faults and
    some long 'hang-like' delays during Dom0 PVH boot and device assignments.
    
    During construct_dom0, in PVH path p2m is being constructed and identity mapped
    in IOMMU. The p2m type is p2m_mmio_direct and p2m access p2m_rwx.
    New code used to map RMRRs invoked from rmrr_identity_mapping
    checks if p2m entry exists with same type and access and if yes, skips iommu
    mapping. Since there are p2m entries for pvh dom0 iomem, RMRRs are not being
    mapped in IOMMU.
    
    As was mentioned in the earlier discussion, the PVH Dom0 construction code
    should be modified to properly map RMRR regions in IOMMU. Since change will be
    too invasive, this solution is a temporary fix at this time before better
    solution is in. Also as Jan mentioned, there is no need in having 'x' permissions
    for p2m entry of a mmio region, thus changed here.
    
    Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain_build.c |    4 ++--
 xen/arch/x86/mm/p2m.c       |    9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index cd27864..c2ef87a 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -432,9 +432,9 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
         }
 
         if ( rangeset_contains_singleton(mmio_ro_ranges, mfn + i) )
-            a = p2m_access_rx;
+            a = p2m_access_r;
         else
-            a = p2m_access_rwx;
+            a = p2m_access_rw;
 
         if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index cf8485e..09144e0 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -979,7 +979,16 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
         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;
+        /*
+         * PVH fixme: during Dom0 PVH construction, p2m entries are being set
+         * but iomem regions are not mapped with IOMMU. This makes sure that
+         * RMRRs are correctly mapped with IOMMU.
+         */
+        if ( is_hardware_domain(d) && !iommu_use_hap_pt(d) )
+            ret = iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
+    }
     else
     {
         if ( flag & XEN_DOMCTL_DEV_RDM_RELAXED )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTLg-0005VS-5k; Sat, 03 Oct 2015 20:24:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLe-0005VH-Tx
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:03 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	CF/10-25435-26930165; Sat, 03 Oct 2015 20:24:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1443903840!43984855!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31214 invoked from network); 3 Oct 2015 20:24:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:24:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLc-0003l2-CQ
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLc-0000yE-9x
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:00 +0000
Date: Sat, 03 Oct 2015 20:24:00 +0000
Message-Id: <E1ZiTLc-0000yE-9x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] PVH Dom0 RMRR IOMMU mapping regression
	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 0e9e09880d5f65ccb178d6c5785305ecf5715bba
Author:     Elena Ufimtseva <elena.ufimtseva@oracle.com>
AuthorDate: Tue Sep 29 13:53:31 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 13:53:31 2015 +0200

    PVH Dom0 RMRR IOMMU mapping regression fix
    
    This patch addresses a regression introduced by commit
    5ae03990c120a7b3067a52d9784c9aa72c0705a6 in new set_identity_p2m_entry.
    RMRRs are not being mapped in IOMMU for PVH Dom0. This causes pages faults and
    some long 'hang-like' delays during Dom0 PVH boot and device assignments.
    
    During construct_dom0, in PVH path p2m is being constructed and identity mapped
    in IOMMU. The p2m type is p2m_mmio_direct and p2m access p2m_rwx.
    New code used to map RMRRs invoked from rmrr_identity_mapping
    checks if p2m entry exists with same type and access and if yes, skips iommu
    mapping. Since there are p2m entries for pvh dom0 iomem, RMRRs are not being
    mapped in IOMMU.
    
    As was mentioned in the earlier discussion, the PVH Dom0 construction code
    should be modified to properly map RMRR regions in IOMMU. Since change will be
    too invasive, this solution is a temporary fix at this time before better
    solution is in. Also as Jan mentioned, there is no need in having 'x' permissions
    for p2m entry of a mmio region, thus changed here.
    
    Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain_build.c |    4 ++--
 xen/arch/x86/mm/p2m.c       |    9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index cd27864..c2ef87a 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -432,9 +432,9 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
         }
 
         if ( rangeset_contains_singleton(mmio_ro_ranges, mfn + i) )
-            a = p2m_access_rx;
+            a = p2m_access_r;
         else
-            a = p2m_access_rwx;
+            a = p2m_access_rw;
 
         if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index cf8485e..09144e0 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -979,7 +979,16 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
         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;
+        /*
+         * PVH fixme: during Dom0 PVH construction, p2m entries are being set
+         * but iomem regions are not mapped with IOMMU. This makes sure that
+         * RMRRs are correctly mapped with IOMMU.
+         */
+        if ( is_hardware_domain(d) && !iommu_use_hap_pt(d) )
+            ret = iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
+    }
     else
     {
         if ( flag & XEN_DOMCTL_DEV_RDM_RELAXED )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTLq-0005XH-AO; Sat, 03 Oct 2015 20:24: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 1ZiTLp-0005X6-4j
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:13 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	D8/07-23203-C6930165; Sat, 03 Oct 2015 20:24:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1443903850!50049763!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7787 invoked from network); 3 Oct 2015 20:24:11 -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 Oct 2015 20:24:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLm-0003ld-Nd
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLm-0000zV-Kh
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:10 +0000
Date: Sat, 03 Oct 2015 20:24:10 +0000
Message-Id: <E1ZiTLm-0000zV-Kh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EPT: adjust types in
	ept_split_super_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53e3f77bfa108aa83396f84027df0abc852e121c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 13:54:55 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 13:54:55 2015 +0200

    x86/EPT: adjust types in ept_split_super_page()
    
    The function returns a boolean and its current and target level inputs
    are unsigned (which in turn allows simplifying the early-out check).
    Also convert a non-standard loop variable to an ordinary function scope
    one, at once making it unsigned too.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index ed4c493..0d87ebc 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -266,16 +266,18 @@ static void ept_free_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry, int l
     p2m_free_ptp(p2m, mfn_to_page(ept_entry->mfn));
 }
 
-static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
-                                int level, int target)
+static bool_t ept_split_super_page(struct p2m_domain *p2m,
+                                   ept_entry_t *ept_entry,
+                                   unsigned int level, unsigned int target)
 {
     ept_entry_t new_ept, *table;
     uint64_t trunk;
-    int rv = 1;
+    unsigned int i;
+    bool_t rv = 1;
 
     /* End if the entry is a leaf entry or reaches the target level. */
-    if ( level == 0 || level == target )
-        return rv;
+    if ( level <= target )
+        return 1;
 
     ASSERT(is_epte_superpage(ept_entry));
 
@@ -285,7 +287,7 @@ static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
     table = map_domain_page(_mfn(new_ept.mfn));
     trunk = 1UL << ((level - 1) * EPT_TABLE_ORDER);
 
-    for ( int i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
+    for ( i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
     {
         ept_entry_t *epte = table + 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 Sat Oct 03 20:24:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTLq-0005XH-AO; Sat, 03 Oct 2015 20:24: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 1ZiTLp-0005X6-4j
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:13 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	D8/07-23203-C6930165; Sat, 03 Oct 2015 20:24:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1443903850!50049763!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7787 invoked from network); 3 Oct 2015 20:24:11 -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 Oct 2015 20:24:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLm-0003ld-Nd
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLm-0000zV-Kh
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:10 +0000
Date: Sat, 03 Oct 2015 20:24:10 +0000
Message-Id: <E1ZiTLm-0000zV-Kh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EPT: adjust types in
	ept_split_super_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53e3f77bfa108aa83396f84027df0abc852e121c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 13:54:55 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 13:54:55 2015 +0200

    x86/EPT: adjust types in ept_split_super_page()
    
    The function returns a boolean and its current and target level inputs
    are unsigned (which in turn allows simplifying the early-out check).
    Also convert a non-standard loop variable to an ordinary function scope
    one, at once making it unsigned too.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index ed4c493..0d87ebc 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -266,16 +266,18 @@ static void ept_free_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry, int l
     p2m_free_ptp(p2m, mfn_to_page(ept_entry->mfn));
 }
 
-static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
-                                int level, int target)
+static bool_t ept_split_super_page(struct p2m_domain *p2m,
+                                   ept_entry_t *ept_entry,
+                                   unsigned int level, unsigned int target)
 {
     ept_entry_t new_ept, *table;
     uint64_t trunk;
-    int rv = 1;
+    unsigned int i;
+    bool_t rv = 1;
 
     /* End if the entry is a leaf entry or reaches the target level. */
-    if ( level == 0 || level == target )
-        return rv;
+    if ( level <= target )
+        return 1;
 
     ASSERT(is_epte_superpage(ept_entry));
 
@@ -285,7 +287,7 @@ static int ept_split_super_page(struct p2m_domain *p2m, ept_entry_t *ept_entry,
     table = map_domain_page(_mfn(new_ept.mfn));
     trunk = 1UL << ((level - 1) * EPT_TABLE_ORDER);
 
-    for ( int i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
+    for ( i = 0; i < EPT_PAGETABLE_ENTRIES; i++ )
     {
         ept_entry_t *epte = table + 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 Sat Oct 03 20:24:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTM1-0005Yh-D0; Sat, 03 Oct 2015 20:24:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLz-0005YW-Pb
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:23 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	D0/FB-18886-77930165; Sat, 03 Oct 2015 20:24:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1443903861!55419488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16307 invoked from network); 3 Oct 2015 20:24:22 -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;
	3 Oct 2015 20:24:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLx-0003ll-Av
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLx-0000zs-0g
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:21 +0000
Date: Sat, 03 Oct 2015 20:24:21 +0000
Message-Id: <E1ZiTLx-0000zs-0g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-pt: delay freeing of
	intermediate page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 960265fbd878cdc9841473b755e4ccc9eb1942d2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 13:55:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 13:55:34 2015 +0200

    x86/p2m-pt: delay freeing of intermediate page tables
    
    Old intermediate page tables must be freed only after IOMMU side
    updates/flushes have got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pt.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 8031c50..5be6212 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -487,8 +487,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     /* XXX -- this might be able to be faster iff current->domain == d */
     void *table;
     unsigned long i, gfn_remainder = gfn;
-    l1_pgentry_t *p2m_entry;
-    l1_pgentry_t entry_content;
+    l1_pgentry_t *p2m_entry, entry_content;
+    /* Intermediate table to free if we're replacing it with a superpage. */
+    l1_pgentry_t intermediate_entry = l1e_empty();
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rc;
@@ -538,7 +539,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
      */
     if ( page_order == PAGE_ORDER_1G )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
@@ -548,7 +548,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -566,10 +566,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
     else 
     {
@@ -610,7 +606,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     }
     else if ( page_order == PAGE_ORDER_2M )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
@@ -622,7 +617,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -643,10 +638,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
@@ -674,6 +665,14 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
     }
 
+    /*
+     * Free old intermediate tables if necessary.  This has to be the
+     * last thing we do, after removal from the IOMMU tables, so as to
+     * avoid a potential use-after-free.
+     */
+    if ( l1e_get_flags(intermediate_entry) & _PAGE_PRESENT )
+        p2m_free_entry(p2m, &intermediate_entry, page_order);
+
  out:
     unmap_domain_page(table);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTM1-0005Yh-D0; Sat, 03 Oct 2015 20:24:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLz-0005YW-Pb
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:23 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	D0/FB-18886-77930165; Sat, 03 Oct 2015 20:24:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1443903861!55419488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16307 invoked from network); 3 Oct 2015 20:24:22 -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;
	3 Oct 2015 20:24:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLx-0003ll-Av
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTLx-0000zs-0g
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:21 +0000
Date: Sat, 03 Oct 2015 20:24:21 +0000
Message-Id: <E1ZiTLx-0000zs-0g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-pt: delay freeing of
	intermediate page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 960265fbd878cdc9841473b755e4ccc9eb1942d2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 13:55:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 13:55:34 2015 +0200

    x86/p2m-pt: delay freeing of intermediate page tables
    
    Old intermediate page tables must be freed only after IOMMU side
    updates/flushes have got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pt.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 8031c50..5be6212 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -487,8 +487,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     /* XXX -- this might be able to be faster iff current->domain == d */
     void *table;
     unsigned long i, gfn_remainder = gfn;
-    l1_pgentry_t *p2m_entry;
-    l1_pgentry_t entry_content;
+    l1_pgentry_t *p2m_entry, entry_content;
+    /* Intermediate table to free if we're replacing it with a superpage. */
+    l1_pgentry_t intermediate_entry = l1e_empty();
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rc;
@@ -538,7 +539,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
      */
     if ( page_order == PAGE_ORDER_1G )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
@@ -548,7 +548,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -566,10 +566,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
     else 
     {
@@ -610,7 +606,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     }
     else if ( page_order == PAGE_ORDER_2M )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
@@ -622,7 +617,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -643,10 +638,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
@@ -674,6 +665,14 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
     }
 
+    /*
+     * Free old intermediate tables if necessary.  This has to be the
+     * last thing we do, after removal from the IOMMU tables, so as to
+     * avoid a potential use-after-free.
+     */
+    if ( l1e_get_flags(intermediate_entry) & _PAGE_PRESENT )
+        p2m_free_entry(p2m, &intermediate_entry, page_order);
+
  out:
     unmap_domain_page(table);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTMC-0005a8-FW; Sat, 03 Oct 2015 20:24: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 1ZiTMA-0005a0-VO
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:35 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	2A/B3-01143-28930165; Sat, 03 Oct 2015 20:24:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1443903872!22518436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7714 invoked from network); 3 Oct 2015 20:24:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:24:33 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTM8-0003lt-F4
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTM7-00010H-Gp
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:31 +0000
Date: Sat, 03 Oct 2015 20:24:31 +0000
Message-Id: <E1ZiTM7-00010H-Gp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-pt: ignore pt-share flag for
	shadow mode guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c0a85795d864dd64c116af661bf676d66ddfd5fc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 13:56:03 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 13:56:03 2015 +0200

    x86/p2m-pt: ignore pt-share flag for shadow mode guests
    
    There is no page table sharing in shadow mode.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 5be6212..e61d503 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -647,7 +647,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
     if ( iommu_enabled && need_iommu(p2m->domain) )
     {
-        if ( iommu_hap_pt_share )
+        if ( iommu_use_hap_pt(p2m->domain) )
         {
             if ( old_mfn && (old_mfn != mfn_x(mfn)) )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTMC-0005a8-FW; Sat, 03 Oct 2015 20:24: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 1ZiTMA-0005a0-VO
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:35 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	2A/B3-01143-28930165; Sat, 03 Oct 2015 20:24:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1443903872!22518436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7714 invoked from network); 3 Oct 2015 20:24:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:24:33 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTM8-0003lt-F4
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTM7-00010H-Gp
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:31 +0000
Date: Sat, 03 Oct 2015 20:24:31 +0000
Message-Id: <E1ZiTM7-00010H-Gp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-pt: ignore pt-share flag for
	shadow mode guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c0a85795d864dd64c116af661bf676d66ddfd5fc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 13:56:03 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 13:56:03 2015 +0200

    x86/p2m-pt: ignore pt-share flag for shadow mode guests
    
    There is no page table sharing in shadow mode.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 5be6212..e61d503 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -647,7 +647,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
     if ( iommu_enabled && need_iommu(p2m->domain) )
     {
-        if ( iommu_hap_pt_share )
+        if ( iommu_use_hap_pt(p2m->domain) )
         {
             if ( old_mfn && (old_mfn != mfn_x(mfn)) )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTMN-0005bZ-I8; Sat, 03 Oct 2015 20:24:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTML-0005bM-F5
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:45 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	0B/7C-32615-C8930165; Sat, 03 Oct 2015 20:24:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1443903882!16201047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10997 invoked from network); 3 Oct 2015 20:24:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:24:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMI-0003m1-QK
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMI-00010e-LX
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:42 +0000
Date: Sat, 03 Oct 2015 20:24:42 +0000
Message-Id: <E1ZiTMI-00010e-LX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: shorten certain operations on
	higher order 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 dea4d7a9a847e8822f7fbfd7b143a5e203135179
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 15:11:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:11:28 2015 +0200

    x86/PoD: shorten certain operations on higher order ranges
    
    Now that p2m->get_entry() always returns a valid order, utilize this
    to accelerate some of the operations in PoD code. (There are two uses
    of p2m->get_entry() left which don't easily lend themselves to this
    optimization.)
    
    Also adjust a few types as needed and remove stale comments from
    p2m_pod_cache_add() (to avoid duplicating them yet another time).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |   99 +++++++++++++++++++++++++++------------------
 1 files changed, 60 insertions(+), 39 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 026d455..c8a9ebc 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -119,20 +119,23 @@ p2m_pod_cache_add(struct p2m_domain *p2m,
 
     unlock_page_alloc(p2m);
 
-    /* Then add the first one to the appropriate populate-on-demand list */
-    switch(order)
+    /* Then add to the appropriate populate-on-demand list. */
+    switch ( order )
     {
+    case PAGE_ORDER_1G:
+        for ( i = 0; i < (1UL << PAGE_ORDER_1G); i += 1UL << PAGE_ORDER_2M )
+            page_list_add_tail(page + i, &p2m->pod.super);
+        break;
     case PAGE_ORDER_2M:
-        page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */
-        p2m->pod.count += 1 << order;
+        page_list_add_tail(page, &p2m->pod.super);
         break;
     case PAGE_ORDER_4K:
-        page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */
-        p2m->pod.count += 1;
+        page_list_add_tail(page, &p2m->pod.single);
         break;
     default:
         BUG();
     }
+    p2m->pod.count += 1L << order;
 
     return 0;
 }
@@ -502,11 +505,10 @@ p2m_pod_decrease_reservation(struct domain *d,
                              unsigned int order)
 {
     int ret=0;
-    int i;
+    unsigned long i, n;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    int steal_for_cache;
-    int pod, nonpod, ram;
+    bool_t steal_for_cache;
+    long pod, nonpod, ram;
 
     gfn_lock(p2m, gpfn, order);
     pod_lock(p2m);    
@@ -525,21 +527,21 @@ recount:
     /* Figure out if we need to steal some freed memory for our cache */
     steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-    /* FIXME: Add contiguous; query for PSE entries? */
-    for ( i=0; i<(1<<order); i++)
+    for ( i = 0; i < (1UL << order); i += n )
     {
         p2m_access_t a;
         p2m_type_t t;
+        unsigned int cur_order;
 
-        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
-
+        p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
+        n = 1UL << min(order, cur_order);
         if ( t == p2m_populate_on_demand )
-            pod++;
+            pod += n;
         else
         {
-            nonpod++;
+            nonpod += n;
             if ( p2m_is_ram(t) )
-                ram++;
+                ram += n;
         }
     }
 
@@ -574,41 +576,53 @@ recount:
      * + There are PoD entries to handle, or
      * + There is ram left, and we want to steal it
      */
-    for ( i=0;
-          i<(1<<order) && (pod>0 || (steal_for_cache && ram > 0));
-          i++)
+    for ( i = 0;
+          i < (1UL << order) && (pod > 0 || (steal_for_cache && ram > 0));
+          i += n )
     {
         mfn_t mfn;
         p2m_type_t t;
         p2m_access_t a;
+        unsigned int cur_order;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
+        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
+        if ( order < cur_order )
+            cur_order = order;
+        n = 1UL << cur_order;
         if ( t == p2m_populate_on_demand )
         {
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
-                          p2m->default_access);
-            p2m->pod.entry_count--;
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
+                          p2m_invalid, p2m->default_access);
+            p2m->pod.entry_count -= n;
             BUG_ON(p2m->pod.entry_count < 0);
-            pod--;
+            pod -= n;
         }
         else if ( steal_for_cache && p2m_is_ram(t) )
         {
+            /*
+             * If we need less than 1 << cur_order, we may end up stealing
+             * more memory here than we actually need. This will be rectified
+             * below, however; and stealing too much and then freeing what we
+             * need may allow us to free smaller pages from the cache, and
+             * avoid breaking up superpages.
+             */
             struct page_info *page;
+            unsigned int j;
 
             ASSERT(mfn_valid(mfn));
 
             page = mfn_to_page(mfn);
 
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
-                          p2m->default_access);
-            set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
-
-            p2m_pod_cache_add(p2m, page, 0);
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
+                          p2m_invalid, p2m->default_access);
+            for ( j = 0; j < n; ++j )
+                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+            p2m_pod_cache_add(p2m, page, cur_order);
 
             steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-            nonpod--;
-            ram--;
+            nonpod -= n;
+            ram -= n;
         }
     }    
 
@@ -649,7 +663,8 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     p2m_type_t type, type0 = 0;
     unsigned long * map = NULL;
     int ret=0, reset = 0;
-    int i, j;
+    unsigned long i, n;
+    unsigned int j;
     int max_ref = 1;
     struct domain *d = p2m->domain;
 
@@ -668,10 +683,13 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
 
     /* Look up the mfns, checking to make sure they're the same mfn
      * and aligned, and mapping them. */
-    for ( i=0; i<SUPERPAGE_PAGES; i++ )
+    for ( i = 0; i < SUPERPAGE_PAGES; i += n )
     {
         p2m_access_t a; 
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL, NULL);
+        unsigned int cur_order;
+
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, &cur_order, NULL);
+        n = 1UL << min(cur_order, SUPERPAGE_ORDER + 0U);
 
         if ( i == 0 )
         {
@@ -1114,7 +1132,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                       unsigned int order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    unsigned long i, pod_count = 0;
+    unsigned long i, n, pod_count = 0;
     p2m_type_t ot;
     mfn_t omfn;
     int rc = 0;
@@ -1127,10 +1145,13 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     P2M_DEBUG("mark pod gfn=%#lx\n", gfn);
 
     /* Make sure all gpfns are unused */
-    for ( i = 0; i < (1UL << order); i++ )
+    for ( i = 0; i < (1UL << order); i += n )
     {
         p2m_access_t a;
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
+        unsigned int cur_order;
+
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, &cur_order, NULL);
+        n = 1UL << min(order, cur_order);
         if ( p2m_is_ram(ot) )
         {
             P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
@@ -1140,7 +1161,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
         else if ( ot == p2m_populate_on_demand )
         {
             /* Count how man PoD entries we'll be replacing if successful */
-            pod_count++;
+            pod_count += n;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTMN-0005bZ-I8; Sat, 03 Oct 2015 20:24:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTML-0005bM-F5
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:45 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	0B/7C-32615-C8930165; Sat, 03 Oct 2015 20:24:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1443903882!16201047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10997 invoked from network); 3 Oct 2015 20:24:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:24:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMI-0003m1-QK
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMI-00010e-LX
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:42 +0000
Date: Sat, 03 Oct 2015 20:24:42 +0000
Message-Id: <E1ZiTMI-00010e-LX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: shorten certain operations on
	higher order 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 dea4d7a9a847e8822f7fbfd7b143a5e203135179
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 15:11:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:11:28 2015 +0200

    x86/PoD: shorten certain operations on higher order ranges
    
    Now that p2m->get_entry() always returns a valid order, utilize this
    to accelerate some of the operations in PoD code. (There are two uses
    of p2m->get_entry() left which don't easily lend themselves to this
    optimization.)
    
    Also adjust a few types as needed and remove stale comments from
    p2m_pod_cache_add() (to avoid duplicating them yet another time).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |   99 +++++++++++++++++++++++++++------------------
 1 files changed, 60 insertions(+), 39 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 026d455..c8a9ebc 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -119,20 +119,23 @@ p2m_pod_cache_add(struct p2m_domain *p2m,
 
     unlock_page_alloc(p2m);
 
-    /* Then add the first one to the appropriate populate-on-demand list */
-    switch(order)
+    /* Then add to the appropriate populate-on-demand list. */
+    switch ( order )
     {
+    case PAGE_ORDER_1G:
+        for ( i = 0; i < (1UL << PAGE_ORDER_1G); i += 1UL << PAGE_ORDER_2M )
+            page_list_add_tail(page + i, &p2m->pod.super);
+        break;
     case PAGE_ORDER_2M:
-        page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */
-        p2m->pod.count += 1 << order;
+        page_list_add_tail(page, &p2m->pod.super);
         break;
     case PAGE_ORDER_4K:
-        page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */
-        p2m->pod.count += 1;
+        page_list_add_tail(page, &p2m->pod.single);
         break;
     default:
         BUG();
     }
+    p2m->pod.count += 1L << order;
 
     return 0;
 }
@@ -502,11 +505,10 @@ p2m_pod_decrease_reservation(struct domain *d,
                              unsigned int order)
 {
     int ret=0;
-    int i;
+    unsigned long i, n;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    int steal_for_cache;
-    int pod, nonpod, ram;
+    bool_t steal_for_cache;
+    long pod, nonpod, ram;
 
     gfn_lock(p2m, gpfn, order);
     pod_lock(p2m);    
@@ -525,21 +527,21 @@ recount:
     /* Figure out if we need to steal some freed memory for our cache */
     steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-    /* FIXME: Add contiguous; query for PSE entries? */
-    for ( i=0; i<(1<<order); i++)
+    for ( i = 0; i < (1UL << order); i += n )
     {
         p2m_access_t a;
         p2m_type_t t;
+        unsigned int cur_order;
 
-        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
-
+        p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
+        n = 1UL << min(order, cur_order);
         if ( t == p2m_populate_on_demand )
-            pod++;
+            pod += n;
         else
         {
-            nonpod++;
+            nonpod += n;
             if ( p2m_is_ram(t) )
-                ram++;
+                ram += n;
         }
     }
 
@@ -574,41 +576,53 @@ recount:
      * + There are PoD entries to handle, or
      * + There is ram left, and we want to steal it
      */
-    for ( i=0;
-          i<(1<<order) && (pod>0 || (steal_for_cache && ram > 0));
-          i++)
+    for ( i = 0;
+          i < (1UL << order) && (pod > 0 || (steal_for_cache && ram > 0));
+          i += n )
     {
         mfn_t mfn;
         p2m_type_t t;
         p2m_access_t a;
+        unsigned int cur_order;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
+        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
+        if ( order < cur_order )
+            cur_order = order;
+        n = 1UL << cur_order;
         if ( t == p2m_populate_on_demand )
         {
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
-                          p2m->default_access);
-            p2m->pod.entry_count--;
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
+                          p2m_invalid, p2m->default_access);
+            p2m->pod.entry_count -= n;
             BUG_ON(p2m->pod.entry_count < 0);
-            pod--;
+            pod -= n;
         }
         else if ( steal_for_cache && p2m_is_ram(t) )
         {
+            /*
+             * If we need less than 1 << cur_order, we may end up stealing
+             * more memory here than we actually need. This will be rectified
+             * below, however; and stealing too much and then freeing what we
+             * need may allow us to free smaller pages from the cache, and
+             * avoid breaking up superpages.
+             */
             struct page_info *page;
+            unsigned int j;
 
             ASSERT(mfn_valid(mfn));
 
             page = mfn_to_page(mfn);
 
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
-                          p2m->default_access);
-            set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
-
-            p2m_pod_cache_add(p2m, page, 0);
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
+                          p2m_invalid, p2m->default_access);
+            for ( j = 0; j < n; ++j )
+                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+            p2m_pod_cache_add(p2m, page, cur_order);
 
             steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-            nonpod--;
-            ram--;
+            nonpod -= n;
+            ram -= n;
         }
     }    
 
@@ -649,7 +663,8 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     p2m_type_t type, type0 = 0;
     unsigned long * map = NULL;
     int ret=0, reset = 0;
-    int i, j;
+    unsigned long i, n;
+    unsigned int j;
     int max_ref = 1;
     struct domain *d = p2m->domain;
 
@@ -668,10 +683,13 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
 
     /* Look up the mfns, checking to make sure they're the same mfn
      * and aligned, and mapping them. */
-    for ( i=0; i<SUPERPAGE_PAGES; i++ )
+    for ( i = 0; i < SUPERPAGE_PAGES; i += n )
     {
         p2m_access_t a; 
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL, NULL);
+        unsigned int cur_order;
+
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, &cur_order, NULL);
+        n = 1UL << min(cur_order, SUPERPAGE_ORDER + 0U);
 
         if ( i == 0 )
         {
@@ -1114,7 +1132,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                       unsigned int order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    unsigned long i, pod_count = 0;
+    unsigned long i, n, pod_count = 0;
     p2m_type_t ot;
     mfn_t omfn;
     int rc = 0;
@@ -1127,10 +1145,13 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     P2M_DEBUG("mark pod gfn=%#lx\n", gfn);
 
     /* Make sure all gpfns are unused */
-    for ( i = 0; i < (1UL << order); i++ )
+    for ( i = 0; i < (1UL << order); i += n )
     {
         p2m_access_t a;
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
+        unsigned int cur_order;
+
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, &cur_order, NULL);
+        n = 1UL << min(order, cur_order);
         if ( p2m_is_ram(ot) )
         {
             P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
@@ -1140,7 +1161,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
         else if ( ot == p2m_populate_on_demand )
         {
             /* Count how man PoD entries we'll be replacing if successful */
-            pod_count++;
+            pod_count += n;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTMX-0005d2-Kg; Sat, 03 Oct 2015 20:24:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMV-0005co-Qj
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:56 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	09/8C-32615-79930165; Sat, 03 Oct 2015 20:24:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1443903893!23949302!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7597 invoked from network); 3 Oct 2015 20:24:53 -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;
	3 Oct 2015 20:24:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMT-0003m9-2S
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMT-000111-0O
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:53 +0000
Date: Sat, 03 Oct 2015 20:24:53 +0000
Message-Id: <E1ZiTMT-000111-0O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "x86/PoD: shorten certain
	operations on higher order 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 c5ee86becbfeea77df98242602bedd5d81188525
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 30 14:43:21 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:43:21 2015 +0200

    Revert "x86/PoD: shorten certain operations on higher order ranges"
    
    This reverts commit dea4d7a9a847e8822f7fbfd7b143a5e203135179, which
    has been found to be broken.
---
 xen/arch/x86/mm/p2m-pod.c |   99 ++++++++++++++++++---------------------------
 1 files changed, 39 insertions(+), 60 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index c8a9ebc..026d455 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -119,23 +119,20 @@ p2m_pod_cache_add(struct p2m_domain *p2m,
 
     unlock_page_alloc(p2m);
 
-    /* Then add to the appropriate populate-on-demand list. */
-    switch ( order )
+    /* Then add the first one to the appropriate populate-on-demand list */
+    switch(order)
     {
-    case PAGE_ORDER_1G:
-        for ( i = 0; i < (1UL << PAGE_ORDER_1G); i += 1UL << PAGE_ORDER_2M )
-            page_list_add_tail(page + i, &p2m->pod.super);
-        break;
     case PAGE_ORDER_2M:
-        page_list_add_tail(page, &p2m->pod.super);
+        page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */
+        p2m->pod.count += 1 << order;
         break;
     case PAGE_ORDER_4K:
-        page_list_add_tail(page, &p2m->pod.single);
+        page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */
+        p2m->pod.count += 1;
         break;
     default:
         BUG();
     }
-    p2m->pod.count += 1L << order;
 
     return 0;
 }
@@ -505,10 +502,11 @@ p2m_pod_decrease_reservation(struct domain *d,
                              unsigned int order)
 {
     int ret=0;
-    unsigned long i, n;
+    int i;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    bool_t steal_for_cache;
-    long pod, nonpod, ram;
+
+    int steal_for_cache;
+    int pod, nonpod, ram;
 
     gfn_lock(p2m, gpfn, order);
     pod_lock(p2m);    
@@ -527,21 +525,21 @@ recount:
     /* Figure out if we need to steal some freed memory for our cache */
     steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-    for ( i = 0; i < (1UL << order); i += n )
+    /* FIXME: Add contiguous; query for PSE entries? */
+    for ( i=0; i<(1<<order); i++)
     {
         p2m_access_t a;
         p2m_type_t t;
-        unsigned int cur_order;
 
-        p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
-        n = 1UL << min(order, cur_order);
+        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
+
         if ( t == p2m_populate_on_demand )
-            pod += n;
+            pod++;
         else
         {
-            nonpod += n;
+            nonpod++;
             if ( p2m_is_ram(t) )
-                ram += n;
+                ram++;
         }
     }
 
@@ -576,53 +574,41 @@ recount:
      * + There are PoD entries to handle, or
      * + There is ram left, and we want to steal it
      */
-    for ( i = 0;
-          i < (1UL << order) && (pod > 0 || (steal_for_cache && ram > 0));
-          i += n )
+    for ( i=0;
+          i<(1<<order) && (pod>0 || (steal_for_cache && ram > 0));
+          i++)
     {
         mfn_t mfn;
         p2m_type_t t;
         p2m_access_t a;
-        unsigned int cur_order;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
-        if ( order < cur_order )
-            cur_order = order;
-        n = 1UL << cur_order;
+        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), cur_order,
-                          p2m_invalid, p2m->default_access);
-            p2m->pod.entry_count -= n;
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
+                          p2m->default_access);
+            p2m->pod.entry_count--;
             BUG_ON(p2m->pod.entry_count < 0);
-            pod -= n;
+            pod--;
         }
         else if ( steal_for_cache && p2m_is_ram(t) )
         {
-            /*
-             * If we need less than 1 << cur_order, we may end up stealing
-             * more memory here than we actually need. This will be rectified
-             * below, however; and stealing too much and then freeing what we
-             * need may allow us to free smaller pages from the cache, and
-             * avoid breaking up superpages.
-             */
             struct page_info *page;
-            unsigned int j;
 
             ASSERT(mfn_valid(mfn));
 
             page = mfn_to_page(mfn);
 
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
-                          p2m_invalid, p2m->default_access);
-            for ( j = 0; j < n; ++j )
-                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
-            p2m_pod_cache_add(p2m, page, cur_order);
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
+                          p2m->default_access);
+            set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+
+            p2m_pod_cache_add(p2m, page, 0);
 
             steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-            nonpod -= n;
-            ram -= n;
+            nonpod--;
+            ram--;
         }
     }    
 
@@ -663,8 +649,7 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     p2m_type_t type, type0 = 0;
     unsigned long * map = NULL;
     int ret=0, reset = 0;
-    unsigned long i, n;
-    unsigned int j;
+    int i, j;
     int max_ref = 1;
     struct domain *d = p2m->domain;
 
@@ -683,13 +668,10 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
 
     /* Look up the mfns, checking to make sure they're the same mfn
      * and aligned, and mapping them. */
-    for ( i = 0; i < SUPERPAGE_PAGES; i += n )
+    for ( i=0; i<SUPERPAGE_PAGES; i++ )
     {
         p2m_access_t a; 
-        unsigned int cur_order;
-
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, &cur_order, NULL);
-        n = 1UL << min(cur_order, SUPERPAGE_ORDER + 0U);
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL, NULL);
 
         if ( i == 0 )
         {
@@ -1132,7 +1114,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                       unsigned int order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    unsigned long i, n, pod_count = 0;
+    unsigned long i, pod_count = 0;
     p2m_type_t ot;
     mfn_t omfn;
     int rc = 0;
@@ -1145,13 +1127,10 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     P2M_DEBUG("mark pod gfn=%#lx\n", gfn);
 
     /* Make sure all gpfns are unused */
-    for ( i = 0; i < (1UL << order); i += n )
+    for ( i = 0; i < (1UL << order); i++ )
     {
         p2m_access_t a;
-        unsigned int cur_order;
-
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, &cur_order, NULL);
-        n = 1UL << min(order, cur_order);
+        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);
@@ -1161,7 +1140,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
         else if ( ot == p2m_populate_on_demand )
         {
             /* Count how man PoD entries we'll be replacing if successful */
-            pod_count += n;
+            pod_count++;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:24:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:24: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 1ZiTMX-0005d2-Kg; Sat, 03 Oct 2015 20:24:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMV-0005co-Qj
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:56 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	09/8C-32615-79930165; Sat, 03 Oct 2015 20:24:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1443903893!23949302!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7597 invoked from network); 3 Oct 2015 20:24:53 -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;
	3 Oct 2015 20:24:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMT-0003m9-2S
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMT-000111-0O
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:24:53 +0000
Date: Sat, 03 Oct 2015 20:24:53 +0000
Message-Id: <E1ZiTMT-000111-0O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "x86/PoD: shorten certain
	operations on higher order 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 c5ee86becbfeea77df98242602bedd5d81188525
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 30 14:43:21 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:43:21 2015 +0200

    Revert "x86/PoD: shorten certain operations on higher order ranges"
    
    This reverts commit dea4d7a9a847e8822f7fbfd7b143a5e203135179, which
    has been found to be broken.
---
 xen/arch/x86/mm/p2m-pod.c |   99 ++++++++++++++++++---------------------------
 1 files changed, 39 insertions(+), 60 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index c8a9ebc..026d455 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -119,23 +119,20 @@ p2m_pod_cache_add(struct p2m_domain *p2m,
 
     unlock_page_alloc(p2m);
 
-    /* Then add to the appropriate populate-on-demand list. */
-    switch ( order )
+    /* Then add the first one to the appropriate populate-on-demand list */
+    switch(order)
     {
-    case PAGE_ORDER_1G:
-        for ( i = 0; i < (1UL << PAGE_ORDER_1G); i += 1UL << PAGE_ORDER_2M )
-            page_list_add_tail(page + i, &p2m->pod.super);
-        break;
     case PAGE_ORDER_2M:
-        page_list_add_tail(page, &p2m->pod.super);
+        page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */
+        p2m->pod.count += 1 << order;
         break;
     case PAGE_ORDER_4K:
-        page_list_add_tail(page, &p2m->pod.single);
+        page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */
+        p2m->pod.count += 1;
         break;
     default:
         BUG();
     }
-    p2m->pod.count += 1L << order;
 
     return 0;
 }
@@ -505,10 +502,11 @@ p2m_pod_decrease_reservation(struct domain *d,
                              unsigned int order)
 {
     int ret=0;
-    unsigned long i, n;
+    int i;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    bool_t steal_for_cache;
-    long pod, nonpod, ram;
+
+    int steal_for_cache;
+    int pod, nonpod, ram;
 
     gfn_lock(p2m, gpfn, order);
     pod_lock(p2m);    
@@ -527,21 +525,21 @@ recount:
     /* Figure out if we need to steal some freed memory for our cache */
     steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-    for ( i = 0; i < (1UL << order); i += n )
+    /* FIXME: Add contiguous; query for PSE entries? */
+    for ( i=0; i<(1<<order); i++)
     {
         p2m_access_t a;
         p2m_type_t t;
-        unsigned int cur_order;
 
-        p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
-        n = 1UL << min(order, cur_order);
+        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
+
         if ( t == p2m_populate_on_demand )
-            pod += n;
+            pod++;
         else
         {
-            nonpod += n;
+            nonpod++;
             if ( p2m_is_ram(t) )
-                ram += n;
+                ram++;
         }
     }
 
@@ -576,53 +574,41 @@ recount:
      * + There are PoD entries to handle, or
      * + There is ram left, and we want to steal it
      */
-    for ( i = 0;
-          i < (1UL << order) && (pod > 0 || (steal_for_cache && ram > 0));
-          i += n )
+    for ( i=0;
+          i<(1<<order) && (pod>0 || (steal_for_cache && ram > 0));
+          i++)
     {
         mfn_t mfn;
         p2m_type_t t;
         p2m_access_t a;
-        unsigned int cur_order;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
-        if ( order < cur_order )
-            cur_order = order;
-        n = 1UL << cur_order;
+        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), cur_order,
-                          p2m_invalid, p2m->default_access);
-            p2m->pod.entry_count -= n;
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
+                          p2m->default_access);
+            p2m->pod.entry_count--;
             BUG_ON(p2m->pod.entry_count < 0);
-            pod -= n;
+            pod--;
         }
         else if ( steal_for_cache && p2m_is_ram(t) )
         {
-            /*
-             * If we need less than 1 << cur_order, we may end up stealing
-             * more memory here than we actually need. This will be rectified
-             * below, however; and stealing too much and then freeing what we
-             * need may allow us to free smaller pages from the cache, and
-             * avoid breaking up superpages.
-             */
             struct page_info *page;
-            unsigned int j;
 
             ASSERT(mfn_valid(mfn));
 
             page = mfn_to_page(mfn);
 
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
-                          p2m_invalid, p2m->default_access);
-            for ( j = 0; j < n; ++j )
-                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
-            p2m_pod_cache_add(p2m, page, cur_order);
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
+                          p2m->default_access);
+            set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+
+            p2m_pod_cache_add(p2m, page, 0);
 
             steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-            nonpod -= n;
-            ram -= n;
+            nonpod--;
+            ram--;
         }
     }    
 
@@ -663,8 +649,7 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     p2m_type_t type, type0 = 0;
     unsigned long * map = NULL;
     int ret=0, reset = 0;
-    unsigned long i, n;
-    unsigned int j;
+    int i, j;
     int max_ref = 1;
     struct domain *d = p2m->domain;
 
@@ -683,13 +668,10 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
 
     /* Look up the mfns, checking to make sure they're the same mfn
      * and aligned, and mapping them. */
-    for ( i = 0; i < SUPERPAGE_PAGES; i += n )
+    for ( i=0; i<SUPERPAGE_PAGES; i++ )
     {
         p2m_access_t a; 
-        unsigned int cur_order;
-
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, &cur_order, NULL);
-        n = 1UL << min(cur_order, SUPERPAGE_ORDER + 0U);
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL, NULL);
 
         if ( i == 0 )
         {
@@ -1132,7 +1114,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                       unsigned int order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    unsigned long i, n, pod_count = 0;
+    unsigned long i, pod_count = 0;
     p2m_type_t ot;
     mfn_t omfn;
     int rc = 0;
@@ -1145,13 +1127,10 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     P2M_DEBUG("mark pod gfn=%#lx\n", gfn);
 
     /* Make sure all gpfns are unused */
-    for ( i = 0; i < (1UL << order); i += n )
+    for ( i = 0; i < (1UL << order); i++ )
     {
         p2m_access_t a;
-        unsigned int cur_order;
-
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, &cur_order, NULL);
-        n = 1UL << min(order, cur_order);
+        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);
@@ -1161,7 +1140,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
         else if ( ot == p2m_populate_on_demand )
         {
             /* Count how man PoD entries we'll be replacing if successful */
-            pod_count += n;
+            pod_count++;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:25:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZiTMk-0005ez-Ph; Sat, 03 Oct 2015 20:25: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 1ZiTMk-0005er-2O
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:10 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	DC/62-03763-5A930165; Sat, 03 Oct 2015 20:25:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1443903905!18021943!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8832 invoked from network); 3 Oct 2015 20:25:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:25:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMd-0003mo-Dq
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMd-00011c-80
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:03 +0000
Date: Sat, 03 Oct 2015 20:25:03 +0000
Message-Id: <E1ZiTMd-00011c-80@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit1: fix tickling when it happens
	from a remote pCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea5637968a09a81a64fa5fd73ce49b4ea9789e12
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Sep 30 14:44:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:44:22 2015 +0200

    credit1: fix tickling when it happens from a remote pCPU
    
    especially if that is also from a different cpupool than the
    processor of the vCPU that triggered the tickling.
    
    In fact, it is possible that we get as far as calling vcpu_unblock()-->
    vcpu_wake()-->csched_vcpu_wake()-->__runq_tickle() for the vCPU 'vc',
    but all while running on a pCPU that is different from 'vc->processor'.
    
    For instance, this can happen when an HVM domain runs in a cpupool,
    with a different scheduler than the default one, and issues IOREQs
    to Dom0, running in Pool-0 with the default scheduler.
    In fact, right in this case, the following crash can be observed:
    
    (XEN) ----[ Xen-4.7-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    7
    (XEN) RIP:    e008:[<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN) RFLAGS: 0000000000010086   CONTEXT: hypervisor (d1v0)
    (XEN) rax: 0000000000000001   rbx: ffff8303184fee00   rcx: 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen stack trace from rsp=ffff83031fa57a08:
    (XEN)    ffff82d0801fe664 ffff82d08033c820 0000000100000002 0000000a00000001
    (XEN)    0000000000006831 0000000000000000 0000000000000000 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN)    [<ffff82d08012348a>] csched_vcpu_wake+0x10b/0x110
    (XEN)    [<ffff82d08012b421>] vcpu_wake+0x20a/0x3ce
    (XEN)    [<ffff82d08012b91c>] vcpu_unblock+0x4b/0x4e
    (XEN)    [<ffff82d080167bd0>] vcpu_kick+0x17/0x61
    (XEN)    [<ffff82d080167c46>] vcpu_mark_events_pending+0x2c/0x2f
    (XEN)    [<ffff82d08010ac35>] evtchn_fifo_set_pending+0x381/0x3f6
    (XEN)    [<ffff82d08010a0f6>] notify_via_xen_event_channel+0xc9/0xd6
    (XEN)    [<ffff82d0801c29ed>] hvm_send_ioreq+0x3e9/0x441
    (XEN)    [<ffff82d0801bba7d>] hvmemul_do_io+0x23f/0x2d2
    (XEN)    [<ffff82d0801bbb43>] hvmemul_do_io_buffer+0x33/0x64
    (XEN)    [<ffff82d0801bc92b>] hvmemul_do_pio_buffer+0x35/0x37
    (XEN)    [<ffff82d0801cc49f>] handle_pio+0x58/0x14c
    (XEN)    [<ffff82d0801eabcb>] vmx_vmexit_handler+0x16b3/0x1bea
    (XEN)    [<ffff82d0801efd21>] vmx_asm_vmexit_handler+0x41/0xc0
    
    In this case, pCPU 7 is not in Pool-0, while the (Dom0's) vCPU being
    woken is. pCPU's 7 pool has a different scheduler than credit, but it
    is, however, right from pCPU 7 that we are waking the Dom0's vCPUs.
    Therefore, the current code tries to access csched_balance_mask for
    pCPU 7, but that is not defined, and hence the Oops.
    
    (Note that, in case the two pools run the same scheduler we see no
    Oops, but things are still conceptually wrong.)
    
    Cure things by making the csched_balance_mask macro accept a
    parameter for fetching a specific pCPU's mask (instead than always
    using smp_processor_id()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index a1945ac..57967c1 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -171,10 +171,10 @@ struct csched_pcpu {
  * Convenience macro for accessing the per-PCPU cpumask we need for
  * implementing the two steps (soft and hard affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
- * as there is a csched_pcpu for each PCPU and we always hold the
- * runqueue spin-lock when using this.
+ * as there is a csched_pcpu for each PCPU, and we always hold the
+ * runqueue lock for the proper PCPU when using this.
  */
-#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+#define csched_balance_mask(c) (CSCHED_PCPU(c)->balance_mask)
 
 /*
  * Virtual CPU
@@ -412,9 +412,10 @@ __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(csched_balance_mask, csched_balance_mask, &idle_mask);
-            new_idlers_empty = cpumask_empty(csched_balance_mask);
+                                   csched_balance_mask(cpu));
+            cpumask_and(csched_balance_mask(cpu),
+                        csched_balance_mask(cpu), &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask(cpu));
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1491,8 +1492,9 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
                  && !__vcpu_has_soft_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
-            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
-            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask(cpu));
+            if ( __csched_vcpu_is_migrateable(vc, cpu,
+                                              csched_balance_mask(cpu)) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:25:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZiTMk-0005ez-Ph; Sat, 03 Oct 2015 20:25: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 1ZiTMk-0005er-2O
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:10 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	DC/62-03763-5A930165; Sat, 03 Oct 2015 20:25:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1443903905!18021943!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8832 invoked from network); 3 Oct 2015 20:25:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:25:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMd-0003mo-Dq
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMd-00011c-80
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:03 +0000
Date: Sat, 03 Oct 2015 20:25:03 +0000
Message-Id: <E1ZiTMd-00011c-80@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit1: fix tickling when it happens
	from a remote pCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea5637968a09a81a64fa5fd73ce49b4ea9789e12
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Sep 30 14:44:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:44:22 2015 +0200

    credit1: fix tickling when it happens from a remote pCPU
    
    especially if that is also from a different cpupool than the
    processor of the vCPU that triggered the tickling.
    
    In fact, it is possible that we get as far as calling vcpu_unblock()-->
    vcpu_wake()-->csched_vcpu_wake()-->__runq_tickle() for the vCPU 'vc',
    but all while running on a pCPU that is different from 'vc->processor'.
    
    For instance, this can happen when an HVM domain runs in a cpupool,
    with a different scheduler than the default one, and issues IOREQs
    to Dom0, running in Pool-0 with the default scheduler.
    In fact, right in this case, the following crash can be observed:
    
    (XEN) ----[ Xen-4.7-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    7
    (XEN) RIP:    e008:[<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN) RFLAGS: 0000000000010086   CONTEXT: hypervisor (d1v0)
    (XEN) rax: 0000000000000001   rbx: ffff8303184fee00   rcx: 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen stack trace from rsp=ffff83031fa57a08:
    (XEN)    ffff82d0801fe664 ffff82d08033c820 0000000100000002 0000000a00000001
    (XEN)    0000000000006831 0000000000000000 0000000000000000 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN)    [<ffff82d08012348a>] csched_vcpu_wake+0x10b/0x110
    (XEN)    [<ffff82d08012b421>] vcpu_wake+0x20a/0x3ce
    (XEN)    [<ffff82d08012b91c>] vcpu_unblock+0x4b/0x4e
    (XEN)    [<ffff82d080167bd0>] vcpu_kick+0x17/0x61
    (XEN)    [<ffff82d080167c46>] vcpu_mark_events_pending+0x2c/0x2f
    (XEN)    [<ffff82d08010ac35>] evtchn_fifo_set_pending+0x381/0x3f6
    (XEN)    [<ffff82d08010a0f6>] notify_via_xen_event_channel+0xc9/0xd6
    (XEN)    [<ffff82d0801c29ed>] hvm_send_ioreq+0x3e9/0x441
    (XEN)    [<ffff82d0801bba7d>] hvmemul_do_io+0x23f/0x2d2
    (XEN)    [<ffff82d0801bbb43>] hvmemul_do_io_buffer+0x33/0x64
    (XEN)    [<ffff82d0801bc92b>] hvmemul_do_pio_buffer+0x35/0x37
    (XEN)    [<ffff82d0801cc49f>] handle_pio+0x58/0x14c
    (XEN)    [<ffff82d0801eabcb>] vmx_vmexit_handler+0x16b3/0x1bea
    (XEN)    [<ffff82d0801efd21>] vmx_asm_vmexit_handler+0x41/0xc0
    
    In this case, pCPU 7 is not in Pool-0, while the (Dom0's) vCPU being
    woken is. pCPU's 7 pool has a different scheduler than credit, but it
    is, however, right from pCPU 7 that we are waking the Dom0's vCPUs.
    Therefore, the current code tries to access csched_balance_mask for
    pCPU 7, but that is not defined, and hence the Oops.
    
    (Note that, in case the two pools run the same scheduler we see no
    Oops, but things are still conceptually wrong.)
    
    Cure things by making the csched_balance_mask macro accept a
    parameter for fetching a specific pCPU's mask (instead than always
    using smp_processor_id()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index a1945ac..57967c1 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -171,10 +171,10 @@ struct csched_pcpu {
  * Convenience macro for accessing the per-PCPU cpumask we need for
  * implementing the two steps (soft and hard affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
- * as there is a csched_pcpu for each PCPU and we always hold the
- * runqueue spin-lock when using this.
+ * as there is a csched_pcpu for each PCPU, and we always hold the
+ * runqueue lock for the proper PCPU when using this.
  */
-#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+#define csched_balance_mask(c) (CSCHED_PCPU(c)->balance_mask)
 
 /*
  * Virtual CPU
@@ -412,9 +412,10 @@ __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(csched_balance_mask, csched_balance_mask, &idle_mask);
-            new_idlers_empty = cpumask_empty(csched_balance_mask);
+                                   csched_balance_mask(cpu));
+            cpumask_and(csched_balance_mask(cpu),
+                        csched_balance_mask(cpu), &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask(cpu));
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1491,8 +1492,9 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
                  && !__vcpu_has_soft_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
-            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
-            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask(cpu));
+            if ( __csched_vcpu_is_migrateable(vc, cpu,
+                                              csched_balance_mask(cpu)) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:25:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25: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 1ZiTMs-0005gD-SE; Sat, 03 Oct 2015 20:25:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMs-0005g2-CN
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:18 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	0A/2B-19110-DA930165; Sat, 03 Oct 2015 20:25:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1443903915!19402162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19997 invoked from network); 3 Oct 2015 20:25:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:25:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMp-0003pz-8q
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMp-00012V-4T
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:15 +0000
Date: Sat, 03 Oct 2015 20:25:15 +0000
Message-Id: <E1ZiTMp-00012V-4T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: get rid of
	cpupool_scheduler_cpumask()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c9cf46cefcf2cfb920c14e9ac2c53c371366cf2
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Sep 30 14:45:23 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:45:23 2015 +0200

    sched: get rid of cpupool_scheduler_cpumask()
    
    and of (almost every) direct use of cpupool_online_cpumask().
    
    In fact, what we really want for the most of the times,
    is the set of valid pCPUs of the cpupool a certain domain
    is part of. Furthermore, in case it's called with a NULL
    pool as argument, cpupool_scheduler_cpumask() does more
    harm than good, by returning the bitmask of free pCPUs!
    
    This commit, therefore:
     * gets rid of cpupool_scheduler_cpumask(), in favour of
       cpupool_domain_cpumask(), which makes it more evident
       what we are after, and accommodates some sanity checking;
     * replaces some of the calls to cpupool_online_cpumask()
       with calls to the new functions too.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Acked-by: Joshua Whitehead <josh.whitehead@dornerworks.com>
    Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/domain.c         |    5 +++--
 xen/common/domctl.c         |    4 ++--
 xen/common/sched_arinc653.c |    2 +-
 xen/common/sched_credit.c   |    8 +++-----
 xen/common/sched_rt.c       |   12 ++++++------
 xen/common/schedule.c       |    2 +-
 xen/include/xen/sched-if.h  |   12 ++++++++++--
 7 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8e7a282..cda60a9 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -191,7 +191,8 @@ struct vcpu *alloc_vcpu(
     /* Must be called after making new vcpu visible to for_each_vcpu(). */
     vcpu_check_shutdown(v);
 
-    domain_update_node_affinity(d);
+    if ( !is_idle_domain(d) )
+        domain_update_node_affinity(d);
 
     return v;
 }
@@ -444,7 +445,7 @@ void domain_update_node_affinity(struct domain *d)
         return;
     }
 
-    online = cpupool_online_cpumask(d->cpupool);
+    online = cpupool_domain_cpumask(d);
 
     spin_lock(&d->node_affinity_lock);
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 9e0fef5..08de32d 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -664,7 +664,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             goto maxvcpu_out;
 
         ret = -ENOMEM;
-        online = cpupool_online_cpumask(d->cpupool);
+        online = cpupool_domain_cpumask(d);
         if ( max > d->max_vcpus )
         {
             struct vcpu **vcpus;
@@ -757,7 +757,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
             cpumask_var_t new_affinity, old_affinity;
-            cpumask_t *online = cpupool_online_cpumask(v->domain->cpupool);;
+            cpumask_t *online = cpupool_domain_cpumask(v->domain);;
 
             /*
              * We want to be able to restore hard affinity if we are trying
diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index cff5da9..dbe02ed 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -667,7 +667,7 @@ a653sched_pick_cpu(const struct scheduler *ops, struct vcpu *vc)
      * If present, prefer vc's current processor, else
      * just find the first valid vcpu .
      */
-    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
+    online = cpupool_domain_cpumask(vc->domain);
 
     cpu = cpumask_first(online);
 
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 57967c1..df2fce7 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -309,7 +309,7 @@ __runq_remove(struct csched_vcpu *svc)
 static inline int __vcpu_has_soft_affinity(const struct vcpu *vc,
                                            const cpumask_t *mask)
 {
-    return !cpumask_subset(cpupool_online_cpumask(vc->domain->cpupool),
+    return !cpumask_subset(cpupool_domain_cpumask(vc->domain),
                            vc->cpu_soft_affinity) &&
            !cpumask_subset(vc->cpu_hard_affinity, vc->cpu_soft_affinity) &&
            cpumask_intersects(vc->cpu_soft_affinity, mask);
@@ -372,9 +372,7 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     ASSERT(cur);
     cpumask_clear(&mask);
 
-    /* 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));
+    online = cpupool_domain_cpumask(new->sdom->dom);
     cpumask_and(&idle_mask, prv->idlers, online);
     idlers_empty = cpumask_empty(&idle_mask);
 
@@ -642,7 +640,7 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
     int balance_step;
 
     /* Store in cpus the mask of online cpus on which the domain can run */
-    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
+    online = cpupool_domain_cpumask(vc->domain);
     cpumask_and(&cpus, vc->cpu_hard_affinity, online);
 
     for_each_csched_balance_step( balance_step )
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 4372486..08611c8 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -256,7 +256,7 @@ rt_dump_vcpu(const struct scheduler *ops, const struct rt_vcpu *svc)
      */
     mask = _cpumask_scratch[svc->vcpu->processor];
 
-    cpupool_mask = cpupool_scheduler_cpumask(svc->vcpu->domain->cpupool);
+    cpupool_mask = cpupool_domain_cpumask(svc->vcpu->domain);
     cpumask_and(mask, cpupool_mask, svc->vcpu->cpu_hard_affinity);
     cpulist_scnprintf(keyhandler_scratch, sizeof(keyhandler_scratch), mask);
     printk("[%5d.%-2u] cpu %u, (%"PRI_stime", %"PRI_stime"),"
@@ -673,7 +673,7 @@ rt_cpu_pick(const struct scheduler *ops, struct vcpu *vc)
     cpumask_t *online;
     int cpu;
 
-    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
+    online = cpupool_domain_cpumask(vc->domain);
     cpumask_and(&cpus, online, vc->cpu_hard_affinity);
 
     cpu = cpumask_test_cpu(vc->processor, &cpus)
@@ -753,7 +753,7 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
         iter_svc = __q_elem(iter);
 
         /* mask cpu_hard_affinity & cpupool & mask */
-        online = cpupool_scheduler_cpumask(iter_svc->vcpu->domain->cpupool);
+        online = cpupool_domain_cpumask(iter_svc->vcpu->domain);
         cpumask_and(&cpu_common, online, iter_svc->vcpu->cpu_hard_affinity);
         cpumask_and(&cpu_common, mask, &cpu_common);
         if ( cpumask_empty(&cpu_common) )
@@ -965,7 +965,7 @@ runq_tickle(const struct scheduler *ops, struct rt_vcpu *new)
     if ( new == NULL || is_idle_vcpu(new->vcpu) )
         return;
 
-    online = cpupool_scheduler_cpumask(new->vcpu->domain->cpupool);
+    online = cpupool_domain_cpumask(new->vcpu->domain);
     cpumask_and(&not_tickled, online, new->vcpu->cpu_hard_affinity);
     cpumask_andnot(&not_tickled, &not_tickled, &prv->tickled);
 
@@ -1078,7 +1078,7 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
 
     ASSERT(!list_empty(&prv->sdom));
     sdom = list_entry(prv->sdom.next, struct rt_dom, sdom_elem);
-    online = cpupool_scheduler_cpumask(sdom->dom->cpupool);
+    online = cpupool_domain_cpumask(sdom->dom);
     snext = __runq_pick(ops, online); /* pick snext from ALL valid cpus */
 
     runq_tickle(ops, snext);
@@ -1113,7 +1113,7 @@ rt_context_saved(const struct scheduler *ops, struct vcpu *vc)
 
         ASSERT(!list_empty(&prv->sdom));
         sdom = list_entry(prv->sdom.next, struct rt_dom, sdom_elem);
-        online = cpupool_scheduler_cpumask(sdom->dom->cpupool);
+        online = cpupool_domain_cpumask(sdom->dom);
         snext = __runq_pick(ops, online); /* pick snext from ALL cpus */
 
         runq_tickle(ops, snext);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 3eefed7..5ffa1a1 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -79,7 +79,7 @@ static struct scheduler __read_mostly ops;
 
 #define DOM2OP(_d)    (((_d)->cpupool == NULL) ? &ops : ((_d)->cpupool->sched))
 #define VCPU2OP(_v)   (DOM2OP((_v)->domain))
-#define VCPU2ONLINE(_v) cpupool_online_cpumask((_v)->domain->cpupool)
+#define VCPU2ONLINE(_v) cpupool_domain_cpumask((_v)->domain)
 
 static inline void trace_runstate_change(struct vcpu *v, int new_state)
 {
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index dbe7cab..493d43f 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -182,9 +182,17 @@ struct cpupool
     atomic_t         refcnt;
 };
 
-#define cpupool_scheduler_cpumask(_pool) \
-    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
 #define cpupool_online_cpumask(_pool) \
     (((_pool) == NULL) ? &cpu_online_map : (_pool)->cpu_valid)
 
+static inline cpumask_t* cpupool_domain_cpumask(struct domain *d)
+{
+    /*
+     * d->cpupool is NULL only for the idle domain, and no one should
+     * be interested in calling this for the idle domain.
+     */
+    ASSERT(d->cpupool != NULL);
+    return d->cpupool->cpu_valid;
+}
+
 #endif /* __XEN_SCHED_IF_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 Sat Oct 03 20:25:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25: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 1ZiTMs-0005gD-SE; Sat, 03 Oct 2015 20:25:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMs-0005g2-CN
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:18 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	0A/2B-19110-DA930165; Sat, 03 Oct 2015 20:25:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1443903915!19402162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19997 invoked from network); 3 Oct 2015 20:25:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:25:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMp-0003pz-8q
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMp-00012V-4T
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:15 +0000
Date: Sat, 03 Oct 2015 20:25:15 +0000
Message-Id: <E1ZiTMp-00012V-4T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: get rid of
	cpupool_scheduler_cpumask()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c9cf46cefcf2cfb920c14e9ac2c53c371366cf2
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Sep 30 14:45:23 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:45:23 2015 +0200

    sched: get rid of cpupool_scheduler_cpumask()
    
    and of (almost every) direct use of cpupool_online_cpumask().
    
    In fact, what we really want for the most of the times,
    is the set of valid pCPUs of the cpupool a certain domain
    is part of. Furthermore, in case it's called with a NULL
    pool as argument, cpupool_scheduler_cpumask() does more
    harm than good, by returning the bitmask of free pCPUs!
    
    This commit, therefore:
     * gets rid of cpupool_scheduler_cpumask(), in favour of
       cpupool_domain_cpumask(), which makes it more evident
       what we are after, and accommodates some sanity checking;
     * replaces some of the calls to cpupool_online_cpumask()
       with calls to the new functions too.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Acked-by: Joshua Whitehead <josh.whitehead@dornerworks.com>
    Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/domain.c         |    5 +++--
 xen/common/domctl.c         |    4 ++--
 xen/common/sched_arinc653.c |    2 +-
 xen/common/sched_credit.c   |    8 +++-----
 xen/common/sched_rt.c       |   12 ++++++------
 xen/common/schedule.c       |    2 +-
 xen/include/xen/sched-if.h  |   12 ++++++++++--
 7 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8e7a282..cda60a9 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -191,7 +191,8 @@ struct vcpu *alloc_vcpu(
     /* Must be called after making new vcpu visible to for_each_vcpu(). */
     vcpu_check_shutdown(v);
 
-    domain_update_node_affinity(d);
+    if ( !is_idle_domain(d) )
+        domain_update_node_affinity(d);
 
     return v;
 }
@@ -444,7 +445,7 @@ void domain_update_node_affinity(struct domain *d)
         return;
     }
 
-    online = cpupool_online_cpumask(d->cpupool);
+    online = cpupool_domain_cpumask(d);
 
     spin_lock(&d->node_affinity_lock);
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 9e0fef5..08de32d 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -664,7 +664,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             goto maxvcpu_out;
 
         ret = -ENOMEM;
-        online = cpupool_online_cpumask(d->cpupool);
+        online = cpupool_domain_cpumask(d);
         if ( max > d->max_vcpus )
         {
             struct vcpu **vcpus;
@@ -757,7 +757,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
             cpumask_var_t new_affinity, old_affinity;
-            cpumask_t *online = cpupool_online_cpumask(v->domain->cpupool);;
+            cpumask_t *online = cpupool_domain_cpumask(v->domain);;
 
             /*
              * We want to be able to restore hard affinity if we are trying
diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index cff5da9..dbe02ed 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -667,7 +667,7 @@ a653sched_pick_cpu(const struct scheduler *ops, struct vcpu *vc)
      * If present, prefer vc's current processor, else
      * just find the first valid vcpu .
      */
-    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
+    online = cpupool_domain_cpumask(vc->domain);
 
     cpu = cpumask_first(online);
 
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 57967c1..df2fce7 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -309,7 +309,7 @@ __runq_remove(struct csched_vcpu *svc)
 static inline int __vcpu_has_soft_affinity(const struct vcpu *vc,
                                            const cpumask_t *mask)
 {
-    return !cpumask_subset(cpupool_online_cpumask(vc->domain->cpupool),
+    return !cpumask_subset(cpupool_domain_cpumask(vc->domain),
                            vc->cpu_soft_affinity) &&
            !cpumask_subset(vc->cpu_hard_affinity, vc->cpu_soft_affinity) &&
            cpumask_intersects(vc->cpu_soft_affinity, mask);
@@ -372,9 +372,7 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     ASSERT(cur);
     cpumask_clear(&mask);
 
-    /* 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));
+    online = cpupool_domain_cpumask(new->sdom->dom);
     cpumask_and(&idle_mask, prv->idlers, online);
     idlers_empty = cpumask_empty(&idle_mask);
 
@@ -642,7 +640,7 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
     int balance_step;
 
     /* Store in cpus the mask of online cpus on which the domain can run */
-    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
+    online = cpupool_domain_cpumask(vc->domain);
     cpumask_and(&cpus, vc->cpu_hard_affinity, online);
 
     for_each_csched_balance_step( balance_step )
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 4372486..08611c8 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -256,7 +256,7 @@ rt_dump_vcpu(const struct scheduler *ops, const struct rt_vcpu *svc)
      */
     mask = _cpumask_scratch[svc->vcpu->processor];
 
-    cpupool_mask = cpupool_scheduler_cpumask(svc->vcpu->domain->cpupool);
+    cpupool_mask = cpupool_domain_cpumask(svc->vcpu->domain);
     cpumask_and(mask, cpupool_mask, svc->vcpu->cpu_hard_affinity);
     cpulist_scnprintf(keyhandler_scratch, sizeof(keyhandler_scratch), mask);
     printk("[%5d.%-2u] cpu %u, (%"PRI_stime", %"PRI_stime"),"
@@ -673,7 +673,7 @@ rt_cpu_pick(const struct scheduler *ops, struct vcpu *vc)
     cpumask_t *online;
     int cpu;
 
-    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
+    online = cpupool_domain_cpumask(vc->domain);
     cpumask_and(&cpus, online, vc->cpu_hard_affinity);
 
     cpu = cpumask_test_cpu(vc->processor, &cpus)
@@ -753,7 +753,7 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
         iter_svc = __q_elem(iter);
 
         /* mask cpu_hard_affinity & cpupool & mask */
-        online = cpupool_scheduler_cpumask(iter_svc->vcpu->domain->cpupool);
+        online = cpupool_domain_cpumask(iter_svc->vcpu->domain);
         cpumask_and(&cpu_common, online, iter_svc->vcpu->cpu_hard_affinity);
         cpumask_and(&cpu_common, mask, &cpu_common);
         if ( cpumask_empty(&cpu_common) )
@@ -965,7 +965,7 @@ runq_tickle(const struct scheduler *ops, struct rt_vcpu *new)
     if ( new == NULL || is_idle_vcpu(new->vcpu) )
         return;
 
-    online = cpupool_scheduler_cpumask(new->vcpu->domain->cpupool);
+    online = cpupool_domain_cpumask(new->vcpu->domain);
     cpumask_and(&not_tickled, online, new->vcpu->cpu_hard_affinity);
     cpumask_andnot(&not_tickled, &not_tickled, &prv->tickled);
 
@@ -1078,7 +1078,7 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
 
     ASSERT(!list_empty(&prv->sdom));
     sdom = list_entry(prv->sdom.next, struct rt_dom, sdom_elem);
-    online = cpupool_scheduler_cpumask(sdom->dom->cpupool);
+    online = cpupool_domain_cpumask(sdom->dom);
     snext = __runq_pick(ops, online); /* pick snext from ALL valid cpus */
 
     runq_tickle(ops, snext);
@@ -1113,7 +1113,7 @@ rt_context_saved(const struct scheduler *ops, struct vcpu *vc)
 
         ASSERT(!list_empty(&prv->sdom));
         sdom = list_entry(prv->sdom.next, struct rt_dom, sdom_elem);
-        online = cpupool_scheduler_cpumask(sdom->dom->cpupool);
+        online = cpupool_domain_cpumask(sdom->dom);
         snext = __runq_pick(ops, online); /* pick snext from ALL cpus */
 
         runq_tickle(ops, snext);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 3eefed7..5ffa1a1 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -79,7 +79,7 @@ static struct scheduler __read_mostly ops;
 
 #define DOM2OP(_d)    (((_d)->cpupool == NULL) ? &ops : ((_d)->cpupool->sched))
 #define VCPU2OP(_v)   (DOM2OP((_v)->domain))
-#define VCPU2ONLINE(_v) cpupool_online_cpumask((_v)->domain->cpupool)
+#define VCPU2ONLINE(_v) cpupool_domain_cpumask((_v)->domain)
 
 static inline void trace_runstate_change(struct vcpu *v, int new_state)
 {
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index dbe7cab..493d43f 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -182,9 +182,17 @@ struct cpupool
     atomic_t         refcnt;
 };
 
-#define cpupool_scheduler_cpumask(_pool) \
-    (((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
 #define cpupool_online_cpumask(_pool) \
     (((_pool) == NULL) ? &cpu_online_map : (_pool)->cpu_valid)
 
+static inline cpumask_t* cpupool_domain_cpumask(struct domain *d)
+{
+    /*
+     * d->cpupool is NULL only for the idle domain, and no one should
+     * be interested in calling this for the idle domain.
+     */
+    ASSERT(d->cpupool != NULL);
+    return d->cpupool->cpu_valid;
+}
+
 #endif /* __XEN_SCHED_IF_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 Sat Oct 03 20:25:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25: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 1ZiTN3-0005hi-Um; Sat, 03 Oct 2015 20:25: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 1ZiTN2-0005hU-Ej
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:28 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	2A/CA-14422-7B930165; Sat, 03 Oct 2015 20:25:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1443903925!7550866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32025 invoked from network); 3 Oct 2015 20:25:26 -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;
	3 Oct 2015 20:25:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMz-0003vg-KV
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMz-00012z-Gh
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:25 +0000
Date: Sat, 03 Oct 2015 20:25:25 +0000
Message-Id: <E1ZiTMz-00012z-Gh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: adjustments to some performance
	counters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc6c3773b23c8ab974ed0a166735be0b2868be18
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Sep 30 14:46:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:46:02 2015 +0200

    sched: adjustments to some performance counters
    
    More specifically:
    
    1) rename vcpu_destroy to vcpu_remove
    
    It seems this have had to be done as part of 7e6b926a
    ("cpupools: Make interface more consistent"), which
    renamed the function but not the counter.
    
    In fact, because of cpupools, vcpus are not only removed
    from a scheduler when they are destroyed, but also when
    domains move between pools.
    
    Make the related statistics counter reflect that more
    properly.
    
    2) rename vcpu_init to vcpu_alloc
    
    As it lives in *_alloc_vdata.
    
    3) add vcpu_insert
    
    matching vcpu_remove, and useful to quickly check
    whether the number of insertions and removal matches,
    or in general investigare their relationship.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c    |    6 ++++--
 xen/common/sched_credit2.c   |    6 ++++--
 xen/common/sched_rt.c        |    6 ++++--
 xen/include/xen/perfc_defn.h |    5 +++--
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index df2fce7..b8f28fe 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -895,7 +895,7 @@ csched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
     svc->pri = is_idle_domain(vc->domain) ?
         CSCHED_PRI_IDLE : CSCHED_PRI_TS_UNDER;
     SCHED_VCPU_STATS_RESET(svc);
-    SCHED_STAT_CRANK(vcpu_init);
+    SCHED_STAT_CRANK(vcpu_alloc);
     return svc;
 }
 
@@ -906,6 +906,8 @@ csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(vc->processor, svc);
+
+    SCHED_STAT_CRANK(vcpu_insert);
 }
 
 static void
@@ -926,7 +928,7 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     struct csched_dom * const sdom = svc->sdom;
     unsigned long flags;
 
-    SCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_remove);
 
     if ( test_and_clear_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) )
     {
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 75e0321..bf1fe6f 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -796,7 +796,7 @@ csched2_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
         svc->weight = 0;
     }
 
-    SCHED_STAT_CRANK(vcpu_init);
+    SCHED_STAT_CRANK(vcpu_alloc);
 
     return svc;
 }
@@ -891,6 +891,8 @@ csched2_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
         vcpu_schedule_unlock_irq(lock, vc);
 
         sdom->nr_vcpus++;
+
+        SCHED_STAT_CRANK(vcpu_insert);
     }
 
     CSCHED2_VCPU_CHECK(vc);
@@ -917,7 +919,7 @@ csched2_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     {
         spinlock_t *lock;
 
-        SCHED_STAT_CRANK(vcpu_destroy);
+        SCHED_STAT_CRANK(vcpu_remove);
 
         /* Remove from runqueue */
         lock = vcpu_schedule_lock_irq(vc);
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 08611c8..4b5c5e4 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -597,7 +597,7 @@ rt_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
     if ( !is_idle_vcpu(vc) )
         svc->budget = RTDS_DEFAULT_BUDGET;
 
-    SCHED_STAT_CRANK(vcpu_init);
+    SCHED_STAT_CRANK(vcpu_alloc);
 
     return svc;
 }
@@ -635,6 +635,8 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 
     /* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
     list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
+
+    SCHED_STAT_CRANK(vcpu_insert);
 }
 
 /*
@@ -648,7 +650,7 @@ rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     struct rt_dom * const sdom = svc->sdom;
     spinlock_t *lock;
 
-    SCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_remove);
 
     BUG_ON( sdom == NULL );
 
diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h
index 526002d..76ee803 100644
--- a/xen/include/xen/perfc_defn.h
+++ b/xen/include/xen/perfc_defn.h
@@ -19,8 +19,9 @@ PERFCOUNTER(sched_ctx,              "sched: context switches")
 PERFCOUNTER(schedule,               "sched: specific scheduler")
 PERFCOUNTER(dom_init,               "sched: dom_init")
 PERFCOUNTER(dom_destroy,            "sched: dom_destroy")
-PERFCOUNTER(vcpu_init,              "sched: vcpu_init")
-PERFCOUNTER(vcpu_destroy,           "sched: vcpu_destroy")
+PERFCOUNTER(vcpu_alloc,             "sched: vcpu_alloc")
+PERFCOUNTER(vcpu_insert,            "sched: vcpu_insert")
+PERFCOUNTER(vcpu_remove,            "sched: vcpu_remove")
 PERFCOUNTER(vcpu_sleep,             "sched: vcpu_sleep")
 PERFCOUNTER(vcpu_wake_running,      "sched: vcpu_wake_running")
 PERFCOUNTER(vcpu_wake_onrunq,       "sched: vcpu_wake_onrunq")
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:25:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25: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 1ZiTN3-0005hi-Um; Sat, 03 Oct 2015 20:25: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 1ZiTN2-0005hU-Ej
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:28 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	2A/CA-14422-7B930165; Sat, 03 Oct 2015 20:25:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1443903925!7550866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32025 invoked from network); 3 Oct 2015 20:25:26 -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;
	3 Oct 2015 20:25:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMz-0003vg-KV
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTMz-00012z-Gh
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:25 +0000
Date: Sat, 03 Oct 2015 20:25:25 +0000
Message-Id: <E1ZiTMz-00012z-Gh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: adjustments to some performance
	counters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc6c3773b23c8ab974ed0a166735be0b2868be18
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Sep 30 14:46:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:46:02 2015 +0200

    sched: adjustments to some performance counters
    
    More specifically:
    
    1) rename vcpu_destroy to vcpu_remove
    
    It seems this have had to be done as part of 7e6b926a
    ("cpupools: Make interface more consistent"), which
    renamed the function but not the counter.
    
    In fact, because of cpupools, vcpus are not only removed
    from a scheduler when they are destroyed, but also when
    domains move between pools.
    
    Make the related statistics counter reflect that more
    properly.
    
    2) rename vcpu_init to vcpu_alloc
    
    As it lives in *_alloc_vdata.
    
    3) add vcpu_insert
    
    matching vcpu_remove, and useful to quickly check
    whether the number of insertions and removal matches,
    or in general investigare their relationship.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c    |    6 ++++--
 xen/common/sched_credit2.c   |    6 ++++--
 xen/common/sched_rt.c        |    6 ++++--
 xen/include/xen/perfc_defn.h |    5 +++--
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index df2fce7..b8f28fe 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -895,7 +895,7 @@ csched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
     svc->pri = is_idle_domain(vc->domain) ?
         CSCHED_PRI_IDLE : CSCHED_PRI_TS_UNDER;
     SCHED_VCPU_STATS_RESET(svc);
-    SCHED_STAT_CRANK(vcpu_init);
+    SCHED_STAT_CRANK(vcpu_alloc);
     return svc;
 }
 
@@ -906,6 +906,8 @@ csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(vc->processor, svc);
+
+    SCHED_STAT_CRANK(vcpu_insert);
 }
 
 static void
@@ -926,7 +928,7 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     struct csched_dom * const sdom = svc->sdom;
     unsigned long flags;
 
-    SCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_remove);
 
     if ( test_and_clear_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) )
     {
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 75e0321..bf1fe6f 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -796,7 +796,7 @@ csched2_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
         svc->weight = 0;
     }
 
-    SCHED_STAT_CRANK(vcpu_init);
+    SCHED_STAT_CRANK(vcpu_alloc);
 
     return svc;
 }
@@ -891,6 +891,8 @@ csched2_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
         vcpu_schedule_unlock_irq(lock, vc);
 
         sdom->nr_vcpus++;
+
+        SCHED_STAT_CRANK(vcpu_insert);
     }
 
     CSCHED2_VCPU_CHECK(vc);
@@ -917,7 +919,7 @@ csched2_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     {
         spinlock_t *lock;
 
-        SCHED_STAT_CRANK(vcpu_destroy);
+        SCHED_STAT_CRANK(vcpu_remove);
 
         /* Remove from runqueue */
         lock = vcpu_schedule_lock_irq(vc);
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 08611c8..4b5c5e4 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -597,7 +597,7 @@ rt_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
     if ( !is_idle_vcpu(vc) )
         svc->budget = RTDS_DEFAULT_BUDGET;
 
-    SCHED_STAT_CRANK(vcpu_init);
+    SCHED_STAT_CRANK(vcpu_alloc);
 
     return svc;
 }
@@ -635,6 +635,8 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 
     /* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
     list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
+
+    SCHED_STAT_CRANK(vcpu_insert);
 }
 
 /*
@@ -648,7 +650,7 @@ rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     struct rt_dom * const sdom = svc->sdom;
     spinlock_t *lock;
 
-    SCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_remove);
 
     BUG_ON( sdom == NULL );
 
diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h
index 526002d..76ee803 100644
--- a/xen/include/xen/perfc_defn.h
+++ b/xen/include/xen/perfc_defn.h
@@ -19,8 +19,9 @@ PERFCOUNTER(sched_ctx,              "sched: context switches")
 PERFCOUNTER(schedule,               "sched: specific scheduler")
 PERFCOUNTER(dom_init,               "sched: dom_init")
 PERFCOUNTER(dom_destroy,            "sched: dom_destroy")
-PERFCOUNTER(vcpu_init,              "sched: vcpu_init")
-PERFCOUNTER(vcpu_destroy,           "sched: vcpu_destroy")
+PERFCOUNTER(vcpu_alloc,             "sched: vcpu_alloc")
+PERFCOUNTER(vcpu_insert,            "sched: vcpu_insert")
+PERFCOUNTER(vcpu_remove,            "sched: vcpu_remove")
 PERFCOUNTER(vcpu_sleep,             "sched: vcpu_sleep")
 PERFCOUNTER(vcpu_wake_running,      "sched: vcpu_wake_running")
 PERFCOUNTER(vcpu_wake_onrunq,       "sched: vcpu_wake_onrunq")
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:25:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25: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 1ZiTND-0005j4-1E; Sat, 03 Oct 2015 20:25: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 1ZiTNC-0005iv-C9
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:38 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	78/53-02324-1C930165; Sat, 03 Oct 2015 20:25:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1443903936!39658266!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14508 invoked from network); 3 Oct 2015 20:25:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:25:36 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTN9-0003vo-Sb
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTN9-00013N-Qu
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:35 +0000
Date: Sat, 03 Oct 2015 20:25:35 +0000
Message-Id: <E1ZiTN9-00013N-Qu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce VM_EVENT_FLAG_SET_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 975efd3baa8dc5a0af8a9f3af6b95566339ae0b2
Author:     Razvan Cojocaru <rcojocaru@bitdefender.com>
AuthorDate: Wed Sep 30 14:46:32 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:46:32 2015 +0200

    introduce VM_EVENT_FLAG_SET_REGISTERS
    
    A previous version of this patch dealing with support for skipping
    the current instruction when a vm_event response requested it
    computed the instruction length in the hypervisor, adding non-trivial
    code dependencies. This patch allows a userspace vm_event client to
    simply request that the guest's EIP is set to an arbitary value,
    computed by the introspection application. The registers that can
    now be set are EAX-EDX, ESP, EBP, ESI, EDI, R8-R15, EFLAGS, and EIP.
    CR0, CR3 and CR4 are not set, as at the time of vm_event_resume()
    we can't call hvm_set_cr{0,3,4}() and simply setting
    v->arch.hvm_vcpu.guest_cr[{0,3,4}] is unlikely to have the desired
    effect. The rest of the vm_event registers are not set because
    they're not being filled by hvm_event_fill_regs(), but only by
    p2m_vm_event_fill_regs(). Currently x86-only.
    The VCPU needs to be paused for this flag to take effect.
    
    Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/vm_event.c        |   24 ++++++++++++++++++++++++
 xen/common/vm_event.c          |    3 +++
 xen/include/asm-arm/vm_event.h |    6 ++++++
 xen/include/asm-x86/vm_event.h |    2 ++
 xen/include/public/vm_event.h  |    7 +++++++
 5 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index c38d37b..9677ecc 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -97,6 +97,30 @@ void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
     }
 }
 
+void vm_event_set_registers(struct vcpu *v, vm_event_response_t *rsp)
+{
+    v->arch.user_regs.eax = rsp->data.regs.x86.rax;
+    v->arch.user_regs.ebx = rsp->data.regs.x86.rbx;
+    v->arch.user_regs.ecx = rsp->data.regs.x86.rcx;
+    v->arch.user_regs.edx = rsp->data.regs.x86.rdx;
+    v->arch.user_regs.esp = rsp->data.regs.x86.rsp;
+    v->arch.user_regs.ebp = rsp->data.regs.x86.rbp;
+    v->arch.user_regs.esi = rsp->data.regs.x86.rsi;
+    v->arch.user_regs.edi = rsp->data.regs.x86.rdi;
+
+    v->arch.user_regs.r8 = rsp->data.regs.x86.r8;
+    v->arch.user_regs.r9 = rsp->data.regs.x86.r9;
+    v->arch.user_regs.r10 = rsp->data.regs.x86.r10;
+    v->arch.user_regs.r11 = rsp->data.regs.x86.r11;
+    v->arch.user_regs.r12 = rsp->data.regs.x86.r12;
+    v->arch.user_regs.r13 = rsp->data.regs.x86.r13;
+    v->arch.user_regs.r14 = rsp->data.regs.x86.r14;
+    v->arch.user_regs.r15 = rsp->data.regs.x86.r15;
+
+    v->arch.user_regs.eflags = rsp->data.regs.x86.rflags;
+    v->arch.user_regs.eip = rsp->data.regs.x86.rip;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index ef84b0f..e1f9580 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -417,6 +417,9 @@ void vm_event_resume(struct domain *d, struct vm_event_domain *ved)
 
         if ( rsp.flags & VM_EVENT_FLAG_VCPU_PAUSED )
         {
+            if ( rsp.flags & VM_EVENT_FLAG_SET_REGISTERS )
+                vm_event_set_registers(v, &rsp);
+
             if ( rsp.flags & VM_EVENT_FLAG_TOGGLE_SINGLESTEP )
                 vm_event_toggle_singlestep(d, v);
 
diff --git a/xen/include/asm-arm/vm_event.h b/xen/include/asm-arm/vm_event.h
index 976fdf1..4d0fbf7 100644
--- a/xen/include/asm-arm/vm_event.h
+++ b/xen/include/asm-arm/vm_event.h
@@ -47,4 +47,10 @@ void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
     /* Not supported on ARM. */
 }
 
+static inline
+void vm_event_set_registers(struct vcpu *v, vm_event_response_t *rsp)
+{
+    /* Not supported on ARM. */
+}
+
 #endif /* __ASM_ARM_VM_EVENT_H__ */
diff --git a/xen/include/asm-x86/vm_event.h b/xen/include/asm-x86/vm_event.h
index 2ff2cab..5aff834 100644
--- a/xen/include/asm-x86/vm_event.h
+++ b/xen/include/asm-x86/vm_event.h
@@ -42,4 +42,6 @@ void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v);
 
 void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp);
 
+void vm_event_set_registers(struct vcpu *v, vm_event_response_t *rsp);
+
 #endif /* __ASM_X86_VM_EVENT_H__ */
diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
index ff2f217..9270d52 100644
--- a/xen/include/public/vm_event.h
+++ b/xen/include/public/vm_event.h
@@ -89,6 +89,13 @@
  * by the altp2m_idx response field if possible.
  */
 #define VM_EVENT_FLAG_ALTERNATE_P2M      (1 << 7)
+/*
+ * Set the vCPU registers to the values in the  vm_event response.
+ * At the moment x86-only, applies to EAX-EDX, ESP, EBP, ESI, EDI, R8-R15,
+ * EFLAGS, and EIP.
+ * Requires the vCPU to be paused already (synchronous events only).
+ */
+#define VM_EVENT_FLAG_SET_REGISTERS      (1 << 8)
 
 /*
  * Reasons for the vm event request
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:25:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25: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 1ZiTND-0005j4-1E; Sat, 03 Oct 2015 20:25: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 1ZiTNC-0005iv-C9
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:38 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	78/53-02324-1C930165; Sat, 03 Oct 2015 20:25:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1443903936!39658266!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14508 invoked from network); 3 Oct 2015 20:25:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:25:36 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTN9-0003vo-Sb
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTN9-00013N-Qu
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:35 +0000
Date: Sat, 03 Oct 2015 20:25:35 +0000
Message-Id: <E1ZiTN9-00013N-Qu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce VM_EVENT_FLAG_SET_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 975efd3baa8dc5a0af8a9f3af6b95566339ae0b2
Author:     Razvan Cojocaru <rcojocaru@bitdefender.com>
AuthorDate: Wed Sep 30 14:46:32 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 14:46:32 2015 +0200

    introduce VM_EVENT_FLAG_SET_REGISTERS
    
    A previous version of this patch dealing with support for skipping
    the current instruction when a vm_event response requested it
    computed the instruction length in the hypervisor, adding non-trivial
    code dependencies. This patch allows a userspace vm_event client to
    simply request that the guest's EIP is set to an arbitary value,
    computed by the introspection application. The registers that can
    now be set are EAX-EDX, ESP, EBP, ESI, EDI, R8-R15, EFLAGS, and EIP.
    CR0, CR3 and CR4 are not set, as at the time of vm_event_resume()
    we can't call hvm_set_cr{0,3,4}() and simply setting
    v->arch.hvm_vcpu.guest_cr[{0,3,4}] is unlikely to have the desired
    effect. The rest of the vm_event registers are not set because
    they're not being filled by hvm_event_fill_regs(), but only by
    p2m_vm_event_fill_regs(). Currently x86-only.
    The VCPU needs to be paused for this flag to take effect.
    
    Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/vm_event.c        |   24 ++++++++++++++++++++++++
 xen/common/vm_event.c          |    3 +++
 xen/include/asm-arm/vm_event.h |    6 ++++++
 xen/include/asm-x86/vm_event.h |    2 ++
 xen/include/public/vm_event.h  |    7 +++++++
 5 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index c38d37b..9677ecc 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -97,6 +97,30 @@ void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
     }
 }
 
+void vm_event_set_registers(struct vcpu *v, vm_event_response_t *rsp)
+{
+    v->arch.user_regs.eax = rsp->data.regs.x86.rax;
+    v->arch.user_regs.ebx = rsp->data.regs.x86.rbx;
+    v->arch.user_regs.ecx = rsp->data.regs.x86.rcx;
+    v->arch.user_regs.edx = rsp->data.regs.x86.rdx;
+    v->arch.user_regs.esp = rsp->data.regs.x86.rsp;
+    v->arch.user_regs.ebp = rsp->data.regs.x86.rbp;
+    v->arch.user_regs.esi = rsp->data.regs.x86.rsi;
+    v->arch.user_regs.edi = rsp->data.regs.x86.rdi;
+
+    v->arch.user_regs.r8 = rsp->data.regs.x86.r8;
+    v->arch.user_regs.r9 = rsp->data.regs.x86.r9;
+    v->arch.user_regs.r10 = rsp->data.regs.x86.r10;
+    v->arch.user_regs.r11 = rsp->data.regs.x86.r11;
+    v->arch.user_regs.r12 = rsp->data.regs.x86.r12;
+    v->arch.user_regs.r13 = rsp->data.regs.x86.r13;
+    v->arch.user_regs.r14 = rsp->data.regs.x86.r14;
+    v->arch.user_regs.r15 = rsp->data.regs.x86.r15;
+
+    v->arch.user_regs.eflags = rsp->data.regs.x86.rflags;
+    v->arch.user_regs.eip = rsp->data.regs.x86.rip;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index ef84b0f..e1f9580 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -417,6 +417,9 @@ void vm_event_resume(struct domain *d, struct vm_event_domain *ved)
 
         if ( rsp.flags & VM_EVENT_FLAG_VCPU_PAUSED )
         {
+            if ( rsp.flags & VM_EVENT_FLAG_SET_REGISTERS )
+                vm_event_set_registers(v, &rsp);
+
             if ( rsp.flags & VM_EVENT_FLAG_TOGGLE_SINGLESTEP )
                 vm_event_toggle_singlestep(d, v);
 
diff --git a/xen/include/asm-arm/vm_event.h b/xen/include/asm-arm/vm_event.h
index 976fdf1..4d0fbf7 100644
--- a/xen/include/asm-arm/vm_event.h
+++ b/xen/include/asm-arm/vm_event.h
@@ -47,4 +47,10 @@ void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
     /* Not supported on ARM. */
 }
 
+static inline
+void vm_event_set_registers(struct vcpu *v, vm_event_response_t *rsp)
+{
+    /* Not supported on ARM. */
+}
+
 #endif /* __ASM_ARM_VM_EVENT_H__ */
diff --git a/xen/include/asm-x86/vm_event.h b/xen/include/asm-x86/vm_event.h
index 2ff2cab..5aff834 100644
--- a/xen/include/asm-x86/vm_event.h
+++ b/xen/include/asm-x86/vm_event.h
@@ -42,4 +42,6 @@ void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v);
 
 void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp);
 
+void vm_event_set_registers(struct vcpu *v, vm_event_response_t *rsp);
+
 #endif /* __ASM_X86_VM_EVENT_H__ */
diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
index ff2f217..9270d52 100644
--- a/xen/include/public/vm_event.h
+++ b/xen/include/public/vm_event.h
@@ -89,6 +89,13 @@
  * by the altp2m_idx response field if possible.
  */
 #define VM_EVENT_FLAG_ALTERNATE_P2M      (1 << 7)
+/*
+ * Set the vCPU registers to the values in the  vm_event response.
+ * At the moment x86-only, applies to EAX-EDX, ESP, EBP, ESI, EDI, R8-R15,
+ * EFLAGS, and EIP.
+ * Requires the vCPU to be paused already (synchronous events only).
+ */
+#define VM_EVENT_FLAG_SET_REGISTERS      (1 << 8)
 
 /*
  * Reasons for the vm event request
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:25:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25: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 1ZiTNO-0005kt-5v; Sat, 03 Oct 2015 20:25: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 1ZiTNM-0005ki-Ty
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:49 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	B7/5C-18886-CC930165; Sat, 03 Oct 2015 20:25:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1443903946!23058452!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23153 invoked from network); 3 Oct 2015 20:25:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:25:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTNK-0003vw-4W
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTNK-00013j-2z
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:46 +0000
Date: Sat, 03 Oct 2015 20:25:46 +0000
Message-Id: <E1ZiTNK-00013j-2z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't shadow global "socket" in
	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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d776ffe95324a45626a635cf46e9e9b436083a12
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Sep 30 15:54:11 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Sep 30 16:41:11 2015 +0100

    libxl: don't shadow global "socket" in psr code
    
    SLES11 and OpenSUSE 11.4 complain:
    
    [ 1227s] libxl_psr.c: In function 'libxl_psr_cat_get_l3_info':
    [ 1227s] libxl_psr.c:342: error: declaration of 'socket' shadows a > global declaration
    
    Change "socket" to "socketid" to fix the problem.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Chao Peng <chao.p.peng@linux.intel.com>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_psr.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 30740a1..000d748 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,7 +339,7 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i = 0, socket, nr_sockets;
+    int i = 0, socketid, nr_sockets;
     libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
@@ -360,10 +360,10 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    libxl_for_each_set_bit(socket, socketmap) {
-        ptr[i].id = socket;
-        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
-                                                     &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socketid, socketmap) {
+        ptr[i].id = socketid;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socketid, &ptr[i].cos_max,
+                                   &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 03 20:25:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Oct 2015 20:25: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 1ZiTNO-0005kt-5v; Sat, 03 Oct 2015 20:25: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 1ZiTNM-0005ki-Ty
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:49 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	B7/5C-18886-CC930165; Sat, 03 Oct 2015 20:25:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1443903946!23058452!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23153 invoked from network); 3 Oct 2015 20:25:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2015 20:25:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTNK-0003vw-4W
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZiTNK-00013j-2z
	for xen-changelog@lists.xensource.com; Sat, 03 Oct 2015 20:25:46 +0000
Date: Sat, 03 Oct 2015 20:25:46 +0000
Message-Id: <E1ZiTNK-00013j-2z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't shadow global "socket" in
	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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d776ffe95324a45626a635cf46e9e9b436083a12
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Sep 30 15:54:11 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Sep 30 16:41:11 2015 +0100

    libxl: don't shadow global "socket" in psr code
    
    SLES11 and OpenSUSE 11.4 complain:
    
    [ 1227s] libxl_psr.c: In function 'libxl_psr_cat_get_l3_info':
    [ 1227s] libxl_psr.c:342: error: declaration of 'socket' shadows a > global declaration
    
    Change "socket" to "socketid" to fix the problem.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Chao Peng <chao.p.peng@linux.intel.com>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_psr.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 30740a1..000d748 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,7 +339,7 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i = 0, socket, nr_sockets;
+    int i = 0, socketid, nr_sockets;
     libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
@@ -360,10 +360,10 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    libxl_for_each_set_bit(socket, socketmap) {
-        ptr[i].id = socket;
-        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
-                                                     &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socketid, socketmap) {
+        ptr[i].id = socketid;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socketid, &ptr[i].cos_max,
+                                   &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zidxt-0006OZ-5E; Sun, 04 Oct 2015 07:44: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 1Zidxs-0006OU-CL
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:12 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	16/3E-01748-BC8D0165; Sun, 04 Oct 2015 07:44:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1443944650!50031454!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26752 invoked from network); 4 Oct 2015 07:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2015 07:44:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidxp-0000pH-QG
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidxp-0002G8-A8
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:09 +0000
Date: Sun, 04 Oct 2015 07:44:09 +0000
Message-Id: <E1Zidxp-0002G8-A8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/EPT: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c7f97b04895d9d1228264fcdef1fc08f19c02c99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 15:14:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:14:12 2015 +0200

    x86/EPT: tighten conditions of IOMMU mapping updates
    
    Permission changes should also result in updates or TLB flushes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 6c0e4ad60850032c9bbd5d18b8446421c97e08e4
    master date: 2015-09-29 10:25:29 +0200
---
 xen/arch/x86/mm/p2m-ept.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 2f3df91..16f4535 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -668,6 +668,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     uint8_t ipat = 0;
     int need_modify_vtd_table = 1;
     int vtd_pte_present = 0;
+    unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
     enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
@@ -798,8 +799,9 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         new_entry.mfn = mfn_x(mfn);
 
         /* Safe to read-then-write because we hold the p2m lock */
-        if ( ept_entry->mfn == new_entry.mfn )
-             need_modify_vtd_table = 0;
+        if ( ept_entry->mfn == new_entry.mfn &&
+             p2m_get_iommu_flags(ept_entry->sa_p2mt) == iommu_flags )
+            need_modify_vtd_table = 0;
 
         ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
     }
@@ -830,11 +832,9 @@ out:
             iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present);
         else
         {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
+            if ( iommu_flags )
                 for ( i = 0; i < (1 << order); i++ )
-                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, flags);
+                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, iommu_flags);
             else
                 for ( i = 0; i < (1 << order); i++ )
                     iommu_unmap_page(d, gfn + i);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zidxt-0006OZ-5E; Sun, 04 Oct 2015 07:44: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 1Zidxs-0006OU-CL
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:12 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	16/3E-01748-BC8D0165; Sun, 04 Oct 2015 07:44:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1443944650!50031454!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26752 invoked from network); 4 Oct 2015 07:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2015 07:44:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidxp-0000pH-QG
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidxp-0002G8-A8
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:09 +0000
Date: Sun, 04 Oct 2015 07:44:09 +0000
Message-Id: <E1Zidxp-0002G8-A8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/EPT: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c7f97b04895d9d1228264fcdef1fc08f19c02c99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 15:14:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:14:12 2015 +0200

    x86/EPT: tighten conditions of IOMMU mapping updates
    
    Permission changes should also result in updates or TLB flushes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 6c0e4ad60850032c9bbd5d18b8446421c97e08e4
    master date: 2015-09-29 10:25:29 +0200
---
 xen/arch/x86/mm/p2m-ept.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 2f3df91..16f4535 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -668,6 +668,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     uint8_t ipat = 0;
     int need_modify_vtd_table = 1;
     int vtd_pte_present = 0;
+    unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
     enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
@@ -798,8 +799,9 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         new_entry.mfn = mfn_x(mfn);
 
         /* Safe to read-then-write because we hold the p2m lock */
-        if ( ept_entry->mfn == new_entry.mfn )
-             need_modify_vtd_table = 0;
+        if ( ept_entry->mfn == new_entry.mfn &&
+             p2m_get_iommu_flags(ept_entry->sa_p2mt) == iommu_flags )
+            need_modify_vtd_table = 0;
 
         ept_p2m_type_to_flags(p2m, &new_entry, p2mt, p2ma);
     }
@@ -830,11 +832,9 @@ out:
             iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present);
         else
         {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
+            if ( iommu_flags )
                 for ( i = 0; i < (1 << order); i++ )
-                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, flags);
+                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, iommu_flags);
             else
                 for ( i = 0; i < (1 << order); i++ )
                     iommu_unmap_page(d, gfn + i);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44: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 1Zidy3-0006PA-7d; Sun, 04 Oct 2015 07:44:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidy2-0006P3-J9
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:22 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	60/F0-13905-5D8D0165; Sun, 04 Oct 2015 07:44:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1443944660!34432231!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21366 invoked from network); 4 Oct 2015 07:44:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2015 07:44:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidy0-0000pL-9f
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidy0-0002Gk-5k
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:20 +0000
Date: Sun, 04 Oct 2015 07:44:20 +0000
Message-Id: <E1Zidy0-0002Gk-5k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] PVH Dom0 RMRR IOMMU mapping
	regression 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 db9375dbde236c1e3c4a63724b3460b41e5a5037
Author:     Elena Ufimtseva <elena.ufimtseva@oracle.com>
AuthorDate: Tue Sep 29 15:15:14 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:15:14 2015 +0200

    PVH Dom0 RMRR IOMMU mapping regression fix
    
    This patch addresses a regression introduced by commit
    5ae03990c120a7b3067a52d9784c9aa72c0705a6 in new set_identity_p2m_entry.
    RMRRs are not being mapped in IOMMU for PVH Dom0. This causes pages faults and
    some long 'hang-like' delays during Dom0 PVH boot and device assignments.
    
    During construct_dom0, in PVH path p2m is being constructed and identity mapped
    in IOMMU. The p2m type is p2m_mmio_direct and p2m access p2m_rwx.
    New code used to map RMRRs invoked from rmrr_identity_mapping
    checks if p2m entry exists with same type and access and if yes, skips iommu
    mapping. Since there are p2m entries for pvh dom0 iomem, RMRRs are not being
    mapped in IOMMU.
    
    As was mentioned in the earlier discussion, the PVH Dom0 construction code
    should be modified to properly map RMRR regions in IOMMU. Since change will be
    too invasive, this solution is a temporary fix at this time before better
    solution is in. Also as Jan mentioned, there is no need in having 'x' permissions
    for p2m entry of a mmio region, thus changed here.
    
    Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 0e9e09880d5f65ccb178d6c5785305ecf5715bba
    master date: 2015-09-29 13:53:31 +0200
---
 xen/arch/x86/domain_build.c |    4 ++--
 xen/arch/x86/mm/p2m.c       |    9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 18cf6aa..bca6fe7 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -432,9 +432,9 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
         }
 
         if ( rangeset_contains_singleton(mmio_ro_ranges, mfn + i) )
-            a = p2m_access_rx;
+            a = p2m_access_r;
         else
-            a = p2m_access_rwx;
+            a = p2m_access_rw;
 
         if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 6b4a35b..c6b883d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -971,7 +971,16 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
         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;
+        /*
+         * PVH fixme: during Dom0 PVH construction, p2m entries are being set
+         * but iomem regions are not mapped with IOMMU. This makes sure that
+         * RMRRs are correctly mapped with IOMMU.
+         */
+        if ( is_hardware_domain(d) && !iommu_use_hap_pt(d) )
+            ret = iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
+    }
     else
     {
         if ( flag & XEN_DOMCTL_DEV_RDM_RELAXED )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44: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 1Zidy3-0006PA-7d; Sun, 04 Oct 2015 07:44:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidy2-0006P3-J9
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:22 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	60/F0-13905-5D8D0165; Sun, 04 Oct 2015 07:44:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1443944660!34432231!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21366 invoked from network); 4 Oct 2015 07:44:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2015 07:44:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidy0-0000pL-9f
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zidy0-0002Gk-5k
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:20 +0000
Date: Sun, 04 Oct 2015 07:44:20 +0000
Message-Id: <E1Zidy0-0002Gk-5k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] PVH Dom0 RMRR IOMMU mapping
	regression 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 db9375dbde236c1e3c4a63724b3460b41e5a5037
Author:     Elena Ufimtseva <elena.ufimtseva@oracle.com>
AuthorDate: Tue Sep 29 15:15:14 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:15:14 2015 +0200

    PVH Dom0 RMRR IOMMU mapping regression fix
    
    This patch addresses a regression introduced by commit
    5ae03990c120a7b3067a52d9784c9aa72c0705a6 in new set_identity_p2m_entry.
    RMRRs are not being mapped in IOMMU for PVH Dom0. This causes pages faults and
    some long 'hang-like' delays during Dom0 PVH boot and device assignments.
    
    During construct_dom0, in PVH path p2m is being constructed and identity mapped
    in IOMMU. The p2m type is p2m_mmio_direct and p2m access p2m_rwx.
    New code used to map RMRRs invoked from rmrr_identity_mapping
    checks if p2m entry exists with same type and access and if yes, skips iommu
    mapping. Since there are p2m entries for pvh dom0 iomem, RMRRs are not being
    mapped in IOMMU.
    
    As was mentioned in the earlier discussion, the PVH Dom0 construction code
    should be modified to properly map RMRR regions in IOMMU. Since change will be
    too invasive, this solution is a temporary fix at this time before better
    solution is in. Also as Jan mentioned, there is no need in having 'x' permissions
    for p2m entry of a mmio region, thus changed here.
    
    Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 0e9e09880d5f65ccb178d6c5785305ecf5715bba
    master date: 2015-09-29 13:53:31 +0200
---
 xen/arch/x86/domain_build.c |    4 ++--
 xen/arch/x86/mm/p2m.c       |    9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 18cf6aa..bca6fe7 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -432,9 +432,9 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
         }
 
         if ( rangeset_contains_singleton(mmio_ro_ranges, mfn + i) )
-            a = p2m_access_rx;
+            a = p2m_access_r;
         else
-            a = p2m_access_rwx;
+            a = p2m_access_rw;
 
         if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 6b4a35b..c6b883d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -971,7 +971,16 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
         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;
+        /*
+         * PVH fixme: during Dom0 PVH construction, p2m entries are being set
+         * but iomem regions are not mapped with IOMMU. This makes sure that
+         * RMRRs are correctly mapped with IOMMU.
+         */
+        if ( is_hardware_domain(d) && !iommu_use_hap_pt(d) )
+            ret = iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
+    }
     else
     {
         if ( flag & XEN_DOMCTL_DEV_RDM_RELAXED )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZidyE-0006QT-AA; Sun, 04 Oct 2015 07:44:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyD-0006QK-5D
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:33 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	77/3D-19220-0E8D0165; Sun, 04 Oct 2015 07:44:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1443944670!39695799!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31327 invoked from network); 4 Oct 2015 07:44:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2015 07:44:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyA-0000pX-Np
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyA-0002HH-KM
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:30 +0000
Date: Sun, 04 Oct 2015 07:44:30 +0000
Message-Id: <E1ZidyA-0002HH-KM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/p2m-pt: delay freeing of
	intermediate page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddcd1ee18e078677ccdba471d8c9daf83cb6ee29
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 15:15:53 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:15:53 2015 +0200

    x86/p2m-pt: delay freeing of intermediate page tables
    
    Old intermediate page tables must be freed only after IOMMU side
    updates/flushes have got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 960265fbd878cdc9841473b755e4ccc9eb1942d2
    master date: 2015-09-29 13:55:34 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 1a77cc8..1ced7b5 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -487,8 +487,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     /* XXX -- this might be able to be faster iff current->domain == d */
     void *table;
     unsigned long i, gfn_remainder = gfn;
-    l1_pgentry_t *p2m_entry;
-    l1_pgentry_t entry_content;
+    l1_pgentry_t *p2m_entry, entry_content;
+    /* Intermediate table to free if we're replacing it with a superpage. */
+    l1_pgentry_t intermediate_entry = l1e_empty();
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rc;
@@ -538,7 +539,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
      */
     if ( page_order == PAGE_ORDER_1G )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
@@ -548,7 +548,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -566,10 +566,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
     else 
     {
@@ -610,7 +606,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     }
     else if ( page_order == PAGE_ORDER_2M )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
@@ -622,7 +617,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -643,10 +638,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
@@ -674,6 +665,14 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
     }
 
+    /*
+     * Free old intermediate tables if necessary.  This has to be the
+     * last thing we do, after removal from the IOMMU tables, so as to
+     * avoid a potential use-after-free.
+     */
+    if ( l1e_get_flags(intermediate_entry) & _PAGE_PRESENT )
+        p2m_free_entry(p2m, &intermediate_entry, page_order);
+
  out:
     unmap_domain_page(table);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZidyE-0006QT-AA; Sun, 04 Oct 2015 07:44:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyD-0006QK-5D
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:33 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	77/3D-19220-0E8D0165; Sun, 04 Oct 2015 07:44:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1443944670!39695799!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31327 invoked from network); 4 Oct 2015 07:44:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2015 07:44:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyA-0000pX-Np
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyA-0002HH-KM
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:30 +0000
Date: Sun, 04 Oct 2015 07:44:30 +0000
Message-Id: <E1ZidyA-0002HH-KM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/p2m-pt: delay freeing of
	intermediate page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddcd1ee18e078677ccdba471d8c9daf83cb6ee29
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 15:15:53 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:15:53 2015 +0200

    x86/p2m-pt: delay freeing of intermediate page tables
    
    Old intermediate page tables must be freed only after IOMMU side
    updates/flushes have got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 960265fbd878cdc9841473b755e4ccc9eb1942d2
    master date: 2015-09-29 13:55:34 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 1a77cc8..1ced7b5 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -487,8 +487,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     /* XXX -- this might be able to be faster iff current->domain == d */
     void *table;
     unsigned long i, gfn_remainder = gfn;
-    l1_pgentry_t *p2m_entry;
-    l1_pgentry_t entry_content;
+    l1_pgentry_t *p2m_entry, entry_content;
+    /* Intermediate table to free if we're replacing it with a superpage. */
+    l1_pgentry_t intermediate_entry = l1e_empty();
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rc;
@@ -538,7 +539,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
      */
     if ( page_order == PAGE_ORDER_1G )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
@@ -548,7 +548,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -566,10 +566,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
     else 
     {
@@ -610,7 +606,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     }
     else if ( page_order == PAGE_ORDER_2M )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
@@ -622,7 +617,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -643,10 +638,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
@@ -674,6 +665,14 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
     }
 
+    /*
+     * Free old intermediate tables if necessary.  This has to be the
+     * last thing we do, after removal from the IOMMU tables, so as to
+     * avoid a potential use-after-free.
+     */
+    if ( l1e_get_flags(intermediate_entry) & _PAGE_PRESENT )
+        p2m_free_entry(p2m, &intermediate_entry, page_order);
+
  out:
     unmap_domain_page(table);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZidyO-0006Ro-Co; Sun, 04 Oct 2015 07:44:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyN-0006RW-Nu
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:43 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	93/9E-25435-AE8D0165; Sun, 04 Oct 2015 07:44:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1443944681!22588686!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6908 invoked from network); 4 Oct 2015 07:44:42 -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;
	4 Oct 2015 07:44:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyL-0000pf-14
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyK-0002Hu-US
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:40 +0000
Date: Sun, 04 Oct 2015 07:44:40 +0000
Message-Id: <E1ZidyK-0002Hu-US@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/p2m-pt: ignore pt-share flag
	for shadow mode guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0f27c4bb5671bea9cb97e150635ecfc1f68ec8b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 15:16:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:16:27 2015 +0200

    x86/p2m-pt: ignore pt-share flag for shadow mode guests
    
    There is no page table sharing in shadow mode.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: c0a85795d864dd64c116af661bf676d66ddfd5fc
    master date: 2015-09-29 13:56:03 +0200
---
 xen/arch/x86/mm/p2m-pt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 1ced7b5..4645581 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -647,7 +647,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
     if ( iommu_enabled && need_iommu(p2m->domain) )
     {
-        if ( iommu_hap_pt_share )
+        if ( iommu_use_hap_pt(p2m->domain) )
         {
             if ( old_mfn && (old_mfn != mfn_x(mfn)) )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZidyO-0006Ro-Co; Sun, 04 Oct 2015 07:44:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyN-0006RW-Nu
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:43 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	93/9E-25435-AE8D0165; Sun, 04 Oct 2015 07:44:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1443944681!22588686!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6908 invoked from network); 4 Oct 2015 07:44:42 -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;
	4 Oct 2015 07:44:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyL-0000pf-14
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyK-0002Hu-US
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:40 +0000
Date: Sun, 04 Oct 2015 07:44:40 +0000
Message-Id: <E1ZidyK-0002Hu-US@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/p2m-pt: ignore pt-share flag
	for shadow mode guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0f27c4bb5671bea9cb97e150635ecfc1f68ec8b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 15:16:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 15:16:27 2015 +0200

    x86/p2m-pt: ignore pt-share flag for shadow mode guests
    
    There is no page table sharing in shadow mode.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: c0a85795d864dd64c116af661bf676d66ddfd5fc
    master date: 2015-09-29 13:56:03 +0200
---
 xen/arch/x86/mm/p2m-pt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 1ced7b5..4645581 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -647,7 +647,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
     if ( iommu_enabled && need_iommu(p2m->domain) )
     {
-        if ( iommu_hap_pt_share )
+        if ( iommu_use_hap_pt(p2m->domain) )
         {
             if ( old_mfn && (old_mfn != mfn_x(mfn)) )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZidyZ-0006TV-FN; Sun, 04 Oct 2015 07:44: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 1ZidyY-0006TI-16
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:54 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	F9/CF-32615-5F8D0165; Sun, 04 Oct 2015 07:44:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1443944691!7594728!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20406 invoked from network); 4 Oct 2015 07:44:52 -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;
	4 Oct 2015 07:44:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyV-0000pn-Em
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyV-0002IP-9H
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:51 +0000
Date: Sun, 04 Oct 2015 07:44:51 +0000
Message-Id: <E1ZidyV-0002IP-9H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] libxl: don't shadow global
	"socket" in 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a15b47f4ce37c3ff0ea6d68418fbb88517fcdb9c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Sep 30 15:54:11 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Sep 30 16:41:42 2015 +0100

    libxl: don't shadow global "socket" in psr code
    
    SLES11 and OpenSUSE 11.4 complain:
    
    [ 1227s] libxl_psr.c: In function 'libxl_psr_cat_get_l3_info':
    [ 1227s] libxl_psr.c:342: error: declaration of 'socket' shadows a > global declaration
    
    Change "socket" to "socketid" to fix the problem.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Chao Peng <chao.p.peng@linux.intel.com>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit d776ffe95324a45626a635cf46e9e9b436083a12)
---
 tools/libxl/libxl_psr.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 30740a1..000d748 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,7 +339,7 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i = 0, socket, nr_sockets;
+    int i = 0, socketid, nr_sockets;
     libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
@@ -360,10 +360,10 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    libxl_for_each_set_bit(socket, socketmap) {
-        ptr[i].id = socket;
-        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
-                                                     &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socketid, socketmap) {
+        ptr[i].id = socketid;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socketid, &ptr[i].cos_max,
+                                   &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 04 07:44:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Oct 2015 07:44:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZidyZ-0006TV-FN; Sun, 04 Oct 2015 07:44: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 1ZidyY-0006TI-16
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:54 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	F9/CF-32615-5F8D0165; Sun, 04 Oct 2015 07:44:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1443944691!7594728!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20406 invoked from network); 4 Oct 2015 07:44:52 -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;
	4 Oct 2015 07:44:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyV-0000pn-Em
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZidyV-0002IP-9H
	for xen-changelog@lists.xensource.com; Sun, 04 Oct 2015 07:44:51 +0000
Date: Sun, 04 Oct 2015 07:44:51 +0000
Message-Id: <E1ZidyV-0002IP-9H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] libxl: don't shadow global
	"socket" in 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a15b47f4ce37c3ff0ea6d68418fbb88517fcdb9c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Sep 30 15:54:11 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Sep 30 16:41:42 2015 +0100

    libxl: don't shadow global "socket" in psr code
    
    SLES11 and OpenSUSE 11.4 complain:
    
    [ 1227s] libxl_psr.c: In function 'libxl_psr_cat_get_l3_info':
    [ 1227s] libxl_psr.c:342: error: declaration of 'socket' shadows a > global declaration
    
    Change "socket" to "socketid" to fix the problem.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Chao Peng <chao.p.peng@linux.intel.com>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit d776ffe95324a45626a635cf46e9e9b436083a12)
---
 tools/libxl/libxl_psr.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 30740a1..000d748 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,7 +339,7 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i = 0, socket, nr_sockets;
+    int i = 0, socketid, nr_sockets;
     libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
@@ -360,10 +360,10 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    libxl_for_each_set_bit(socket, socketmap) {
-        ptr[i].id = socket;
-        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
-                                                     &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socketid, socketmap) {
+        ptr[i].id = socketid;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socketid, &ptr[i].cos_max,
+                                   &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:22:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22: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 1ZjAOn-0008AY-FO; Mon, 05 Oct 2015 18:22:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOm-0008AT-BH
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:08 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	49/74-04752-FCFB2165; Mon, 05 Oct 2015 18:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1444069325!19077468!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7131 invoked from network); 5 Oct 2015 18:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOj-0004ue-Ek
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOi-00042a-Fm
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:04 +0000
Date: Mon, 05 Oct 2015 18:22:04 +0000
Message-Id: <E1ZjAOi-00042a-Fm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move perform_gunzip to common
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3d278130e2c250030280540909f2ff8e97a9b418
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Sep 29 16:59:03 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 12:52:57 2015 +0100

    xen: move perform_gunzip to common
    
    The current gunzip code to decompress the Dom0 kernel is implemented in
    inflate.c which is included by bzimage.c.
    
    I am looking to doing the same on ARM64 but there is quite a bit of
    boilerplate definitions that I would need to import in order for
    inflate.c to work correctly.
    
    Instead of copying/pasting the code from x86/bzimage.c, move those
    definitions to a new common file, gunzip.c. Export only perform_gunzip
    and gzip_check. Leave output_length where it is.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    CC: andrew.cooper3@citrix.com
---
 xen/arch/x86/bzimage.c   |  134 +--------------------------------------------
 xen/common/Makefile      |    1 +
 xen/common/gunzip.c      |  137 ++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/gunzip.h |    7 ++
 4 files changed, 146 insertions(+), 133 deletions(-)

diff --git a/xen/arch/x86/bzimage.c b/xen/arch/x86/bzimage.c
index c86c39e..50ebb84 100644
--- a/xen/arch/x86/bzimage.c
+++ b/xen/arch/x86/bzimage.c
@@ -4,148 +4,16 @@
 #include <xen/mm.h>
 #include <xen/string.h>
 #include <xen/types.h>
+#include <xen/gunzip.h>
 #include <xen/decompress.h>
 #include <xen/libelf.h>
 #include <asm/bzimage.h>
 
-#define HEAPORDER 3
-
-static unsigned char *__initdata window;
-#define memptr long
-static memptr __initdata free_mem_ptr;
-static memptr __initdata free_mem_end_ptr;
-
-#define WSIZE           0x80000000
-
-static unsigned char *__initdata inbuf;
-static unsigned __initdata insize;
-
-/* Index of next byte to be processed in inbuf: */
-static unsigned __initdata inptr;
-
-/* Bytes in output buffer: */
-static unsigned __initdata outcnt;
-
-#define OF(args)        args
-#define STATIC          static
-
-#define memzero(s, n)   memset((s), 0, (n))
-
-typedef unsigned char   uch;
-typedef unsigned short  ush;
-typedef unsigned long   ulg;
-
-#define INIT            __init
-#define INITDATA        __initdata
-
-#define get_byte()      (inptr < insize ? inbuf[inptr++] : fill_inbuf())
-
-/* Diagnostic functions */
-#ifdef DEBUG
-#  define Assert(cond, msg) do { if (!(cond)) error(msg); } while (0)
-#  define Trace(x)      do { fprintf x; } while (0)
-#  define Tracev(x)     do { if (verbose) fprintf x ; } while (0)
-#  define Tracevv(x)    do { if (verbose > 1) fprintf x ; } while (0)
-#  define Tracec(c, x)  do { if (verbose && (c)) fprintf x ; } while (0)
-#  define Tracecv(c, x) do { if (verbose > 1 && (c)) fprintf x ; } while (0)
-#else
-#  define Assert(cond, msg)
-#  define Trace(x)
-#  define Tracev(x)
-#  define Tracevv(x)
-#  define Tracec(c, x)
-#  define Tracecv(c, x)
-#endif
-
-static long __initdata bytes_out;
-static void flush_window(void);
-
-static __init void error(char *x)
-{
-    panic("%s", x);
-}
-
-static __init int fill_inbuf(void)
-{
-        error("ran out of input data");
-        return 0;
-}
-
-
-#include "../../common/inflate.c"
-
-static __init void flush_window(void)
-{
-    /*
-     * The window is equal to the output buffer therefore only need to
-     * compute the crc.
-     */
-    unsigned long c = crc;
-    unsigned n;
-    unsigned char *in, ch;
-
-    in = window;
-    for ( n = 0; n < outcnt; n++ )
-    {
-        ch = *in++;
-        c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
-    }
-    crc = c;
-
-    bytes_out += (unsigned long)outcnt;
-    outcnt = 0;
-}
-
 static __init unsigned long output_length(char *image, unsigned long image_len)
 {
     return *(uint32_t *)&image[image_len - 4];
 }
 
-static __init int gzip_check(char *image, unsigned long image_len)
-{
-    unsigned char magic0, magic1;
-
-    if ( image_len < 2 )
-        return 0;
-
-    magic0 = (unsigned char)image[0];
-    magic1 = (unsigned char)image[1];
-
-    return (magic0 == 0x1f) && ((magic1 == 0x8b) || (magic1 == 0x9e));
-}
-
-static __init int perform_gunzip(char *output, char *image, unsigned long image_len)
-{
-    int rc;
-
-    if ( !gzip_check(image, image_len) )
-        return 1;
-
-    window = (unsigned char *)output;
-
-    free_mem_ptr = (unsigned long)alloc_xenheap_pages(HEAPORDER, 0);
-    free_mem_end_ptr = free_mem_ptr + (PAGE_SIZE << HEAPORDER);
-
-    inbuf = (unsigned char *)image;
-    insize = image_len;
-    inptr = 0;
-
-    makecrc();
-
-    if ( gunzip() < 0 )
-    {
-        rc = -EINVAL;
-    }
-    else
-    {
-        rc = 0;
-    }
-
-    free_xenheap_pages((void *)free_mem_ptr, HEAPORDER);
-
-    return rc;
-}
-
 struct __packed setup_header {
         uint8_t         _pad0[0x1f1];           /* skip uninteresting stuff */
         uint8_t         setup_sects;
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 1726fac..b290c16 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -10,6 +10,7 @@ obj-y += event_channel.o
 obj-y += event_fifo.o
 obj-y += grant_table.o
 obj-y += guestcopy.o
+obj-bin-y += gunzip.init.o
 obj-y += irq.o
 obj-y += kernel.o
 obj-y += keyhandler.o
diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c
new file mode 100644
index 0000000..41d71ef
--- /dev/null
+++ b/xen/common/gunzip.c
@@ -0,0 +1,137 @@
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/mm.h>
+
+#define HEAPORDER 3
+
+static unsigned char *__initdata window;
+#define memptr long
+static memptr __initdata free_mem_ptr;
+static memptr __initdata free_mem_end_ptr;
+
+#define WSIZE           0x80000000
+
+static unsigned char *__initdata inbuf;
+static unsigned __initdata insize;
+
+/* Index of next byte to be processed in inbuf: */
+static unsigned __initdata inptr;
+
+/* Bytes in output buffer: */
+static unsigned __initdata outcnt;
+
+#define OF(args)        args
+#define STATIC          static
+
+#define memzero(s, n)   memset((s), 0, (n))
+
+typedef unsigned char   uch;
+typedef unsigned short  ush;
+typedef unsigned long   ulg;
+
+#define INIT            __init
+#define INITDATA        __initdata
+
+#define get_byte()      (inptr < insize ? inbuf[inptr++] : fill_inbuf())
+
+/* Diagnostic functions */
+#ifdef DEBUG
+#  define Assert(cond, msg) do { if (!(cond)) error(msg); } while (0)
+#  define Trace(x)      do { fprintf x; } while (0)
+#  define Tracev(x)     do { if (verbose) fprintf x ; } while (0)
+#  define Tracevv(x)    do { if (verbose > 1) fprintf x ; } while (0)
+#  define Tracec(c, x)  do { if (verbose && (c)) fprintf x ; } while (0)
+#  define Tracecv(c, x) do { if (verbose > 1 && (c)) fprintf x ; } while (0)
+#else
+#  define Assert(cond, msg)
+#  define Trace(x)
+#  define Tracev(x)
+#  define Tracevv(x)
+#  define Tracec(c, x)
+#  define Tracecv(c, x)
+#endif
+
+static long __initdata bytes_out;
+static void flush_window(void);
+
+static __init void error(char *x)
+{
+    panic("%s", x);
+}
+
+static __init int fill_inbuf(void)
+{
+        error("ran out of input data");
+        return 0;
+}
+
+
+#include "inflate.c"
+
+static __init void flush_window(void)
+{
+    /*
+     * The window is equal to the output buffer therefore only need to
+     * compute the crc.
+     */
+    unsigned long c = crc;
+    unsigned n;
+    unsigned char *in, ch;
+
+    in = window;
+    for ( n = 0; n < outcnt; n++ )
+    {
+        ch = *in++;
+        c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
+    }
+    crc = c;
+
+    bytes_out += (unsigned long)outcnt;
+    outcnt = 0;
+}
+
+__init int gzip_check(char *image, unsigned long image_len)
+{
+    unsigned char magic0, magic1;
+
+    if ( image_len < 2 )
+        return 0;
+
+    magic0 = (unsigned char)image[0];
+    magic1 = (unsigned char)image[1];
+
+    return (magic0 == 0x1f) && ((magic1 == 0x8b) || (magic1 == 0x9e));
+}
+
+__init int perform_gunzip(char *output, char *image, unsigned long image_len)
+{
+    int rc;
+
+    if ( !gzip_check(image, image_len) )
+        return 1;
+
+    window = (unsigned char *)output;
+
+    free_mem_ptr = (unsigned long)alloc_xenheap_pages(HEAPORDER, 0);
+    free_mem_end_ptr = free_mem_ptr + (PAGE_SIZE << HEAPORDER);
+
+    inbuf = (unsigned char *)image;
+    insize = image_len;
+    inptr = 0;
+
+    makecrc();
+
+    if ( gunzip() < 0 )
+    {
+        rc = -EINVAL;
+    }
+    else
+    {
+        rc = 0;
+    }
+
+    free_xenheap_pages((void *)free_mem_ptr, HEAPORDER);
+
+    return rc;
+}
diff --git a/xen/include/xen/gunzip.h b/xen/include/xen/gunzip.h
new file mode 100644
index 0000000..8058331
--- /dev/null
+++ b/xen/include/xen/gunzip.h
@@ -0,0 +1,7 @@
+#ifndef __XEN_GUNZIP_H
+#define __XEN_GUNZIP_H
+
+int gzip_check(char *image, unsigned long image_len);
+int perform_gunzip(char *output, char *image, unsigned long image_len);
+
+#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 Mon Oct 05 18:22:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22: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 1ZjAOn-0008AY-FO; Mon, 05 Oct 2015 18:22:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOm-0008AT-BH
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:08 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	49/74-04752-FCFB2165; Mon, 05 Oct 2015 18:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1444069325!19077468!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7131 invoked from network); 5 Oct 2015 18:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOj-0004ue-Ek
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOi-00042a-Fm
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:04 +0000
Date: Mon, 05 Oct 2015 18:22:04 +0000
Message-Id: <E1ZjAOi-00042a-Fm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move perform_gunzip to common
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3d278130e2c250030280540909f2ff8e97a9b418
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Sep 29 16:59:03 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 12:52:57 2015 +0100

    xen: move perform_gunzip to common
    
    The current gunzip code to decompress the Dom0 kernel is implemented in
    inflate.c which is included by bzimage.c.
    
    I am looking to doing the same on ARM64 but there is quite a bit of
    boilerplate definitions that I would need to import in order for
    inflate.c to work correctly.
    
    Instead of copying/pasting the code from x86/bzimage.c, move those
    definitions to a new common file, gunzip.c. Export only perform_gunzip
    and gzip_check. Leave output_length where it is.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    CC: andrew.cooper3@citrix.com
---
 xen/arch/x86/bzimage.c   |  134 +--------------------------------------------
 xen/common/Makefile      |    1 +
 xen/common/gunzip.c      |  137 ++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/gunzip.h |    7 ++
 4 files changed, 146 insertions(+), 133 deletions(-)

diff --git a/xen/arch/x86/bzimage.c b/xen/arch/x86/bzimage.c
index c86c39e..50ebb84 100644
--- a/xen/arch/x86/bzimage.c
+++ b/xen/arch/x86/bzimage.c
@@ -4,148 +4,16 @@
 #include <xen/mm.h>
 #include <xen/string.h>
 #include <xen/types.h>
+#include <xen/gunzip.h>
 #include <xen/decompress.h>
 #include <xen/libelf.h>
 #include <asm/bzimage.h>
 
-#define HEAPORDER 3
-
-static unsigned char *__initdata window;
-#define memptr long
-static memptr __initdata free_mem_ptr;
-static memptr __initdata free_mem_end_ptr;
-
-#define WSIZE           0x80000000
-
-static unsigned char *__initdata inbuf;
-static unsigned __initdata insize;
-
-/* Index of next byte to be processed in inbuf: */
-static unsigned __initdata inptr;
-
-/* Bytes in output buffer: */
-static unsigned __initdata outcnt;
-
-#define OF(args)        args
-#define STATIC          static
-
-#define memzero(s, n)   memset((s), 0, (n))
-
-typedef unsigned char   uch;
-typedef unsigned short  ush;
-typedef unsigned long   ulg;
-
-#define INIT            __init
-#define INITDATA        __initdata
-
-#define get_byte()      (inptr < insize ? inbuf[inptr++] : fill_inbuf())
-
-/* Diagnostic functions */
-#ifdef DEBUG
-#  define Assert(cond, msg) do { if (!(cond)) error(msg); } while (0)
-#  define Trace(x)      do { fprintf x; } while (0)
-#  define Tracev(x)     do { if (verbose) fprintf x ; } while (0)
-#  define Tracevv(x)    do { if (verbose > 1) fprintf x ; } while (0)
-#  define Tracec(c, x)  do { if (verbose && (c)) fprintf x ; } while (0)
-#  define Tracecv(c, x) do { if (verbose > 1 && (c)) fprintf x ; } while (0)
-#else
-#  define Assert(cond, msg)
-#  define Trace(x)
-#  define Tracev(x)
-#  define Tracevv(x)
-#  define Tracec(c, x)
-#  define Tracecv(c, x)
-#endif
-
-static long __initdata bytes_out;
-static void flush_window(void);
-
-static __init void error(char *x)
-{
-    panic("%s", x);
-}
-
-static __init int fill_inbuf(void)
-{
-        error("ran out of input data");
-        return 0;
-}
-
-
-#include "../../common/inflate.c"
-
-static __init void flush_window(void)
-{
-    /*
-     * The window is equal to the output buffer therefore only need to
-     * compute the crc.
-     */
-    unsigned long c = crc;
-    unsigned n;
-    unsigned char *in, ch;
-
-    in = window;
-    for ( n = 0; n < outcnt; n++ )
-    {
-        ch = *in++;
-        c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
-    }
-    crc = c;
-
-    bytes_out += (unsigned long)outcnt;
-    outcnt = 0;
-}
-
 static __init unsigned long output_length(char *image, unsigned long image_len)
 {
     return *(uint32_t *)&image[image_len - 4];
 }
 
-static __init int gzip_check(char *image, unsigned long image_len)
-{
-    unsigned char magic0, magic1;
-
-    if ( image_len < 2 )
-        return 0;
-
-    magic0 = (unsigned char)image[0];
-    magic1 = (unsigned char)image[1];
-
-    return (magic0 == 0x1f) && ((magic1 == 0x8b) || (magic1 == 0x9e));
-}
-
-static __init int perform_gunzip(char *output, char *image, unsigned long image_len)
-{
-    int rc;
-
-    if ( !gzip_check(image, image_len) )
-        return 1;
-
-    window = (unsigned char *)output;
-
-    free_mem_ptr = (unsigned long)alloc_xenheap_pages(HEAPORDER, 0);
-    free_mem_end_ptr = free_mem_ptr + (PAGE_SIZE << HEAPORDER);
-
-    inbuf = (unsigned char *)image;
-    insize = image_len;
-    inptr = 0;
-
-    makecrc();
-
-    if ( gunzip() < 0 )
-    {
-        rc = -EINVAL;
-    }
-    else
-    {
-        rc = 0;
-    }
-
-    free_xenheap_pages((void *)free_mem_ptr, HEAPORDER);
-
-    return rc;
-}
-
 struct __packed setup_header {
         uint8_t         _pad0[0x1f1];           /* skip uninteresting stuff */
         uint8_t         setup_sects;
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 1726fac..b290c16 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -10,6 +10,7 @@ obj-y += event_channel.o
 obj-y += event_fifo.o
 obj-y += grant_table.o
 obj-y += guestcopy.o
+obj-bin-y += gunzip.init.o
 obj-y += irq.o
 obj-y += kernel.o
 obj-y += keyhandler.o
diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c
new file mode 100644
index 0000000..41d71ef
--- /dev/null
+++ b/xen/common/gunzip.c
@@ -0,0 +1,137 @@
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/mm.h>
+
+#define HEAPORDER 3
+
+static unsigned char *__initdata window;
+#define memptr long
+static memptr __initdata free_mem_ptr;
+static memptr __initdata free_mem_end_ptr;
+
+#define WSIZE           0x80000000
+
+static unsigned char *__initdata inbuf;
+static unsigned __initdata insize;
+
+/* Index of next byte to be processed in inbuf: */
+static unsigned __initdata inptr;
+
+/* Bytes in output buffer: */
+static unsigned __initdata outcnt;
+
+#define OF(args)        args
+#define STATIC          static
+
+#define memzero(s, n)   memset((s), 0, (n))
+
+typedef unsigned char   uch;
+typedef unsigned short  ush;
+typedef unsigned long   ulg;
+
+#define INIT            __init
+#define INITDATA        __initdata
+
+#define get_byte()      (inptr < insize ? inbuf[inptr++] : fill_inbuf())
+
+/* Diagnostic functions */
+#ifdef DEBUG
+#  define Assert(cond, msg) do { if (!(cond)) error(msg); } while (0)
+#  define Trace(x)      do { fprintf x; } while (0)
+#  define Tracev(x)     do { if (verbose) fprintf x ; } while (0)
+#  define Tracevv(x)    do { if (verbose > 1) fprintf x ; } while (0)
+#  define Tracec(c, x)  do { if (verbose && (c)) fprintf x ; } while (0)
+#  define Tracecv(c, x) do { if (verbose > 1 && (c)) fprintf x ; } while (0)
+#else
+#  define Assert(cond, msg)
+#  define Trace(x)
+#  define Tracev(x)
+#  define Tracevv(x)
+#  define Tracec(c, x)
+#  define Tracecv(c, x)
+#endif
+
+static long __initdata bytes_out;
+static void flush_window(void);
+
+static __init void error(char *x)
+{
+    panic("%s", x);
+}
+
+static __init int fill_inbuf(void)
+{
+        error("ran out of input data");
+        return 0;
+}
+
+
+#include "inflate.c"
+
+static __init void flush_window(void)
+{
+    /*
+     * The window is equal to the output buffer therefore only need to
+     * compute the crc.
+     */
+    unsigned long c = crc;
+    unsigned n;
+    unsigned char *in, ch;
+
+    in = window;
+    for ( n = 0; n < outcnt; n++ )
+    {
+        ch = *in++;
+        c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
+    }
+    crc = c;
+
+    bytes_out += (unsigned long)outcnt;
+    outcnt = 0;
+}
+
+__init int gzip_check(char *image, unsigned long image_len)
+{
+    unsigned char magic0, magic1;
+
+    if ( image_len < 2 )
+        return 0;
+
+    magic0 = (unsigned char)image[0];
+    magic1 = (unsigned char)image[1];
+
+    return (magic0 == 0x1f) && ((magic1 == 0x8b) || (magic1 == 0x9e));
+}
+
+__init int perform_gunzip(char *output, char *image, unsigned long image_len)
+{
+    int rc;
+
+    if ( !gzip_check(image, image_len) )
+        return 1;
+
+    window = (unsigned char *)output;
+
+    free_mem_ptr = (unsigned long)alloc_xenheap_pages(HEAPORDER, 0);
+    free_mem_end_ptr = free_mem_ptr + (PAGE_SIZE << HEAPORDER);
+
+    inbuf = (unsigned char *)image;
+    insize = image_len;
+    inptr = 0;
+
+    makecrc();
+
+    if ( gunzip() < 0 )
+    {
+        rc = -EINVAL;
+    }
+    else
+    {
+        rc = 0;
+    }
+
+    free_xenheap_pages((void *)free_mem_ptr, HEAPORDER);
+
+    return rc;
+}
diff --git a/xen/include/xen/gunzip.h b/xen/include/xen/gunzip.h
new file mode 100644
index 0000000..8058331
--- /dev/null
+++ b/xen/include/xen/gunzip.h
@@ -0,0 +1,7 @@
+#ifndef __XEN_GUNZIP_H
+#define __XEN_GUNZIP_H
+
+int gzip_check(char *image, unsigned long image_len);
+int perform_gunzip(char *output, char *image, unsigned long image_len);
+
+#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 Mon Oct 05 18:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAOx-0008BP-I7; Mon, 05 Oct 2015 18:22: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 1ZjAOw-0008BH-Rg
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:19 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	2B/5F-29649-9DFB2165; Mon, 05 Oct 2015 18:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1444069336!46056299!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24201 invoked from network); 5 Oct 2015 18:22:17 -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;
	5 Oct 2015 18:22:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOt-0004ui-RN
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOt-000438-OD
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:15 +0000
Date: Mon, 05 Oct 2015 18:22:15 +0000
Message-Id: <E1ZjAOt-000438-OD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support gzip compressed
	kernels
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c1be0b102e0e8c558753cb37ee681bf4230fe949
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Sep 29 16:59:04 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 12:52:57 2015 +0100

    xen/arm: support gzip compressed kernels
    
    Free the memory used for the compressed kernel and update the relative
    mod->start and mod->size parameters with the uncompressed ones.
    
    To decompress the kernel, allocate memory from dommheap, because freeing
    the modules is done by calling init_heap_pages, which frees to domheap.
    Map these pages using vmap, because they might not be in the linear 1:1
    map.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    CC: ian.campbell@citrix.com
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/kernel.c       |   88 ++++++++++++++++++++++++++++++++++++++----
 xen/arch/arm/setup.c        |    2 +-
 xen/include/asm-arm/setup.h |    2 +
 3 files changed, 82 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index f641b12..61808ac 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -13,6 +13,8 @@
 #include <asm/byteorder.h>
 #include <asm/setup.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/gunzip.h>
+#include <xen/vmap.h>
 
 #include "kernel.h"
 
@@ -257,6 +259,73 @@ static int kernel_uimage_probe(struct kernel_info *info,
     return 0;
 }
 
+static __init uint32_t output_length(char *image, unsigned long image_len)
+{
+    return *(uint32_t *)&image[image_len - 4];
+}
+
+static __init int kernel_decompress(struct bootmodule *mod)
+{
+    char *output, *input;
+    char magic[2];
+    int rc;
+    unsigned kernel_order_out;
+    paddr_t output_size;
+    struct page_info *pages;
+    mfn_t mfn;
+    int i;
+    paddr_t addr = mod->start;
+    paddr_t size = mod->size;
+
+    if ( size < 2 )
+        return -EINVAL;
+
+    copy_from_paddr(magic, addr, sizeof(magic));
+
+    /* only gzip is supported */
+    if ( !gzip_check(magic, size) )
+        return -EINVAL;
+
+    input = ioremap_cache(addr, size);
+    if ( input == NULL )
+        return -EFAULT;
+
+    output_size = output_length(input, size);
+    kernel_order_out = get_order_from_bytes(output_size);
+    pages = alloc_domheap_pages(NULL, kernel_order_out, 0);
+    if ( pages == NULL )
+    {
+        iounmap(input);
+        return -ENOMEM;
+    }
+    mfn = _mfn(page_to_mfn(pages));
+    output = __vmap(&mfn, 1 << kernel_order_out, 1, 1, PAGE_HYPERVISOR);
+
+    rc = perform_gunzip(output, input, size);
+    clean_dcache_va_range(output, output_size);
+    iounmap(input);
+    vunmap(output);
+
+    mod->start = page_to_maddr(pages);
+    mod->size = output_size;
+
+    /*
+     * Need to free pages after output_size here because they won't be
+     * freed by discard_initial_modules
+     */
+    i = DIV_ROUND_UP(output_size, PAGE_SIZE);
+    for ( ; i < (1 << kernel_order_out); i++ )
+        free_domheap_page(pages + i);
+
+    /*
+     * Free the original kernel, update the pointers to the
+     * decompressed kernel
+     */
+    dt_unreserved_regions(addr, addr + size, init_domheap_pages, 0);
+
+    return 0;
+}
+
 #ifdef CONFIG_ARM_64
 /*
  * Check if the image is a 64-bit Image.
@@ -444,8 +513,6 @@ int kernel_probe(struct kernel_info *info)
     struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_KERNEL);
     int rc;
 
-    paddr_t start, size;
-
     if ( !mod || !mod->size )
     {
         printk(XENLOG_ERR "Missing kernel boot module?\n");
@@ -453,25 +520,28 @@ int kernel_probe(struct kernel_info *info)
     }
 
     info->kernel_bootmodule = mod;
-    start = mod->start;
-    size = mod->size;
 
-    printk("Loading kernel from boot module @ %"PRIpaddr"\n", start);
+    printk("Loading kernel from boot module @ %"PRIpaddr"\n", mod->start);
 
     info->initrd_bootmodule = boot_module_find_by_kind(BOOTMOD_RAMDISK);
     if ( info->initrd_bootmodule )
         printk("Loading ramdisk from boot module @ %"PRIpaddr"\n",
                info->initrd_bootmodule->start);
 
+    /* if it is a gzip'ed image, 32bit or 64bit, uncompress it */
+    rc = kernel_decompress(mod);
+    if (rc < 0 && rc != -EINVAL)
+        return rc;
+
 #ifdef CONFIG_ARM_64
-    rc = kernel_zimage64_probe(info, start, size);
+    rc = kernel_zimage64_probe(info, mod->start, mod->size);
     if (rc < 0)
 #endif
-        rc = kernel_uimage_probe(info, start, size);
+        rc = kernel_uimage_probe(info, mod->start, mod->size);
     if (rc < 0)
-        rc = kernel_zimage32_probe(info, start, size);
+        rc = kernel_zimage32_probe(info, mod->start, mod->size);
     if (rc < 0)
-        rc = kernel_elf_probe(info, start, size);
+        rc = kernel_elf_probe(info, mod->start, mod->size);
 
     return rc;
 }
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 48f734f..e95759d 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -165,7 +165,7 @@ static void __init processor_id(void)
     processor_setup();
 }
 
-static void dt_unreserved_regions(paddr_t s, paddr_t e,
+void dt_unreserved_regions(paddr_t s, paddr_t e,
                                   void (*cb)(paddr_t, paddr_t), int first)
 {
     int i, nr = fdt_num_mem_rsv(device_tree_flattened);
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 81bb3da..30ac53b 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -54,6 +54,8 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
 int construct_dom0(struct domain *d);
 
 void discard_initial_modules(void);
+void dt_unreserved_regions(paddr_t s, paddr_t e,
+                           void (*cb)(paddr_t, paddr_t), int first);
 
 size_t __init boot_fdt_info(const void *fdt, paddr_t paddr);
 const char __init *boot_fdt_cmdline(const void *fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAOx-0008BP-I7; Mon, 05 Oct 2015 18:22: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 1ZjAOw-0008BH-Rg
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:19 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	2B/5F-29649-9DFB2165; Mon, 05 Oct 2015 18:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1444069336!46056299!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24201 invoked from network); 5 Oct 2015 18:22:17 -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;
	5 Oct 2015 18:22:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOt-0004ui-RN
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAOt-000438-OD
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:15 +0000
Date: Mon, 05 Oct 2015 18:22:15 +0000
Message-Id: <E1ZjAOt-000438-OD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support gzip compressed
	kernels
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c1be0b102e0e8c558753cb37ee681bf4230fe949
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Sep 29 16:59:04 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 12:52:57 2015 +0100

    xen/arm: support gzip compressed kernels
    
    Free the memory used for the compressed kernel and update the relative
    mod->start and mod->size parameters with the uncompressed ones.
    
    To decompress the kernel, allocate memory from dommheap, because freeing
    the modules is done by calling init_heap_pages, which frees to domheap.
    Map these pages using vmap, because they might not be in the linear 1:1
    map.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    CC: ian.campbell@citrix.com
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/kernel.c       |   88 ++++++++++++++++++++++++++++++++++++++----
 xen/arch/arm/setup.c        |    2 +-
 xen/include/asm-arm/setup.h |    2 +
 3 files changed, 82 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index f641b12..61808ac 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -13,6 +13,8 @@
 #include <asm/byteorder.h>
 #include <asm/setup.h>
 #include <xen/libfdt/libfdt.h>
+#include <xen/gunzip.h>
+#include <xen/vmap.h>
 
 #include "kernel.h"
 
@@ -257,6 +259,73 @@ static int kernel_uimage_probe(struct kernel_info *info,
     return 0;
 }
 
+static __init uint32_t output_length(char *image, unsigned long image_len)
+{
+    return *(uint32_t *)&image[image_len - 4];
+}
+
+static __init int kernel_decompress(struct bootmodule *mod)
+{
+    char *output, *input;
+    char magic[2];
+    int rc;
+    unsigned kernel_order_out;
+    paddr_t output_size;
+    struct page_info *pages;
+    mfn_t mfn;
+    int i;
+    paddr_t addr = mod->start;
+    paddr_t size = mod->size;
+
+    if ( size < 2 )
+        return -EINVAL;
+
+    copy_from_paddr(magic, addr, sizeof(magic));
+
+    /* only gzip is supported */
+    if ( !gzip_check(magic, size) )
+        return -EINVAL;
+
+    input = ioremap_cache(addr, size);
+    if ( input == NULL )
+        return -EFAULT;
+
+    output_size = output_length(input, size);
+    kernel_order_out = get_order_from_bytes(output_size);
+    pages = alloc_domheap_pages(NULL, kernel_order_out, 0);
+    if ( pages == NULL )
+    {
+        iounmap(input);
+        return -ENOMEM;
+    }
+    mfn = _mfn(page_to_mfn(pages));
+    output = __vmap(&mfn, 1 << kernel_order_out, 1, 1, PAGE_HYPERVISOR);
+
+    rc = perform_gunzip(output, input, size);
+    clean_dcache_va_range(output, output_size);
+    iounmap(input);
+    vunmap(output);
+
+    mod->start = page_to_maddr(pages);
+    mod->size = output_size;
+
+    /*
+     * Need to free pages after output_size here because they won't be
+     * freed by discard_initial_modules
+     */
+    i = DIV_ROUND_UP(output_size, PAGE_SIZE);
+    for ( ; i < (1 << kernel_order_out); i++ )
+        free_domheap_page(pages + i);
+
+    /*
+     * Free the original kernel, update the pointers to the
+     * decompressed kernel
+     */
+    dt_unreserved_regions(addr, addr + size, init_domheap_pages, 0);
+
+    return 0;
+}
+
 #ifdef CONFIG_ARM_64
 /*
  * Check if the image is a 64-bit Image.
@@ -444,8 +513,6 @@ int kernel_probe(struct kernel_info *info)
     struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_KERNEL);
     int rc;
 
-    paddr_t start, size;
-
     if ( !mod || !mod->size )
     {
         printk(XENLOG_ERR "Missing kernel boot module?\n");
@@ -453,25 +520,28 @@ int kernel_probe(struct kernel_info *info)
     }
 
     info->kernel_bootmodule = mod;
-    start = mod->start;
-    size = mod->size;
 
-    printk("Loading kernel from boot module @ %"PRIpaddr"\n", start);
+    printk("Loading kernel from boot module @ %"PRIpaddr"\n", mod->start);
 
     info->initrd_bootmodule = boot_module_find_by_kind(BOOTMOD_RAMDISK);
     if ( info->initrd_bootmodule )
         printk("Loading ramdisk from boot module @ %"PRIpaddr"\n",
                info->initrd_bootmodule->start);
 
+    /* if it is a gzip'ed image, 32bit or 64bit, uncompress it */
+    rc = kernel_decompress(mod);
+    if (rc < 0 && rc != -EINVAL)
+        return rc;
+
 #ifdef CONFIG_ARM_64
-    rc = kernel_zimage64_probe(info, start, size);
+    rc = kernel_zimage64_probe(info, mod->start, mod->size);
     if (rc < 0)
 #endif
-        rc = kernel_uimage_probe(info, start, size);
+        rc = kernel_uimage_probe(info, mod->start, mod->size);
     if (rc < 0)
-        rc = kernel_zimage32_probe(info, start, size);
+        rc = kernel_zimage32_probe(info, mod->start, mod->size);
     if (rc < 0)
-        rc = kernel_elf_probe(info, start, size);
+        rc = kernel_elf_probe(info, mod->start, mod->size);
 
     return rc;
 }
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 48f734f..e95759d 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -165,7 +165,7 @@ static void __init processor_id(void)
     processor_setup();
 }
 
-static void dt_unreserved_regions(paddr_t s, paddr_t e,
+void dt_unreserved_regions(paddr_t s, paddr_t e,
                                   void (*cb)(paddr_t, paddr_t), int first)
 {
     int i, nr = fdt_num_mem_rsv(device_tree_flattened);
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 81bb3da..30ac53b 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -54,6 +54,8 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
 int construct_dom0(struct domain *d);
 
 void discard_initial_modules(void);
+void dt_unreserved_regions(paddr_t s, paddr_t e,
+                           void (*cb)(paddr_t, paddr_t), int first);
 
 size_t __init boot_fdt_info(const void *fdt, paddr_t paddr);
 const char __init *boot_fdt_cmdline(const void *fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:22:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22: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 1ZjAP8-0008Cw-Kx; Mon, 05 Oct 2015 18:22: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 1ZjAP7-0008Cm-68
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:29 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	AB/61-00536-4EFB2165; Mon, 05 Oct 2015 18:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1444069346!13553869!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 29075 invoked from network); 5 Oct 2015 18:22:27 -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;
	5 Oct 2015 18:22:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAP4-0004uu-43
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAP4-00043l-1F
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:26 +0000
Date: Mon, 05 Oct 2015 18:22:26 +0000
Message-Id: <E1ZjAP4-00043l-1F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: Extend write/read handler
	to pass private data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea7d70ef27430002f7d1e2e07c102cd05e18f0eb
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 15:44:39 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:48:45 2015 +0100

    xen/arm: io: Extend write/read handler to pass private data
    
    Some handlers may require to use private data in order to get quickly
    information related to the region emulated.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c          |   21 +++++++++++++--------
 xen/arch/arm/vgic-v2.c     |    8 +++++---
 xen/arch/arm/vgic-v3.c     |   17 +++++++++++------
 xen/arch/arm/vuart.c       |   11 ++++++-----
 xen/include/asm-arm/mmio.h |    7 ++++---
 5 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index 8e55d49..b8f4a18 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -27,7 +27,7 @@ int handle_mmio(mmio_info_t *info)
 {
     struct vcpu *v = current;
     int i;
-    const struct mmio_handler *mmio_handler;
+    const struct mmio_handler *mmio_handler = NULL;
     const struct io_handler *io_handlers = &v->domain->arch.io_handlers;
 
     for ( i = 0; i < io_handlers->num_entries; i++ )
@@ -36,19 +36,23 @@ int handle_mmio(mmio_info_t *info)
 
         if ( (info->gpa >= mmio_handler->addr) &&
              (info->gpa < (mmio_handler->addr + mmio_handler->size)) )
-        {
-            return info->dabt.write ?
-                mmio_handler->mmio_handler_ops->write_handler(v, info) :
-                mmio_handler->mmio_handler_ops->read_handler(v, info);
-        }
+            break;
     }
 
-    return 0;
+    if ( i == io_handlers->num_entries )
+        return 0;
+
+    if ( info->dabt.write )
+        return mmio_handler->mmio_handler_ops->write_handler(v, info,
+                                                             mmio_handler->priv);
+    else
+        return mmio_handler->mmio_handler_ops->read_handler(v, info,
+                                                            mmio_handler->priv);
 }
 
 void register_mmio_handler(struct domain *d,
                            const struct mmio_handler_ops *handle,
-                           paddr_t addr, paddr_t size)
+                           paddr_t addr, paddr_t size, void *priv)
 {
     struct io_handler *handler = &d->arch.io_handlers;
 
@@ -59,6 +63,7 @@ void register_mmio_handler(struct domain *d,
     handler->mmio_handlers[handler->num_entries].mmio_handler_ops = handle;
     handler->mmio_handlers[handler->num_entries].addr = addr;
     handler->mmio_handlers[handler->num_entries].size = size;
+    handler->mmio_handlers[handler->num_entries].priv = priv;
     dsb(ish);
     handler->num_entries++;
 
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index fa71598..8e50f22 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -50,7 +50,8 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t vbase)
     vgic_v2_hw.vbase = vbase;
 }
 
-static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
+static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
+                                   void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
     struct cpu_user_regs *regs = guest_cpu_user_regs();
@@ -247,7 +248,8 @@ static int vgic_v2_to_sgi(struct vcpu *v, register_t sgir)
     return vgic_to_sgi(v, sgir, sgi_mode, virq, &target);
 }
 
-static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
+static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
+                                    void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
     struct cpu_user_regs *regs = guest_cpu_user_regs();
@@ -590,7 +592,7 @@ static int vgic_v2_domain_init(struct domain *d)
                sizeof(d->arch.vgic.shared_irqs[i].v2.itargets));
 
     register_mmio_handler(d, &vgic_v2_distr_mmio_handler, d->arch.vgic.dbase,
-                          PAGE_SIZE);
+                          PAGE_SIZE, NULL);
 
     return 0;
 }
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index f1c482d..6a4feb2 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -634,7 +634,8 @@ static inline struct vcpu *get_vcpu_from_rdist(paddr_t gpa,
     return d->vcpu[vcpu_id];
 }
 
-static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info)
+static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
+                                    void *priv)
 {
     uint32_t offset;
 
@@ -656,7 +657,8 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info)
     return 0;
 }
 
-static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info)
+static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
+                                     void *priv)
 {
     uint32_t offset;
 
@@ -678,7 +680,8 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info)
     return 0;
 }
 
-static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
+static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
+                                   void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
     struct cpu_user_regs *regs = guest_cpu_user_regs();
@@ -835,7 +838,8 @@ read_as_zero:
     return 1;
 }
 
-static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
+static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
+                                    void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
     struct cpu_user_regs *regs = guest_cpu_user_regs();
@@ -1200,7 +1204,7 @@ static int vgic_v3_domain_init(struct domain *d)
 
     /* Register mmio handle for the Distributor */
     register_mmio_handler(d, &vgic_distr_mmio_handler, d->arch.vgic.dbase,
-                          SZ_64K);
+                          SZ_64K, NULL);
 
     /*
      * Register mmio handler per contiguous region occupied by the
@@ -1210,7 +1214,8 @@ static int vgic_v3_domain_init(struct domain *d)
     for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
         register_mmio_handler(d, &vgic_rdistr_mmio_handler,
             d->arch.vgic.rdist_regions[i].base,
-            d->arch.vgic.rdist_regions[i].size);
+            d->arch.vgic.rdist_regions[i].size,
+            NULL);
 
     d->arch.vgic.ctlr = VGICD_CTLR_DEFAULT;
 
diff --git a/xen/arch/arm/vuart.c b/xen/arch/arm/vuart.c
index d9f4249..51d0557 100644
--- a/xen/arch/arm/vuart.c
+++ b/xen/arch/arm/vuart.c
@@ -45,8 +45,8 @@
 
 #define domain_has_vuart(d) ((d)->arch.vuart.info != NULL)
 
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info);
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info);
+static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv);
+static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv);
 
 static const struct mmio_handler_ops vuart_mmio_handler = {
     .read_handler  = vuart_mmio_read,
@@ -70,7 +70,8 @@ int domain_vuart_init(struct domain *d)
 
     register_mmio_handler(d, &vuart_mmio_handler,
                           d->arch.vuart.info->base_addr,
-                          d->arch.vuart.info->size);
+                          d->arch.vuart.info->size,
+                          NULL);
 
     return 0;
 }
@@ -105,7 +106,7 @@ static void vuart_print_char(struct vcpu *v, char c)
     spin_unlock(&uart->lock);
 }
 
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info)
+static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv)
 {
     struct domain *d = v->domain;
     struct hsr_dabt dabt = info->dabt;
@@ -125,7 +126,7 @@ static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info)
     return 1;
 }
 
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info)
+static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv)
 {
     struct domain *d = v->domain;
     struct hsr_dabt dabt = info->dabt;
diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index 0160f09..294c18b 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -32,8 +32,8 @@ typedef struct
     paddr_t gpa;
 } mmio_info_t;
 
-typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info);
-typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info);
+typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info, void *priv);
+typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info, void *priv);
 typedef int (*mmio_check_t)(struct vcpu *v, paddr_t addr);
 
 struct mmio_handler_ops {
@@ -45,6 +45,7 @@ struct mmio_handler {
     paddr_t addr;
     paddr_t size;
     const struct mmio_handler_ops *mmio_handler_ops;
+    void *priv;
 };
 
 struct io_handler {
@@ -56,7 +57,7 @@ struct io_handler {
 extern int handle_mmio(mmio_info_t *info);
 void register_mmio_handler(struct domain *d,
                            const struct mmio_handler_ops *handle,
-                           paddr_t addr, paddr_t size);
+                           paddr_t addr, paddr_t size, void *priv);
 int domain_io_init(struct domain *d);
 
 #endif  /* __ASM_ARM_MMIO_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 Mon Oct 05 18:22:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22: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 1ZjAP8-0008Cw-Kx; Mon, 05 Oct 2015 18:22: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 1ZjAP7-0008Cm-68
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:29 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	AB/61-00536-4EFB2165; Mon, 05 Oct 2015 18:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1444069346!13553869!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 29075 invoked from network); 5 Oct 2015 18:22:27 -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;
	5 Oct 2015 18:22:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAP4-0004uu-43
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAP4-00043l-1F
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:26 +0000
Date: Mon, 05 Oct 2015 18:22:26 +0000
Message-Id: <E1ZjAP4-00043l-1F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: Extend write/read handler
	to pass private data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea7d70ef27430002f7d1e2e07c102cd05e18f0eb
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 15:44:39 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:48:45 2015 +0100

    xen/arm: io: Extend write/read handler to pass private data
    
    Some handlers may require to use private data in order to get quickly
    information related to the region emulated.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c          |   21 +++++++++++++--------
 xen/arch/arm/vgic-v2.c     |    8 +++++---
 xen/arch/arm/vgic-v3.c     |   17 +++++++++++------
 xen/arch/arm/vuart.c       |   11 ++++++-----
 xen/include/asm-arm/mmio.h |    7 ++++---
 5 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index 8e55d49..b8f4a18 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -27,7 +27,7 @@ int handle_mmio(mmio_info_t *info)
 {
     struct vcpu *v = current;
     int i;
-    const struct mmio_handler *mmio_handler;
+    const struct mmio_handler *mmio_handler = NULL;
     const struct io_handler *io_handlers = &v->domain->arch.io_handlers;
 
     for ( i = 0; i < io_handlers->num_entries; i++ )
@@ -36,19 +36,23 @@ int handle_mmio(mmio_info_t *info)
 
         if ( (info->gpa >= mmio_handler->addr) &&
              (info->gpa < (mmio_handler->addr + mmio_handler->size)) )
-        {
-            return info->dabt.write ?
-                mmio_handler->mmio_handler_ops->write_handler(v, info) :
-                mmio_handler->mmio_handler_ops->read_handler(v, info);
-        }
+            break;
     }
 
-    return 0;
+    if ( i == io_handlers->num_entries )
+        return 0;
+
+    if ( info->dabt.write )
+        return mmio_handler->mmio_handler_ops->write_handler(v, info,
+                                                             mmio_handler->priv);
+    else
+        return mmio_handler->mmio_handler_ops->read_handler(v, info,
+                                                            mmio_handler->priv);
 }
 
 void register_mmio_handler(struct domain *d,
                            const struct mmio_handler_ops *handle,
-                           paddr_t addr, paddr_t size)
+                           paddr_t addr, paddr_t size, void *priv)
 {
     struct io_handler *handler = &d->arch.io_handlers;
 
@@ -59,6 +63,7 @@ void register_mmio_handler(struct domain *d,
     handler->mmio_handlers[handler->num_entries].mmio_handler_ops = handle;
     handler->mmio_handlers[handler->num_entries].addr = addr;
     handler->mmio_handlers[handler->num_entries].size = size;
+    handler->mmio_handlers[handler->num_entries].priv = priv;
     dsb(ish);
     handler->num_entries++;
 
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index fa71598..8e50f22 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -50,7 +50,8 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t vbase)
     vgic_v2_hw.vbase = vbase;
 }
 
-static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
+static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
+                                   void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
     struct cpu_user_regs *regs = guest_cpu_user_regs();
@@ -247,7 +248,8 @@ static int vgic_v2_to_sgi(struct vcpu *v, register_t sgir)
     return vgic_to_sgi(v, sgir, sgi_mode, virq, &target);
 }
 
-static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
+static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
+                                    void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
     struct cpu_user_regs *regs = guest_cpu_user_regs();
@@ -590,7 +592,7 @@ static int vgic_v2_domain_init(struct domain *d)
                sizeof(d->arch.vgic.shared_irqs[i].v2.itargets));
 
     register_mmio_handler(d, &vgic_v2_distr_mmio_handler, d->arch.vgic.dbase,
-                          PAGE_SIZE);
+                          PAGE_SIZE, NULL);
 
     return 0;
 }
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index f1c482d..6a4feb2 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -634,7 +634,8 @@ static inline struct vcpu *get_vcpu_from_rdist(paddr_t gpa,
     return d->vcpu[vcpu_id];
 }
 
-static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info)
+static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
+                                    void *priv)
 {
     uint32_t offset;
 
@@ -656,7 +657,8 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info)
     return 0;
 }
 
-static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info)
+static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
+                                     void *priv)
 {
     uint32_t offset;
 
@@ -678,7 +680,8 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info)
     return 0;
 }
 
-static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
+static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
+                                   void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
     struct cpu_user_regs *regs = guest_cpu_user_regs();
@@ -835,7 +838,8 @@ read_as_zero:
     return 1;
 }
 
-static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
+static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
+                                    void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
     struct cpu_user_regs *regs = guest_cpu_user_regs();
@@ -1200,7 +1204,7 @@ static int vgic_v3_domain_init(struct domain *d)
 
     /* Register mmio handle for the Distributor */
     register_mmio_handler(d, &vgic_distr_mmio_handler, d->arch.vgic.dbase,
-                          SZ_64K);
+                          SZ_64K, NULL);
 
     /*
      * Register mmio handler per contiguous region occupied by the
@@ -1210,7 +1214,8 @@ static int vgic_v3_domain_init(struct domain *d)
     for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
         register_mmio_handler(d, &vgic_rdistr_mmio_handler,
             d->arch.vgic.rdist_regions[i].base,
-            d->arch.vgic.rdist_regions[i].size);
+            d->arch.vgic.rdist_regions[i].size,
+            NULL);
 
     d->arch.vgic.ctlr = VGICD_CTLR_DEFAULT;
 
diff --git a/xen/arch/arm/vuart.c b/xen/arch/arm/vuart.c
index d9f4249..51d0557 100644
--- a/xen/arch/arm/vuart.c
+++ b/xen/arch/arm/vuart.c
@@ -45,8 +45,8 @@
 
 #define domain_has_vuart(d) ((d)->arch.vuart.info != NULL)
 
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info);
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info);
+static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv);
+static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv);
 
 static const struct mmio_handler_ops vuart_mmio_handler = {
     .read_handler  = vuart_mmio_read,
@@ -70,7 +70,8 @@ int domain_vuart_init(struct domain *d)
 
     register_mmio_handler(d, &vuart_mmio_handler,
                           d->arch.vuart.info->base_addr,
-                          d->arch.vuart.info->size);
+                          d->arch.vuart.info->size,
+                          NULL);
 
     return 0;
 }
@@ -105,7 +106,7 @@ static void vuart_print_char(struct vcpu *v, char c)
     spin_unlock(&uart->lock);
 }
 
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info)
+static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv)
 {
     struct domain *d = v->domain;
     struct hsr_dabt dabt = info->dabt;
@@ -125,7 +126,7 @@ static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info)
     return 1;
 }
 
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info)
+static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv)
 {
     struct domain *d = v->domain;
     struct hsr_dabt dabt = info->dabt;
diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index 0160f09..294c18b 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -32,8 +32,8 @@ typedef struct
     paddr_t gpa;
 } mmio_info_t;
 
-typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info);
-typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info);
+typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info, void *priv);
+typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info, void *priv);
 typedef int (*mmio_check_t)(struct vcpu *v, paddr_t addr);
 
 struct mmio_handler_ops {
@@ -45,6 +45,7 @@ struct mmio_handler {
     paddr_t addr;
     paddr_t size;
     const struct mmio_handler_ops *mmio_handler_ops;
+    void *priv;
 };
 
 struct io_handler {
@@ -56,7 +57,7 @@ struct io_handler {
 extern int handle_mmio(mmio_info_t *info);
 void register_mmio_handler(struct domain *d,
                            const struct mmio_handler_ops *handle,
-                           paddr_t addr, paddr_t size);
+                           paddr_t addr, paddr_t size, void *priv);
 int domain_io_init(struct domain *d);
 
 #endif  /* __ASM_ARM_MMIO_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 Mon Oct 05 18:22:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22: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 1ZjAPK-0008FU-S1; Mon, 05 Oct 2015 18:22:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPJ-0008FE-C2
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:41 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	EE/99-28791-0FFB2165; Mon, 05 Oct 2015 18:22:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1444069356!55823099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21541 invoked from network); 5 Oct 2015 18:22:37 -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;
	5 Oct 2015 18:22:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPE-0004v2-CM
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPE-00044f-9E
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:36 +0000
Date: Mon, 05 Oct 2015 18:22:36 +0000
Message-Id: <E1ZjAPE-00044f-9E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Correctly retrieve
	the vCPU associated to a re-distributor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b9d51e98edb8c5c731e2d06dfad3633053d88a4
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 15:44:40 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:48:51 2015 +0100

    xen/arm: vgic-v3: Correctly retrieve the vCPU associated to a re-distributor
    
    When the guest is accessing the re-distributor, Xen retrieves the base
    of the re-distributor using a mask based on the stride.
    
    When the stride contains multiple bits set, the corresponding mask will be
    computed incorrectly [1] and therefore giving invalid vCPU and offset:
    
    (XEN) d0v0: vGICR: unknown gpa read address 000000008d130008
    (XEN) traps.c:2447:d0v1 HSR=0x93c08006 pc=0xffffffc00032362c
    gva=0xffffff80000b0008 gpa=0x0000008d130008
    
    For instance if the region of re-distributor is starting at 0x8d100000
    and the stride is 0x30000, an access to the address 0x8d130008 should
    be valid and use the re-distributor of vCPU1 with an offset of 0x8.
    Although, Xen is returning the vCPU0 and an offset of 0x20008.
    
    I didn't find a way to replace the current computation of the mask with
    a valid one. The only solution I have found is to pass the region in
    private data of the handler. So we can directly get the offset from the
    beginning of the region and find the corresponding vCPU/offset in the
    re-distributor.
    
    This is also make the code simpler and avoid fast/slow path.
    
    [1] http://lists.xen.org/archives/html/xen-devel/2015-09/msg03372.html
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |   58 ++++++++++++++++-------------------------------
 1 files changed, 20 insertions(+), 38 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 6a4feb2..0a14184 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -593,55 +593,34 @@ write_ignore_32:
     return 1;
 }
 
-static inline struct vcpu *get_vcpu_from_rdist(paddr_t gpa,
-                                               struct vcpu *v,
-                                               uint32_t *offset)
+static struct vcpu *get_vcpu_from_rdist(struct domain *d,
+    const struct vgic_rdist_region *region,
+    paddr_t gpa, uint32_t *offset)
 {
-    struct domain *d = v->domain;
+    struct vcpu *v;
     uint32_t stride = d->arch.vgic.rdist_stride;
-    paddr_t base;
-    int i, vcpu_id;
-    struct vgic_rdist_region *region;
-
-    *offset = gpa & (stride - 1);
-    base = gpa & ~((paddr_t)stride - 1);
-
-    /* Fast path: the VCPU is trying to access its re-distributor */
-    if ( likely(v->arch.vgic.rdist_base == base) )
-        return v;
-
-    /* Slow path: the VCPU is trying to access another re-distributor */
-
-    /*
-     * Find the region where the re-distributor lives. For this purpose,
-     * we look one region ahead as only MMIO range for redistributors
-     * traps here.
-     * Note: The region has been ordered during the GIC initialization
-     */
-    for ( i = 1; i < d->arch.vgic.nr_regions; i++ )
-    {
-        if ( base < d->arch.vgic.rdist_regions[i].base )
-            break;
-    }
-
-    region = &d->arch.vgic.rdist_regions[i - 1];
-
-    vcpu_id = region->first_cpu + ((base - region->base) / stride);
+    unsigned int vcpu_id;
 
+    vcpu_id = region->first_cpu + ((gpa - region->base) / stride);
     if ( unlikely(vcpu_id >= d->max_vcpus) )
         return NULL;
 
-    return d->vcpu[vcpu_id];
+    v = d->vcpu[vcpu_id];
+
+    *offset = gpa - v->arch.vgic.rdist_base;
+
+    return v;
 }
 
 static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
                                     void *priv)
 {
     uint32_t offset;
+    const struct vgic_rdist_region *region = priv;
 
     perfc_incr(vgicr_reads);
 
-    v = get_vcpu_from_rdist(info->gpa, v, &offset);
+    v = get_vcpu_from_rdist(v->domain, region, info->gpa, &offset);
     if ( unlikely(!v) )
         return 0;
 
@@ -661,10 +640,11 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
                                      void *priv)
 {
     uint32_t offset;
+    const struct vgic_rdist_region *region = priv;
 
     perfc_incr(vgicr_writes);
 
-    v = get_vcpu_from_rdist(info->gpa, v, &offset);
+    v = get_vcpu_from_rdist(v->domain, region, info->gpa, &offset);
     if ( unlikely(!v) )
         return 0;
 
@@ -1212,10 +1192,12 @@ static int vgic_v3_domain_init(struct domain *d)
      * redistributor is targeted.
      */
     for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
+    {
+        struct vgic_rdist_region *region = &d->arch.vgic.rdist_regions[i];
+
         register_mmio_handler(d, &vgic_rdistr_mmio_handler,
-            d->arch.vgic.rdist_regions[i].base,
-            d->arch.vgic.rdist_regions[i].size,
-            NULL);
+                              region->base, region->size, region);
+    }
 
     d->arch.vgic.ctlr = VGICD_CTLR_DEFAULT;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:22:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22: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 1ZjAPK-0008FU-S1; Mon, 05 Oct 2015 18:22:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPJ-0008FE-C2
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:41 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	EE/99-28791-0FFB2165; Mon, 05 Oct 2015 18:22:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1444069356!55823099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21541 invoked from network); 5 Oct 2015 18:22:37 -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;
	5 Oct 2015 18:22:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPE-0004v2-CM
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPE-00044f-9E
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:36 +0000
Date: Mon, 05 Oct 2015 18:22:36 +0000
Message-Id: <E1ZjAPE-00044f-9E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Correctly retrieve
	the vCPU associated to a re-distributor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b9d51e98edb8c5c731e2d06dfad3633053d88a4
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 15:44:40 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:48:51 2015 +0100

    xen/arm: vgic-v3: Correctly retrieve the vCPU associated to a re-distributor
    
    When the guest is accessing the re-distributor, Xen retrieves the base
    of the re-distributor using a mask based on the stride.
    
    When the stride contains multiple bits set, the corresponding mask will be
    computed incorrectly [1] and therefore giving invalid vCPU and offset:
    
    (XEN) d0v0: vGICR: unknown gpa read address 000000008d130008
    (XEN) traps.c:2447:d0v1 HSR=0x93c08006 pc=0xffffffc00032362c
    gva=0xffffff80000b0008 gpa=0x0000008d130008
    
    For instance if the region of re-distributor is starting at 0x8d100000
    and the stride is 0x30000, an access to the address 0x8d130008 should
    be valid and use the re-distributor of vCPU1 with an offset of 0x8.
    Although, Xen is returning the vCPU0 and an offset of 0x20008.
    
    I didn't find a way to replace the current computation of the mask with
    a valid one. The only solution I have found is to pass the region in
    private data of the handler. So we can directly get the offset from the
    beginning of the region and find the corresponding vCPU/offset in the
    re-distributor.
    
    This is also make the code simpler and avoid fast/slow path.
    
    [1] http://lists.xen.org/archives/html/xen-devel/2015-09/msg03372.html
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |   58 ++++++++++++++++-------------------------------
 1 files changed, 20 insertions(+), 38 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 6a4feb2..0a14184 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -593,55 +593,34 @@ write_ignore_32:
     return 1;
 }
 
-static inline struct vcpu *get_vcpu_from_rdist(paddr_t gpa,
-                                               struct vcpu *v,
-                                               uint32_t *offset)
+static struct vcpu *get_vcpu_from_rdist(struct domain *d,
+    const struct vgic_rdist_region *region,
+    paddr_t gpa, uint32_t *offset)
 {
-    struct domain *d = v->domain;
+    struct vcpu *v;
     uint32_t stride = d->arch.vgic.rdist_stride;
-    paddr_t base;
-    int i, vcpu_id;
-    struct vgic_rdist_region *region;
-
-    *offset = gpa & (stride - 1);
-    base = gpa & ~((paddr_t)stride - 1);
-
-    /* Fast path: the VCPU is trying to access its re-distributor */
-    if ( likely(v->arch.vgic.rdist_base == base) )
-        return v;
-
-    /* Slow path: the VCPU is trying to access another re-distributor */
-
-    /*
-     * Find the region where the re-distributor lives. For this purpose,
-     * we look one region ahead as only MMIO range for redistributors
-     * traps here.
-     * Note: The region has been ordered during the GIC initialization
-     */
-    for ( i = 1; i < d->arch.vgic.nr_regions; i++ )
-    {
-        if ( base < d->arch.vgic.rdist_regions[i].base )
-            break;
-    }
-
-    region = &d->arch.vgic.rdist_regions[i - 1];
-
-    vcpu_id = region->first_cpu + ((base - region->base) / stride);
+    unsigned int vcpu_id;
 
+    vcpu_id = region->first_cpu + ((gpa - region->base) / stride);
     if ( unlikely(vcpu_id >= d->max_vcpus) )
         return NULL;
 
-    return d->vcpu[vcpu_id];
+    v = d->vcpu[vcpu_id];
+
+    *offset = gpa - v->arch.vgic.rdist_base;
+
+    return v;
 }
 
 static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
                                     void *priv)
 {
     uint32_t offset;
+    const struct vgic_rdist_region *region = priv;
 
     perfc_incr(vgicr_reads);
 
-    v = get_vcpu_from_rdist(info->gpa, v, &offset);
+    v = get_vcpu_from_rdist(v->domain, region, info->gpa, &offset);
     if ( unlikely(!v) )
         return 0;
 
@@ -661,10 +640,11 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
                                      void *priv)
 {
     uint32_t offset;
+    const struct vgic_rdist_region *region = priv;
 
     perfc_incr(vgicr_writes);
 
-    v = get_vcpu_from_rdist(info->gpa, v, &offset);
+    v = get_vcpu_from_rdist(v->domain, region, info->gpa, &offset);
     if ( unlikely(!v) )
         return 0;
 
@@ -1212,10 +1192,12 @@ static int vgic_v3_domain_init(struct domain *d)
      * redistributor is targeted.
      */
     for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
+    {
+        struct vgic_rdist_region *region = &d->arch.vgic.rdist_regions[i];
+
         register_mmio_handler(d, &vgic_rdistr_mmio_handler,
-            d->arch.vgic.rdist_regions[i].base,
-            d->arch.vgic.rdist_regions[i].size,
-            NULL);
+                              region->base, region->size, region);
+    }
 
     d->arch.vgic.ctlr = VGICD_CTLR_DEFAULT;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:22:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAPS-0008HS-Ug; Mon, 05 Oct 2015 18:22:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPR-0008Gy-IU
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:49 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	FE/CC-01753-8FFB2165; Mon, 05 Oct 2015 18:22:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1444069366!15828003!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 29519 invoked from network); 5 Oct 2015 18:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:22:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPO-0004vA-LX
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPO-000454-Jt
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:46 +0000
Date: Mon, 05 Oct 2015 18:22:46 +0000
Message-Id: <E1ZjAPO-000454-Jt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: Shorten the name of the
	fields and clean 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 3ba1e8147e511eb7ee52ab5618b9dc0eb8e90eca
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 15:44:41 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:48:51 2015 +0100

    xen/arm: io: Shorten the name of the fields and clean up
    
    The field names in the IO emulation are really long and use repeatedly
    the term handler which make some line cumbersome to read:
    
    mmio_handler->mmio_handler_ops->write_handler
    
    Also take the opportunity to do some clean up:
        - Avoid "handler" vs "handle" in register_mmio_handler
        - Use a local variable to initialize handler in
        register_mmio_handler
        - Add a comment explaining the dsb(ish) in register_mmio_handler
        - Rename the structure io_handler into vmmio because the io_handler
        is in fine handling multiple handlers and the name a the fields was
        io_handlers. Also rename the field io_handlers to vmmio
        - Rename the field mmio_handler_ops to ops because we are in the
        structure mmio_handler to not need to repeat it
        - Rename the field mmio_handlers to handlers because we are in the
        vmmio structure
        - Make it clear that register_mmio_ops is taking an ops and not an
        handle
        - Clean up local variable to help to understand the code
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c            |   54 ++++++++++++++++++++++++------------------
 xen/arch/arm/vgic-v2.c       |    4 +-
 xen/arch/arm/vgic-v3.c       |    8 +++---
 xen/arch/arm/vuart.c         |    4 +-
 xen/include/asm-arm/domain.h |    3 +-
 xen/include/asm-arm/mmio.h   |   12 ++++----
 6 files changed, 47 insertions(+), 38 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index b8f4a18..b418173 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -27,53 +27,61 @@ int handle_mmio(mmio_info_t *info)
 {
     struct vcpu *v = current;
     int i;
-    const struct mmio_handler *mmio_handler = NULL;
-    const struct io_handler *io_handlers = &v->domain->arch.io_handlers;
+    const struct mmio_handler *handler = NULL;
+    const struct vmmio *vmmio = &v->domain->arch.vmmio;
 
-    for ( i = 0; i < io_handlers->num_entries; i++ )
+    for ( i = 0; i < vmmio->num_entries; i++ )
     {
-        mmio_handler = &io_handlers->mmio_handlers[i];
+        handler = &vmmio->handlers[i];
 
-        if ( (info->gpa >= mmio_handler->addr) &&
-             (info->gpa < (mmio_handler->addr + mmio_handler->size)) )
+        if ( (info->gpa >= handler->addr) &&
+             (info->gpa < (handler->addr + handler->size)) )
             break;
     }
 
-    if ( i == io_handlers->num_entries )
+    if ( i == vmmio->num_entries )
         return 0;
 
     if ( info->dabt.write )
-        return mmio_handler->mmio_handler_ops->write_handler(v, info,
-                                                             mmio_handler->priv);
+        return handler->ops->write(v, info, handler->priv);
     else
-        return mmio_handler->mmio_handler_ops->read_handler(v, info,
-                                                            mmio_handler->priv);
+        return handler->ops->read(v, info, handler->priv);
 }
 
 void register_mmio_handler(struct domain *d,
-                           const struct mmio_handler_ops *handle,
+                           const struct mmio_handler_ops *ops,
                            paddr_t addr, paddr_t size, void *priv)
 {
-    struct io_handler *handler = &d->arch.io_handlers;
+    struct vmmio *vmmio = &d->arch.vmmio;
+    struct mmio_handler *handler;
 
-    BUG_ON(handler->num_entries >= MAX_IO_HANDLER);
+    BUG_ON(vmmio->num_entries >= MAX_IO_HANDLER);
 
-    spin_lock(&handler->lock);
+    spin_lock(&vmmio->lock);
 
-    handler->mmio_handlers[handler->num_entries].mmio_handler_ops = handle;
-    handler->mmio_handlers[handler->num_entries].addr = addr;
-    handler->mmio_handlers[handler->num_entries].size = size;
-    handler->mmio_handlers[handler->num_entries].priv = priv;
+    handler = &vmmio->handlers[vmmio->num_entries];
+
+    handler->ops = ops;
+    handler->addr = addr;
+    handler->size = size;
+    handler->priv = priv;
+
+    /*
+     * handle_mmio is not using the lock to avoid contention.
+     * Make sure the other processors see the new handler before
+     * updating the number of entries
+     */
     dsb(ish);
-    handler->num_entries++;
 
-    spin_unlock(&handler->lock);
+    vmmio->num_entries++;
+
+    spin_unlock(&vmmio->lock);
 }
 
 int domain_io_init(struct domain *d)
 {
-   spin_lock_init(&d->arch.io_handlers.lock);
-   d->arch.io_handlers.num_entries = 0;
+   spin_lock_init(&d->arch.vmmio.lock);
+   d->arch.vmmio.num_entries = 0;
 
    return 0;
 }
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 8e50f22..f886724 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -495,8 +495,8 @@ write_ignore:
 }
 
 static const struct mmio_handler_ops vgic_v2_distr_mmio_handler = {
-    .read_handler  = vgic_v2_distr_mmio_read,
-    .write_handler = vgic_v2_distr_mmio_write,
+    .read  = vgic_v2_distr_mmio_read,
+    .write = vgic_v2_distr_mmio_write,
 };
 
 static struct vcpu *vgic_v2_get_target_vcpu(struct vcpu *v, unsigned int irq)
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 0a14184..beb3621 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1037,13 +1037,13 @@ static int vgic_v3_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
 }
 
 static const struct mmio_handler_ops vgic_rdistr_mmio_handler = {
-    .read_handler  = vgic_v3_rdistr_mmio_read,
-    .write_handler = vgic_v3_rdistr_mmio_write,
+    .read  = vgic_v3_rdistr_mmio_read,
+    .write = vgic_v3_rdistr_mmio_write,
 };
 
 static const struct mmio_handler_ops vgic_distr_mmio_handler = {
-    .read_handler  = vgic_v3_distr_mmio_read,
-    .write_handler = vgic_v3_distr_mmio_write,
+    .read  = vgic_v3_distr_mmio_read,
+    .write = vgic_v3_distr_mmio_write,
 };
 
 static int vgic_v3_get_irq_priority(struct vcpu *v, unsigned int irq)
diff --git a/xen/arch/arm/vuart.c b/xen/arch/arm/vuart.c
index 51d0557..2495e87 100644
--- a/xen/arch/arm/vuart.c
+++ b/xen/arch/arm/vuart.c
@@ -49,8 +49,8 @@ static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv);
 static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv);
 
 static const struct mmio_handler_ops vuart_mmio_handler = {
-    .read_handler  = vuart_mmio_read,
-    .write_handler = vuart_mmio_write,
+    .read  = vuart_mmio_read,
+    .write = vuart_mmio_write,
 };
 
 int domain_vuart_init(struct domain *d)
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index c3f5a95..01859cc 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -55,7 +55,8 @@ struct arch_domain
     struct hvm_domain hvm_domain;
     xen_pfn_t *grant_table_gpfn;
 
-    struct io_handler io_handlers;
+    struct vmmio vmmio;
+
     /* Continuable domain_relinquish_resources(). */
     enum {
         RELMEM_not_started,
diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index 294c18b..1cd7a7a 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -37,26 +37,26 @@ typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info, void *priv);
 typedef int (*mmio_check_t)(struct vcpu *v, paddr_t addr);
 
 struct mmio_handler_ops {
-    mmio_read_t read_handler;
-    mmio_write_t write_handler;
+    mmio_read_t read;
+    mmio_write_t write;
 };
 
 struct mmio_handler {
     paddr_t addr;
     paddr_t size;
-    const struct mmio_handler_ops *mmio_handler_ops;
+    const struct mmio_handler_ops *ops;
     void *priv;
 };
 
-struct io_handler {
+struct vmmio {
     int num_entries;
     spinlock_t lock;
-    struct mmio_handler mmio_handlers[MAX_IO_HANDLER];
+    struct mmio_handler handlers[MAX_IO_HANDLER];
 };
 
 extern int handle_mmio(mmio_info_t *info);
 void register_mmio_handler(struct domain *d,
-                           const struct mmio_handler_ops *handle,
+                           const struct mmio_handler_ops *ops,
                            paddr_t addr, paddr_t size, void *priv);
 int domain_io_init(struct domain *d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:22:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAPS-0008HS-Ug; Mon, 05 Oct 2015 18:22:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPR-0008Gy-IU
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:49 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	FE/CC-01753-8FFB2165; Mon, 05 Oct 2015 18:22:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1444069366!15828003!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 29519 invoked from network); 5 Oct 2015 18:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:22:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPO-0004vA-LX
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPO-000454-Jt
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:46 +0000
Date: Mon, 05 Oct 2015 18:22:46 +0000
Message-Id: <E1ZjAPO-000454-Jt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: Shorten the name of the
	fields and clean 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 3ba1e8147e511eb7ee52ab5618b9dc0eb8e90eca
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 15:44:41 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:48:51 2015 +0100

    xen/arm: io: Shorten the name of the fields and clean up
    
    The field names in the IO emulation are really long and use repeatedly
    the term handler which make some line cumbersome to read:
    
    mmio_handler->mmio_handler_ops->write_handler
    
    Also take the opportunity to do some clean up:
        - Avoid "handler" vs "handle" in register_mmio_handler
        - Use a local variable to initialize handler in
        register_mmio_handler
        - Add a comment explaining the dsb(ish) in register_mmio_handler
        - Rename the structure io_handler into vmmio because the io_handler
        is in fine handling multiple handlers and the name a the fields was
        io_handlers. Also rename the field io_handlers to vmmio
        - Rename the field mmio_handler_ops to ops because we are in the
        structure mmio_handler to not need to repeat it
        - Rename the field mmio_handlers to handlers because we are in the
        vmmio structure
        - Make it clear that register_mmio_ops is taking an ops and not an
        handle
        - Clean up local variable to help to understand the code
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c            |   54 ++++++++++++++++++++++++------------------
 xen/arch/arm/vgic-v2.c       |    4 +-
 xen/arch/arm/vgic-v3.c       |    8 +++---
 xen/arch/arm/vuart.c         |    4 +-
 xen/include/asm-arm/domain.h |    3 +-
 xen/include/asm-arm/mmio.h   |   12 ++++----
 6 files changed, 47 insertions(+), 38 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index b8f4a18..b418173 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -27,53 +27,61 @@ int handle_mmio(mmio_info_t *info)
 {
     struct vcpu *v = current;
     int i;
-    const struct mmio_handler *mmio_handler = NULL;
-    const struct io_handler *io_handlers = &v->domain->arch.io_handlers;
+    const struct mmio_handler *handler = NULL;
+    const struct vmmio *vmmio = &v->domain->arch.vmmio;
 
-    for ( i = 0; i < io_handlers->num_entries; i++ )
+    for ( i = 0; i < vmmio->num_entries; i++ )
     {
-        mmio_handler = &io_handlers->mmio_handlers[i];
+        handler = &vmmio->handlers[i];
 
-        if ( (info->gpa >= mmio_handler->addr) &&
-             (info->gpa < (mmio_handler->addr + mmio_handler->size)) )
+        if ( (info->gpa >= handler->addr) &&
+             (info->gpa < (handler->addr + handler->size)) )
             break;
     }
 
-    if ( i == io_handlers->num_entries )
+    if ( i == vmmio->num_entries )
         return 0;
 
     if ( info->dabt.write )
-        return mmio_handler->mmio_handler_ops->write_handler(v, info,
-                                                             mmio_handler->priv);
+        return handler->ops->write(v, info, handler->priv);
     else
-        return mmio_handler->mmio_handler_ops->read_handler(v, info,
-                                                            mmio_handler->priv);
+        return handler->ops->read(v, info, handler->priv);
 }
 
 void register_mmio_handler(struct domain *d,
-                           const struct mmio_handler_ops *handle,
+                           const struct mmio_handler_ops *ops,
                            paddr_t addr, paddr_t size, void *priv)
 {
-    struct io_handler *handler = &d->arch.io_handlers;
+    struct vmmio *vmmio = &d->arch.vmmio;
+    struct mmio_handler *handler;
 
-    BUG_ON(handler->num_entries >= MAX_IO_HANDLER);
+    BUG_ON(vmmio->num_entries >= MAX_IO_HANDLER);
 
-    spin_lock(&handler->lock);
+    spin_lock(&vmmio->lock);
 
-    handler->mmio_handlers[handler->num_entries].mmio_handler_ops = handle;
-    handler->mmio_handlers[handler->num_entries].addr = addr;
-    handler->mmio_handlers[handler->num_entries].size = size;
-    handler->mmio_handlers[handler->num_entries].priv = priv;
+    handler = &vmmio->handlers[vmmio->num_entries];
+
+    handler->ops = ops;
+    handler->addr = addr;
+    handler->size = size;
+    handler->priv = priv;
+
+    /*
+     * handle_mmio is not using the lock to avoid contention.
+     * Make sure the other processors see the new handler before
+     * updating the number of entries
+     */
     dsb(ish);
-    handler->num_entries++;
 
-    spin_unlock(&handler->lock);
+    vmmio->num_entries++;
+
+    spin_unlock(&vmmio->lock);
 }
 
 int domain_io_init(struct domain *d)
 {
-   spin_lock_init(&d->arch.io_handlers.lock);
-   d->arch.io_handlers.num_entries = 0;
+   spin_lock_init(&d->arch.vmmio.lock);
+   d->arch.vmmio.num_entries = 0;
 
    return 0;
 }
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 8e50f22..f886724 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -495,8 +495,8 @@ write_ignore:
 }
 
 static const struct mmio_handler_ops vgic_v2_distr_mmio_handler = {
-    .read_handler  = vgic_v2_distr_mmio_read,
-    .write_handler = vgic_v2_distr_mmio_write,
+    .read  = vgic_v2_distr_mmio_read,
+    .write = vgic_v2_distr_mmio_write,
 };
 
 static struct vcpu *vgic_v2_get_target_vcpu(struct vcpu *v, unsigned int irq)
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 0a14184..beb3621 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1037,13 +1037,13 @@ static int vgic_v3_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
 }
 
 static const struct mmio_handler_ops vgic_rdistr_mmio_handler = {
-    .read_handler  = vgic_v3_rdistr_mmio_read,
-    .write_handler = vgic_v3_rdistr_mmio_write,
+    .read  = vgic_v3_rdistr_mmio_read,
+    .write = vgic_v3_rdistr_mmio_write,
 };
 
 static const struct mmio_handler_ops vgic_distr_mmio_handler = {
-    .read_handler  = vgic_v3_distr_mmio_read,
-    .write_handler = vgic_v3_distr_mmio_write,
+    .read  = vgic_v3_distr_mmio_read,
+    .write = vgic_v3_distr_mmio_write,
 };
 
 static int vgic_v3_get_irq_priority(struct vcpu *v, unsigned int irq)
diff --git a/xen/arch/arm/vuart.c b/xen/arch/arm/vuart.c
index 51d0557..2495e87 100644
--- a/xen/arch/arm/vuart.c
+++ b/xen/arch/arm/vuart.c
@@ -49,8 +49,8 @@ static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv);
 static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv);
 
 static const struct mmio_handler_ops vuart_mmio_handler = {
-    .read_handler  = vuart_mmio_read,
-    .write_handler = vuart_mmio_write,
+    .read  = vuart_mmio_read,
+    .write = vuart_mmio_write,
 };
 
 int domain_vuart_init(struct domain *d)
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index c3f5a95..01859cc 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -55,7 +55,8 @@ struct arch_domain
     struct hvm_domain hvm_domain;
     xen_pfn_t *grant_table_gpfn;
 
-    struct io_handler io_handlers;
+    struct vmmio vmmio;
+
     /* Continuable domain_relinquish_resources(). */
     enum {
         RELMEM_not_started,
diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index 294c18b..1cd7a7a 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -37,26 +37,26 @@ typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info, void *priv);
 typedef int (*mmio_check_t)(struct vcpu *v, paddr_t addr);
 
 struct mmio_handler_ops {
-    mmio_read_t read_handler;
-    mmio_write_t write_handler;
+    mmio_read_t read;
+    mmio_write_t write;
 };
 
 struct mmio_handler {
     paddr_t addr;
     paddr_t size;
-    const struct mmio_handler_ops *mmio_handler_ops;
+    const struct mmio_handler_ops *ops;
     void *priv;
 };
 
-struct io_handler {
+struct vmmio {
     int num_entries;
     spinlock_t lock;
-    struct mmio_handler mmio_handlers[MAX_IO_HANDLER];
+    struct mmio_handler handlers[MAX_IO_HANDLER];
 };
 
 extern int handle_mmio(mmio_info_t *info);
 void register_mmio_handler(struct domain *d,
-                           const struct mmio_handler_ops *handle,
+                           const struct mmio_handler_ops *ops,
                            paddr_t addr, paddr_t size, void *priv);
 int domain_io_init(struct domain *d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:23:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23: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 1ZjAPi-0008KC-1i; Mon, 05 Oct 2015 18:23: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 1ZjAPg-0008Ju-NG
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:04 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	BD/CE-31069-800C2165; Mon, 05 Oct 2015 18:23:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1444069378!48038541!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11427 invoked from network); 5 Oct 2015 18:22:59 -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;
	5 Oct 2015 18:22:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPY-0004vI-W6
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPY-00045T-UU
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:56 +0000
Date: Mon, 05 Oct 2015 18:22:56 +0000
Message-Id: <E1ZjAPY-00045T-UU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic: Make it clear the GIC
	node is passed to make_hwdom_dt_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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a0542500a9ac029e46cce5f7c51378cf192c7055
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 17:21:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:50:10 2015 +0100

    xen/arm: gic: Make it clear the GIC node is passed to make_hwdom_dt_node
    
    The callback make_hwdom_dt_node already has the GIC node in parameter.
    
    Rather than using a weird mix between "dt_interrupt_controller" (aliased
    to "gic") and "node", rename the callback parameter "node" to "gic" and
    remove local GIC definitions in terms of the global
    dt_interrupt_interrupt_controller.
    
    Also, add an assert to gic_make_hwdom_dt_node to check that the GIC
    really is the global dt_interrupt_controller.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic-hip04.c  |    5 ++---
 xen/arch/arm/gic-v2.c     |    5 ++---
 xen/arch/arm/gic-v3.c     |    9 ++++-----
 xen/arch/arm/gic.c        |    6 ++++--
 xen/include/asm-arm/gic.h |    5 +++--
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c
index c5ed545..e8cdcd4 100644
--- a/xen/arch/arm/gic-hip04.c
+++ b/xen/arch/arm/gic-hip04.c
@@ -562,10 +562,9 @@ static void hip04gic_irq_set_affinity(struct irq_desc *desc, const cpumask_t *cp
 }
 
 static int hip04gic_make_hwdom_dt_node(const struct domain *d,
-                                       const struct dt_device_node *node,
+                                       const struct dt_device_node *gic,
                                        void *fdt)
 {
-    const struct dt_device_node *gic = dt_interrupt_controller;
     const void *compatible;
     u32 len;
     const __be32 *regs;
@@ -598,7 +597,7 @@ static int hip04gic_make_hwdom_dt_node(const struct domain *d,
         return -FDT_ERR_XEN(ENOENT);
     }
 
-    len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node));
+    len = dt_cells_to_size(dt_n_addr_cells(gic) + dt_n_size_cells(gic));
     len *= 2;
 
     res = fdt_property(fdt, "reg", regs, len);
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 596126d..5841e59 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -552,10 +552,9 @@ static void gicv2_irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_m
 }
 
 static int gicv2_make_hwdom_dt_node(const struct domain *d,
-                                    const struct dt_device_node *node,
+                                    const struct dt_device_node *gic,
                                     void *fdt)
 {
-    const struct dt_device_node *gic = dt_interrupt_controller;
     const void *compatible = NULL;
     u32 len;
     const __be32 *regs;
@@ -584,7 +583,7 @@ static int gicv2_make_hwdom_dt_node(const struct domain *d,
         return -FDT_ERR_XEN(ENOENT);
     }
 
-    len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node));
+    len = dt_cells_to_size(dt_n_addr_cells(gic) + dt_n_size_cells(gic));
     len *= 2;
 
     res = fdt_property(fdt, "reg", regs, len);
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 1e3c19b..957c6e0 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1054,10 +1054,9 @@ static void gicv3_irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
 }
 
 static int gicv3_make_hwdom_dt_node(const struct domain *d,
-                                    const struct dt_device_node *node,
+                                    const struct dt_device_node *gic,
                                     void *fdt)
 {
-    const struct dt_device_node *gic = dt_interrupt_controller;
     const void *compatible = NULL;
     uint32_t len;
     __be32 *new_cells, *tmp;
@@ -1084,7 +1083,7 @@ static int gicv3_make_hwdom_dt_node(const struct domain *d,
     if ( res )
         return res;
 
-    len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node));
+    len = dt_cells_to_size(dt_n_addr_cells(gic) + dt_n_size_cells(gic));
     /*
      * GIC has two memory regions: Distributor + rdist regions
      * CPU interface and virtual cpu interfaces accessesed as System registers
@@ -1097,10 +1096,10 @@ static int gicv3_make_hwdom_dt_node(const struct domain *d,
 
     tmp = new_cells;
 
-    dt_set_range(&tmp, node, d->arch.vgic.dbase, SZ_64K);
+    dt_set_range(&tmp, gic, d->arch.vgic.dbase, SZ_64K);
 
     for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
-        dt_set_range(&tmp, node, d->arch.vgic.rdist_regions[i].base,
+        dt_set_range(&tmp, gic, d->arch.vgic.rdist_regions[i].base,
                      d->arch.vgic.rdist_regions[i].size);
 
     res = fdt_property(fdt, "reg", new_cells, len);
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1757193..1e1e5ba 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -702,10 +702,12 @@ void __cpuinit init_maintenance_interrupt(void)
 }
 
 int gic_make_hwdom_dt_node(const struct domain *d,
-                           const struct dt_device_node *node,
+                           const struct dt_device_node *gic,
                            void *fdt)
 {
-    return gic_hw_ops->make_hwdom_dt_node(d, node, fdt);
+    ASSERT(gic == dt_interrupt_controller);
+
+    return gic_hw_ops->make_hwdom_dt_node(d, gic, fdt);
 }
 
 /*
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index d343abf..6d53f97 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -350,13 +350,14 @@ struct gic_hw_operations {
     unsigned int (*read_apr)(int apr_reg);
     /* Secondary CPU init */
     int (*secondary_init)(void);
+    /* Create GIC node for the hardware domain */
     int (*make_hwdom_dt_node)(const struct domain *d,
-                              const struct dt_device_node *node, void *fdt);
+                              const struct dt_device_node *gic, void *fdt);
 };
 
 void register_gic_ops(const struct gic_hw_operations *ops);
 int gic_make_hwdom_dt_node(const struct domain *d,
-                           const struct dt_device_node *node,
+                           const struct dt_device_node *gic,
                            void *fdt);
 
 #endif /* __ASSEMBLY__ */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:23:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23: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 1ZjAPi-0008KC-1i; Mon, 05 Oct 2015 18:23: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 1ZjAPg-0008Ju-NG
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:04 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	BD/CE-31069-800C2165; Mon, 05 Oct 2015 18:23:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1444069378!48038541!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11427 invoked from network); 5 Oct 2015 18:22:59 -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;
	5 Oct 2015 18:22:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPY-0004vI-W6
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPY-00045T-UU
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:22:56 +0000
Date: Mon, 05 Oct 2015 18:22:56 +0000
Message-Id: <E1ZjAPY-00045T-UU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic: Make it clear the GIC
	node is passed to make_hwdom_dt_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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a0542500a9ac029e46cce5f7c51378cf192c7055
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 17:21:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:50:10 2015 +0100

    xen/arm: gic: Make it clear the GIC node is passed to make_hwdom_dt_node
    
    The callback make_hwdom_dt_node already has the GIC node in parameter.
    
    Rather than using a weird mix between "dt_interrupt_controller" (aliased
    to "gic") and "node", rename the callback parameter "node" to "gic" and
    remove local GIC definitions in terms of the global
    dt_interrupt_interrupt_controller.
    
    Also, add an assert to gic_make_hwdom_dt_node to check that the GIC
    really is the global dt_interrupt_controller.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic-hip04.c  |    5 ++---
 xen/arch/arm/gic-v2.c     |    5 ++---
 xen/arch/arm/gic-v3.c     |    9 ++++-----
 xen/arch/arm/gic.c        |    6 ++++--
 xen/include/asm-arm/gic.h |    5 +++--
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c
index c5ed545..e8cdcd4 100644
--- a/xen/arch/arm/gic-hip04.c
+++ b/xen/arch/arm/gic-hip04.c
@@ -562,10 +562,9 @@ static void hip04gic_irq_set_affinity(struct irq_desc *desc, const cpumask_t *cp
 }
 
 static int hip04gic_make_hwdom_dt_node(const struct domain *d,
-                                       const struct dt_device_node *node,
+                                       const struct dt_device_node *gic,
                                        void *fdt)
 {
-    const struct dt_device_node *gic = dt_interrupt_controller;
     const void *compatible;
     u32 len;
     const __be32 *regs;
@@ -598,7 +597,7 @@ static int hip04gic_make_hwdom_dt_node(const struct domain *d,
         return -FDT_ERR_XEN(ENOENT);
     }
 
-    len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node));
+    len = dt_cells_to_size(dt_n_addr_cells(gic) + dt_n_size_cells(gic));
     len *= 2;
 
     res = fdt_property(fdt, "reg", regs, len);
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 596126d..5841e59 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -552,10 +552,9 @@ static void gicv2_irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_m
 }
 
 static int gicv2_make_hwdom_dt_node(const struct domain *d,
-                                    const struct dt_device_node *node,
+                                    const struct dt_device_node *gic,
                                     void *fdt)
 {
-    const struct dt_device_node *gic = dt_interrupt_controller;
     const void *compatible = NULL;
     u32 len;
     const __be32 *regs;
@@ -584,7 +583,7 @@ static int gicv2_make_hwdom_dt_node(const struct domain *d,
         return -FDT_ERR_XEN(ENOENT);
     }
 
-    len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node));
+    len = dt_cells_to_size(dt_n_addr_cells(gic) + dt_n_size_cells(gic));
     len *= 2;
 
     res = fdt_property(fdt, "reg", regs, len);
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 1e3c19b..957c6e0 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1054,10 +1054,9 @@ static void gicv3_irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
 }
 
 static int gicv3_make_hwdom_dt_node(const struct domain *d,
-                                    const struct dt_device_node *node,
+                                    const struct dt_device_node *gic,
                                     void *fdt)
 {
-    const struct dt_device_node *gic = dt_interrupt_controller;
     const void *compatible = NULL;
     uint32_t len;
     __be32 *new_cells, *tmp;
@@ -1084,7 +1083,7 @@ static int gicv3_make_hwdom_dt_node(const struct domain *d,
     if ( res )
         return res;
 
-    len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node));
+    len = dt_cells_to_size(dt_n_addr_cells(gic) + dt_n_size_cells(gic));
     /*
      * GIC has two memory regions: Distributor + rdist regions
      * CPU interface and virtual cpu interfaces accessesed as System registers
@@ -1097,10 +1096,10 @@ static int gicv3_make_hwdom_dt_node(const struct domain *d,
 
     tmp = new_cells;
 
-    dt_set_range(&tmp, node, d->arch.vgic.dbase, SZ_64K);
+    dt_set_range(&tmp, gic, d->arch.vgic.dbase, SZ_64K);
 
     for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
-        dt_set_range(&tmp, node, d->arch.vgic.rdist_regions[i].base,
+        dt_set_range(&tmp, gic, d->arch.vgic.rdist_regions[i].base,
                      d->arch.vgic.rdist_regions[i].size);
 
     res = fdt_property(fdt, "reg", new_cells, len);
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1757193..1e1e5ba 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -702,10 +702,12 @@ void __cpuinit init_maintenance_interrupt(void)
 }
 
 int gic_make_hwdom_dt_node(const struct domain *d,
-                           const struct dt_device_node *node,
+                           const struct dt_device_node *gic,
                            void *fdt)
 {
-    return gic_hw_ops->make_hwdom_dt_node(d, node, fdt);
+    ASSERT(gic == dt_interrupt_controller);
+
+    return gic_hw_ops->make_hwdom_dt_node(d, gic, fdt);
 }
 
 /*
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index d343abf..6d53f97 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -350,13 +350,14 @@ struct gic_hw_operations {
     unsigned int (*read_apr)(int apr_reg);
     /* Secondary CPU init */
     int (*secondary_init)(void);
+    /* Create GIC node for the hardware domain */
     int (*make_hwdom_dt_node)(const struct domain *d,
-                              const struct dt_device_node *node, void *fdt);
+                              const struct dt_device_node *gic, void *fdt);
 };
 
 void register_gic_ops(const struct gic_hw_operations *ops);
 int gic_make_hwdom_dt_node(const struct domain *d,
-                           const struct dt_device_node *node,
+                           const struct dt_device_node *gic,
                            void *fdt);
 
 #endif /* __ASSEMBLY__ */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:23:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAPn-0008LP-43; Mon, 05 Oct 2015 18:23:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPm-0008LC-6W
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:10 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	3B/98-01748-D00C2165; Mon, 05 Oct 2015 18:23:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1444069387!17665823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3614 invoked from network); 5 Oct 2015 18:23:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:23:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPj-0004vp-90
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPj-000465-6W
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:07 +0000
Date: Mon, 05 Oct 2015 18:23:07 +0000
Message-Id: <E1ZjAPj-000465-6W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Retrieve the correct number
	of cells when building dom0 DT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93be027d51dc6e7c9b4cd071d08194cc6c2306e0
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 17:21:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:51:29 2015 +0100

    xen/arm: Retrieve the correct number of cells when building dom0 DT
    
    The functions dt_n_*_cells return the number of cells for a "reg"
    property of a given node. So those numbers won't be correct if the
    parent of a given node is passed.
    
    This is fine today because the parent is always the root node which
    means there is no upper parent.
    
    Introduce new helpers dt_child_n_*_cells to retrieve the number of
    cells for the address and size that can be used to create the "reg"
    property of the immediate child of a given parent. Also introduce
    dt_child_set_range to pair up with dt_child_n_*_cells.
    
    Use the new helpers when creating the hypervisor and memory node where
    we only have the parent in hand. This is because those nodes are created
    from scratch by Xen and therefore we don't have a dt_device_node for
    them. The only thing we have is a pointer to their future parent.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c   |   10 +++++-----
 xen/common/device_tree.c      |   39 +++++++++++++++++++++++++++++++++++----
 xen/include/xen/device_tree.h |   33 +++++++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 72b1845..e8f024f 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -569,7 +569,7 @@ static int make_memory_node(const struct domain *d,
                             const struct kernel_info *kinfo)
 {
     int res, i;
-    int reg_size = dt_n_addr_cells(parent) + dt_n_size_cells(parent);
+    int reg_size = dt_child_n_addr_cells(parent) + dt_child_n_size_cells(parent);
     int nr_cells = reg_size*kinfo->mem.nr_banks;
     __be32 reg[nr_cells];
     __be32 *cells;
@@ -594,7 +594,7 @@ static int make_memory_node(const struct domain *d,
         DPRINT("  Bank %d: %#"PRIx64"->%#"PRIx64"\n",
                 i, start, start + size);
 
-        dt_set_range(&cells, parent, start, size);
+        dt_child_set_range(&cells, parent, start, size);
     }
 
     res = fdt_property(fdt, "reg", reg, sizeof(reg));
@@ -617,8 +617,8 @@ static int make_hypervisor_node(const struct kernel_info *kinfo,
     __be32 *cells;
     int res;
     /* Convenience alias */
-    int addrcells = dt_n_addr_cells(parent);
-    int sizecells = dt_n_size_cells(parent);
+    int addrcells = dt_child_n_addr_cells(parent);
+    int sizecells = dt_child_n_size_cells(parent);
     void *fdt = kinfo->fdt;
 
     DPRINT("Create hypervisor node\n");
@@ -643,7 +643,7 @@ static int make_hypervisor_node(const struct kernel_info *kinfo,
 
     /* reg 0 is grant table space */
     cells = &reg[0];
-    dt_set_range(&cells, parent, kinfo->gnttab_start, kinfo->gnttab_size);
+    dt_child_set_range(&cells, parent, kinfo->gnttab_start, kinfo->gnttab_size);
     res = fdt_property(fdt, "reg", reg,
                        dt_cells_to_size(addrcells + sizecells));
     if ( res )
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 18cdb6f..87c3f71 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -117,6 +117,13 @@ void dt_set_range(__be32 **cellp, const struct dt_device_node *np,
     dt_set_cell(cellp, dt_n_size_cells(np), size);
 }
 
+void dt_child_set_range(__be32 **cellp, const struct dt_device_node *parent,
+                        u64 address, u64 size)
+{
+    dt_set_cell(cellp, dt_child_n_addr_cells(parent), address);
+    dt_set_cell(cellp, dt_child_n_size_cells(parent), size);
+}
+
 static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
                                        unsigned long align)
 {
@@ -386,13 +393,15 @@ dt_find_matching_node(struct dt_device_node *from,
     return NULL;
 }
 
-int dt_n_addr_cells(const struct dt_device_node *np)
+static int __dt_n_addr_cells(const struct dt_device_node *np, bool_t parent)
 {
     const __be32 *ip;
 
     do {
-        if ( np->parent )
+        if ( np->parent && !parent )
             np = np->parent;
+        parent = false;
+
         ip = dt_get_property(np, "#address-cells", NULL);
         if ( ip )
             return be32_to_cpup(ip);
@@ -401,13 +410,15 @@ int dt_n_addr_cells(const struct dt_device_node *np)
     return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
 }
 
-int dt_n_size_cells(const struct dt_device_node *np)
+int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
 {
     const __be32 *ip;
 
     do {
-        if ( np->parent )
+        if ( np->parent && !parent )
             np = np->parent;
+        parent = false;
+
         ip = dt_get_property(np, "#size-cells", NULL);
         if ( ip )
             return be32_to_cpup(ip);
@@ -416,6 +427,26 @@ int dt_n_size_cells(const struct dt_device_node *np)
     return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
 }
 
+int dt_n_addr_cells(const struct dt_device_node *np)
+{
+    return __dt_n_addr_cells(np, false);
+}
+
+int dt_n_size_cells(const struct dt_device_node *np)
+{
+    return __dt_n_size_cells(np, false);
+}
+
+int dt_child_n_addr_cells(const struct dt_device_node *parent)
+{
+    return __dt_n_addr_cells(parent, true);
+}
+
+int dt_child_n_size_cells(const struct dt_device_node *parent)
+{
+    return __dt_n_size_cells(parent, true);
+}
+
 /*
  * These are defined in Linux where much of this code comes from, but
  * are currently unused outside this file in the context of Xen.
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 46c5ba8..5c03f40 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -584,6 +584,25 @@ int dt_n_size_cells(const struct dt_device_node *np);
 int dt_n_addr_cells(const struct dt_device_node *np);
 
 /**
+ * dt_child_n_size_cells - Helper to retrieve the number of cell for the size
+ * @parent: parent of the child to get the value
+ *
+ * This function retrieves for a given device-tree node the number of
+ * cell for the size field of there child
+ */
+int dt_child_n_size_cells(const struct dt_device_node *parent);
+
+/**
+ * dt_child_n_addr_cells - Helper to retrieve the number of cell for the
+ * address
+ * @parent: parent of the child to get the value
+ *
+ * This function retrieves for a given device-tree node the number of
+ * cell for the address field of there child
+ */
+int dt_child_n_addr_cells(const struct dt_device_node *parent);
+
+/**
  * dt_device_is_available - Check if a device is available for use
  *
  * @device: Node to check for availability
@@ -655,6 +674,20 @@ void dt_set_range(__be32 **cellp, const struct dt_device_node *np,
                   u64 address, u64 size);
 
 /**
+ * dt_child_set_range - Write range into a series of cells
+ *
+ * @cellp: Pointer to cells
+ * @parent: Parent node which contains the encode for the address and the size
+ * @address: Start of range
+ * @size: Size of the range
+ *
+ * Write a range into a series of cells and update cellp to point to the
+ * cell just after.
+ */
+void dt_child_set_range(__be32 **cellp, const struct dt_device_node *parent,
+                        u64 address, u64 size);
+
+/**
  * dt_get_range - Read a range (address/size) from a series of cells
  *
  * @cellp: Pointer to cells
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:23:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAPn-0008LP-43; Mon, 05 Oct 2015 18:23:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPm-0008LC-6W
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:10 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	3B/98-01748-D00C2165; Mon, 05 Oct 2015 18:23:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1444069387!17665823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3614 invoked from network); 5 Oct 2015 18:23:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:23:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPj-0004vp-90
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPj-000465-6W
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:07 +0000
Date: Mon, 05 Oct 2015 18:23:07 +0000
Message-Id: <E1ZjAPj-000465-6W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Retrieve the correct number
	of cells when building dom0 DT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93be027d51dc6e7c9b4cd071d08194cc6c2306e0
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 17:21:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:51:29 2015 +0100

    xen/arm: Retrieve the correct number of cells when building dom0 DT
    
    The functions dt_n_*_cells return the number of cells for a "reg"
    property of a given node. So those numbers won't be correct if the
    parent of a given node is passed.
    
    This is fine today because the parent is always the root node which
    means there is no upper parent.
    
    Introduce new helpers dt_child_n_*_cells to retrieve the number of
    cells for the address and size that can be used to create the "reg"
    property of the immediate child of a given parent. Also introduce
    dt_child_set_range to pair up with dt_child_n_*_cells.
    
    Use the new helpers when creating the hypervisor and memory node where
    we only have the parent in hand. This is because those nodes are created
    from scratch by Xen and therefore we don't have a dt_device_node for
    them. The only thing we have is a pointer to their future parent.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c   |   10 +++++-----
 xen/common/device_tree.c      |   39 +++++++++++++++++++++++++++++++++++----
 xen/include/xen/device_tree.h |   33 +++++++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 72b1845..e8f024f 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -569,7 +569,7 @@ static int make_memory_node(const struct domain *d,
                             const struct kernel_info *kinfo)
 {
     int res, i;
-    int reg_size = dt_n_addr_cells(parent) + dt_n_size_cells(parent);
+    int reg_size = dt_child_n_addr_cells(parent) + dt_child_n_size_cells(parent);
     int nr_cells = reg_size*kinfo->mem.nr_banks;
     __be32 reg[nr_cells];
     __be32 *cells;
@@ -594,7 +594,7 @@ static int make_memory_node(const struct domain *d,
         DPRINT("  Bank %d: %#"PRIx64"->%#"PRIx64"\n",
                 i, start, start + size);
 
-        dt_set_range(&cells, parent, start, size);
+        dt_child_set_range(&cells, parent, start, size);
     }
 
     res = fdt_property(fdt, "reg", reg, sizeof(reg));
@@ -617,8 +617,8 @@ static int make_hypervisor_node(const struct kernel_info *kinfo,
     __be32 *cells;
     int res;
     /* Convenience alias */
-    int addrcells = dt_n_addr_cells(parent);
-    int sizecells = dt_n_size_cells(parent);
+    int addrcells = dt_child_n_addr_cells(parent);
+    int sizecells = dt_child_n_size_cells(parent);
     void *fdt = kinfo->fdt;
 
     DPRINT("Create hypervisor node\n");
@@ -643,7 +643,7 @@ static int make_hypervisor_node(const struct kernel_info *kinfo,
 
     /* reg 0 is grant table space */
     cells = &reg[0];
-    dt_set_range(&cells, parent, kinfo->gnttab_start, kinfo->gnttab_size);
+    dt_child_set_range(&cells, parent, kinfo->gnttab_start, kinfo->gnttab_size);
     res = fdt_property(fdt, "reg", reg,
                        dt_cells_to_size(addrcells + sizecells));
     if ( res )
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 18cdb6f..87c3f71 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -117,6 +117,13 @@ void dt_set_range(__be32 **cellp, const struct dt_device_node *np,
     dt_set_cell(cellp, dt_n_size_cells(np), size);
 }
 
+void dt_child_set_range(__be32 **cellp, const struct dt_device_node *parent,
+                        u64 address, u64 size)
+{
+    dt_set_cell(cellp, dt_child_n_addr_cells(parent), address);
+    dt_set_cell(cellp, dt_child_n_size_cells(parent), size);
+}
+
 static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
                                        unsigned long align)
 {
@@ -386,13 +393,15 @@ dt_find_matching_node(struct dt_device_node *from,
     return NULL;
 }
 
-int dt_n_addr_cells(const struct dt_device_node *np)
+static int __dt_n_addr_cells(const struct dt_device_node *np, bool_t parent)
 {
     const __be32 *ip;
 
     do {
-        if ( np->parent )
+        if ( np->parent && !parent )
             np = np->parent;
+        parent = false;
+
         ip = dt_get_property(np, "#address-cells", NULL);
         if ( ip )
             return be32_to_cpup(ip);
@@ -401,13 +410,15 @@ int dt_n_addr_cells(const struct dt_device_node *np)
     return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
 }
 
-int dt_n_size_cells(const struct dt_device_node *np)
+int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
 {
     const __be32 *ip;
 
     do {
-        if ( np->parent )
+        if ( np->parent && !parent )
             np = np->parent;
+        parent = false;
+
         ip = dt_get_property(np, "#size-cells", NULL);
         if ( ip )
             return be32_to_cpup(ip);
@@ -416,6 +427,26 @@ int dt_n_size_cells(const struct dt_device_node *np)
     return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
 }
 
+int dt_n_addr_cells(const struct dt_device_node *np)
+{
+    return __dt_n_addr_cells(np, false);
+}
+
+int dt_n_size_cells(const struct dt_device_node *np)
+{
+    return __dt_n_size_cells(np, false);
+}
+
+int dt_child_n_addr_cells(const struct dt_device_node *parent)
+{
+    return __dt_n_addr_cells(parent, true);
+}
+
+int dt_child_n_size_cells(const struct dt_device_node *parent)
+{
+    return __dt_n_size_cells(parent, true);
+}
+
 /*
  * These are defined in Linux where much of this code comes from, but
  * are currently unused outside this file in the context of Xen.
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 46c5ba8..5c03f40 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -584,6 +584,25 @@ int dt_n_size_cells(const struct dt_device_node *np);
 int dt_n_addr_cells(const struct dt_device_node *np);
 
 /**
+ * dt_child_n_size_cells - Helper to retrieve the number of cell for the size
+ * @parent: parent of the child to get the value
+ *
+ * This function retrieves for a given device-tree node the number of
+ * cell for the size field of there child
+ */
+int dt_child_n_size_cells(const struct dt_device_node *parent);
+
+/**
+ * dt_child_n_addr_cells - Helper to retrieve the number of cell for the
+ * address
+ * @parent: parent of the child to get the value
+ *
+ * This function retrieves for a given device-tree node the number of
+ * cell for the address field of there child
+ */
+int dt_child_n_addr_cells(const struct dt_device_node *parent);
+
+/**
  * dt_device_is_available - Check if a device is available for use
  *
  * @device: Node to check for availability
@@ -655,6 +674,20 @@ void dt_set_range(__be32 **cellp, const struct dt_device_node *np,
                   u64 address, u64 size);
 
 /**
+ * dt_child_set_range - Write range into a series of cells
+ *
+ * @cellp: Pointer to cells
+ * @parent: Parent node which contains the encode for the address and the size
+ * @address: Start of range
+ * @size: Size of the range
+ *
+ * Write a range into a series of cells and update cellp to point to the
+ * cell just after.
+ */
+void dt_child_set_range(__be32 **cellp, const struct dt_device_node *parent,
+                        u64 address, u64 size);
+
+/**
  * dt_get_range - Read a range (address/size) from a series of cells
  *
  * @cellp: Pointer to cells
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:23:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAPx-0008No-94; Mon, 05 Oct 2015 18:23: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 1ZjAPw-0008NU-3E
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:20 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	10/80-29649-710C2165; Mon, 05 Oct 2015 18:23:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1444069397!48038612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13268 invoked from network); 5 Oct 2015 18:23:18 -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;
	5 Oct 2015 18:23:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPt-0004w1-Ih
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPt-00046R-FC
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:17 +0000
Date: Mon, 05 Oct 2015 18:23:17 +0000
Message-Id: <E1ZjAPt-00046R-FC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Warn when a device tree path
	will be re-used by 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 380467c375deaf79aaca802cf8759d68a81c4009
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 17:21:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:51:39 2015 +0100

    xen/arm: Warn when a device tree path will be re-used by Xen
    
    Xen is unconditionally using certain device tree paths to create DOM0
    specific node (for instance /psci, /memory and /hypervisor).
    
    Print a warning message on the console to let the user know if we
    re-use one of these nodes.
    
    Note that the content of most of those is very common and they
    should have already been skipped via the compatible string or type
    string. This warning is here to catch unusual device-tree and
    compatible string that we may not yet support in Xen.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e8f024f..eb93a3a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1205,6 +1205,13 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         DT_MATCH_TIMER,
         { /* sentinel */ },
     };
+    static const struct dt_device_match reserved_matches[] __initconst =
+    {
+        DT_MATCH_PATH("/psci"),
+        DT_MATCH_PATH("/memory"),
+        DT_MATCH_PATH("/hypervisor"),
+        { /* sentinel */ },
+    };
     struct dt_device_node *child;
     int res;
     const char *name;
@@ -1252,6 +1259,15 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
+    /*
+     * Xen is using some path for its own purpose. Warn if a node
+     * already exists with the same path.
+     */
+    if ( dt_match_node(reserved_matches, node) )
+        printk(XENLOG_WARNING
+               "WARNING: Path %s is reserved, skip the node as we may re-use the path.\n",
+               path);
+
     res = handle_device(d, node);
     if ( res)
         return res;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:23:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAPx-0008No-94; Mon, 05 Oct 2015 18:23: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 1ZjAPw-0008NU-3E
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:20 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	10/80-29649-710C2165; Mon, 05 Oct 2015 18:23:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1444069397!48038612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13268 invoked from network); 5 Oct 2015 18:23:18 -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;
	5 Oct 2015 18:23:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPt-0004w1-Ih
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAPt-00046R-FC
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:17 +0000
Date: Mon, 05 Oct 2015 18:23:17 +0000
Message-Id: <E1ZjAPt-00046R-FC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Warn when a device tree path
	will be re-used by 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 380467c375deaf79aaca802cf8759d68a81c4009
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 17:21:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:51:39 2015 +0100

    xen/arm: Warn when a device tree path will be re-used by Xen
    
    Xen is unconditionally using certain device tree paths to create DOM0
    specific node (for instance /psci, /memory and /hypervisor).
    
    Print a warning message on the console to let the user know if we
    re-use one of these nodes.
    
    Note that the content of most of those is very common and they
    should have already been skipped via the compatible string or type
    string. This warning is here to catch unusual device-tree and
    compatible string that we may not yet support in Xen.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e8f024f..eb93a3a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1205,6 +1205,13 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         DT_MATCH_TIMER,
         { /* sentinel */ },
     };
+    static const struct dt_device_match reserved_matches[] __initconst =
+    {
+        DT_MATCH_PATH("/psci"),
+        DT_MATCH_PATH("/memory"),
+        DT_MATCH_PATH("/hypervisor"),
+        { /* sentinel */ },
+    };
     struct dt_device_node *child;
     int res;
     const char *name;
@@ -1252,6 +1259,15 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
+    /*
+     * Xen is using some path for its own purpose. Warn if a node
+     * already exists with the same path.
+     */
+    if ( dt_match_node(reserved_matches, node) )
+        printk(XENLOG_WARNING
+               "WARNING: Path %s is reserved, skip the node as we may re-use the path.\n",
+               path);
+
     res = handle_device(d, node);
     if ( res)
         return res;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:23:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23: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 1ZjAQ7-0008Pq-Bn; Mon, 05 Oct 2015 18:23:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQ6-0008PV-24
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:30 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	5C/0C-06179-120C2165; Mon, 05 Oct 2015 18:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1444069408!16576152!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9003 invoked from network); 5 Oct 2015 18:23:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:23:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQ3-0004w9-SZ
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQ3-00046p-QT
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:27 +0000
Date: Mon, 05 Oct 2015 18:23:27 +0000
Message-Id: <E1ZjAQ3-00046p-QT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Drop cbase from
	arch_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 810a50db69703f715d199d6b3a5f08193155d48b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 17:21:38 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:51:58 2015 +0100

    xen/arm: vgic-v2: Drop cbase from arch_domain
    
    The field value is only used within a single function in the vgic-v2
    emulation. So it's not necessary to store the value in the domain
    structure.
    
    This is also saving 8 bytes on a structure which begin to be constrained
    (the maximum size of struct domain is 4KB).
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c       |   11 ++++++-----
 xen/include/asm-arm/domain.h |    1 -
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index f886724..309d579 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -548,6 +548,7 @@ static int vgic_v2_vcpu_init(struct vcpu *v)
 static int vgic_v2_domain_init(struct domain *d)
 {
     int i, ret;
+    paddr_t cbase;
 
     /*
      * The hardware domain gets the hardware address.
@@ -556,12 +557,12 @@ static int vgic_v2_domain_init(struct domain *d)
     if ( is_hardware_domain(d) )
     {
         d->arch.vgic.dbase = vgic_v2_hw.dbase;
-        d->arch.vgic.cbase = vgic_v2_hw.cbase;
+        cbase = vgic_v2_hw.cbase;
     }
     else
     {
         d->arch.vgic.dbase = GUEST_GICD_BASE;
-        d->arch.vgic.cbase = GUEST_GICC_BASE;
+        cbase = GUEST_GICC_BASE;
     }
 
     /*
@@ -571,16 +572,16 @@ static int vgic_v2_domain_init(struct domain *d)
      * The second page is always mapped at +4K irrespective of the
      * GIC_64K_STRIDE quirk. The DTB passed to the guest reflects this.
      */
-    ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase), 1,
+    ret = map_mmio_regions(d, paddr_to_pfn(cbase), 1,
                            paddr_to_pfn(vgic_v2_hw.vbase));
     if ( ret )
         return ret;
 
     if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
+        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
                                1, paddr_to_pfn(vgic_v2_hw.vbase + PAGE_SIZE));
     else
-        ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
+        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
                                1, paddr_to_pfn(vgic_v2_hw.vbase + SZ_64K));
 
     if ( ret )
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 01859cc..b89727e 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -102,7 +102,6 @@ struct arch_domain
         struct pending_irq *pending_irqs;
         /* Base address for guest GIC */
         paddr_t dbase; /* Distributor base address */
-        paddr_t cbase; /* CPU base address */
 #ifdef HAS_GICV3
         /* GIC V3 addressing */
         /* List of contiguous occupied by the redistributors */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:23:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23: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 1ZjAQ7-0008Pq-Bn; Mon, 05 Oct 2015 18:23:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQ6-0008PV-24
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:30 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	5C/0C-06179-120C2165; Mon, 05 Oct 2015 18:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1444069408!16576152!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9003 invoked from network); 5 Oct 2015 18:23:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:23:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQ3-0004w9-SZ
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQ3-00046p-QT
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:27 +0000
Date: Mon, 05 Oct 2015 18:23:27 +0000
Message-Id: <E1ZjAQ3-00046p-QT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Drop cbase from
	arch_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 810a50db69703f715d199d6b3a5f08193155d48b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Sep 29 17:21:38 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 1 13:51:58 2015 +0100

    xen/arm: vgic-v2: Drop cbase from arch_domain
    
    The field value is only used within a single function in the vgic-v2
    emulation. So it's not necessary to store the value in the domain
    structure.
    
    This is also saving 8 bytes on a structure which begin to be constrained
    (the maximum size of struct domain is 4KB).
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c       |   11 ++++++-----
 xen/include/asm-arm/domain.h |    1 -
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index f886724..309d579 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -548,6 +548,7 @@ static int vgic_v2_vcpu_init(struct vcpu *v)
 static int vgic_v2_domain_init(struct domain *d)
 {
     int i, ret;
+    paddr_t cbase;
 
     /*
      * The hardware domain gets the hardware address.
@@ -556,12 +557,12 @@ static int vgic_v2_domain_init(struct domain *d)
     if ( is_hardware_domain(d) )
     {
         d->arch.vgic.dbase = vgic_v2_hw.dbase;
-        d->arch.vgic.cbase = vgic_v2_hw.cbase;
+        cbase = vgic_v2_hw.cbase;
     }
     else
     {
         d->arch.vgic.dbase = GUEST_GICD_BASE;
-        d->arch.vgic.cbase = GUEST_GICC_BASE;
+        cbase = GUEST_GICC_BASE;
     }
 
     /*
@@ -571,16 +572,16 @@ static int vgic_v2_domain_init(struct domain *d)
      * The second page is always mapped at +4K irrespective of the
      * GIC_64K_STRIDE quirk. The DTB passed to the guest reflects this.
      */
-    ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase), 1,
+    ret = map_mmio_regions(d, paddr_to_pfn(cbase), 1,
                            paddr_to_pfn(vgic_v2_hw.vbase));
     if ( ret )
         return ret;
 
     if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
+        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
                                1, paddr_to_pfn(vgic_v2_hw.vbase + PAGE_SIZE));
     else
-        ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
+        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
                                1, paddr_to_pfn(vgic_v2_hw.vbase + SZ_64K));
 
     if ( ret )
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 01859cc..b89727e 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -102,7 +102,6 @@ struct arch_domain
         struct pending_irq *pending_irqs;
         /* Base address for guest GIC */
         paddr_t dbase; /* Distributor base address */
-        paddr_t cbase; /* CPU base address */
 #ifdef HAS_GICV3
         /* GIC V3 addressing */
         /* List of contiguous occupied by the redistributors */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:23:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAQI-0008Rn-EN; Mon, 05 Oct 2015 18:23: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 1ZjAQG-0008RQ-NY
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:40 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	68/A2-03819-C20C2165; Mon, 05 Oct 2015 18:23:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1444069418!7927750!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26082 invoked from network); 5 Oct 2015 18:23:39 -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;
	5 Oct 2015 18:23:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQE-0004wH-8g
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQE-00048Y-66
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:38 +0000
Date: Mon, 05 Oct 2015 18:23:38 +0000
Message-Id: <E1ZjAQE-00048Y-66@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: write a high level description of
	the sub-arch choices for heap layout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6e348570c80206fa17476e2feb4ac77371e4f10
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Sep 30 14:36:03 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 2 12:04:15 2015 +0100

    xen: write a high level description of the sub-arch choices for heap layout
    
    The 3 options which (sub)arches have for the layout of their heaps is
    a little subtle (in particular the two CONFIG_SEPARATE_XENHEAP=n
    submodes) and can be a bit tricky to derive from the code.
    
    Therefore try and write down some guidance on what the various modes
    are.
    
    Note that this is intended more as a high level overview rather than a
    detailed guide to the full page allocator interfaces.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/page_alloc.c |  100 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 100 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2b8810c..abd5448 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -20,6 +20,106 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+/*
+ * In general Xen maintains two pools of memory:
+ *
+ * - Xen heap: Memory which is always mapped (i.e accessible by
+ *             virtual address), via a permanent and contiguous
+ *             "direct mapping". Macros like va() and pa() are valid
+ *             for such memory and it is always permissible to stash
+ *             pointers to Xen heap memory in data structures etc.
+ *
+ *             Xen heap pages are always anonymous (that is, not tied
+ *             or accounted to any particular domain).
+ *
+ * - Dom heap: Memory which must be explicitly mapped, usually
+ *             transiently with map_domain_page(), in order to be
+ *             used. va() and pa() are not valid for such memory. Care
+ *             should be taken when stashing pointers to dom heap
+ *             pages that those mappings are permanent (e.g. vmap() or
+ *             map_domain_page_global()), it is not safe to stash
+ *             transient mappings such as those from map_domain_page()
+ *
+ *             Dom heap pages are often tied to a particular domain,
+ *             but need not be (passing domain==NULL results in an
+ *             anonymous dom heap allocation).
+ *
+ * The exact nature of this split is a (sub)arch decision which can
+ * select one of three main variants:
+ *
+ * CONFIG_SEPARATE_XENHEAP=y
+ *
+ *   The xen heap is maintained as an entirely separate heap.
+ *
+ *   Arch code arranges for some (perhaps small) amount of physical
+ *   memory to be covered by a direct mapping and registers that
+ *   memory as the Xen heap (via init_xenheap_pages()) and the
+ *   remainder as the dom heap.
+ *
+ *   This mode of operation is most commonly used by 32-bit arches
+ *   where the virtual address space is insufficient to map all RAM.
+ *
+ * CONFIG_SEPARATE_XENHEAP=n W/ DIRECT MAP OF ALL RAM
+ *
+ *   All of RAM is covered by a permanent contiguous mapping and there
+ *   is only a single heap.
+ *
+ *   Memory allocated from the Xen heap is flagged (in
+ *   page_info.count_info) with PGC_xen_heap. Memory allocated from
+ *   the Dom heap must still be explicitly mapped before use
+ *   (e.g. with map_domain_page) in particular in common code.
+ *
+ *   xenheap_max_mfn() should not be called by arch code.
+ *
+ *   This mode of operation is most commonly used by 64-bit arches
+ *   which have sufficient free virtual address space to permanently
+ *   map the largest practical amount RAM currently expected on that
+ *   arch.
+ *
+ * CONFIG_SEPARATE_XENHEAP=n W/ DIRECT MAP OF ONLY PARTIAL RAM
+ *
+ *   There is a single heap, but only the beginning (up to some
+ *   threshold) is covered by a permanent contiguous mapping.
+ *
+ *   Memory allocated from the Xen heap is allocated from below the
+ *   threshold and flagged with PGC_xen_heap. Memory allocated from
+ *   the dom heap is allocated from anywhere in the heap (although it
+ *   will prefer to allocate from as high as possible to try and keep
+ *   Xen heap suitable memory available).
+ *
+ *   Arch code must call xenheap_max_mfn() to signal the limit of the
+ *   direct mapping.
+ *
+ *   This mode of operation is most commonly used by 64-bit arches
+ *   which have a restricted amount of virtual address space available
+ *   for a direct map (due to e.g. reservations for other purposes)
+ *   such that it is not possible to map all of RAM on systems with
+ *   the largest practical amount of RAM currently expected on that
+ *   arch.
+ *
+ * Boot Allocator
+ *
+ *   In addition to the two primary pools (xen heap and dom heap) a
+ *   third "boot allocator" is used at start of day. This is a
+ *   simplified allocator which can be used.
+ *
+ *   Typically all memory which is destined to be dom heap memory
+ *   (which is everything in the CONFIG_SEPARATE_XENHEAP=n
+ *   configurations) is first allocated to the boot allocator (with
+ *   init_boot_pages()) and is then handed over to the main dom heap in
+ *   end_boot_allocator().
+ *
+ * "Contiguous" mappings
+ *
+ *   Note that although the above talks about "contiguous" mappings
+ *   some architectures implement a scheme ("PDX compression") to
+ *   compress unused portions of the machine address space (i.e. large
+ *   gaps between distinct banks of memory) in order to avoid creating
+ *   enormous frame tables and direct maps which mostly map
+ *   nothing. Thus a contiguous mapping may still have distinct
+ *   regions within it.
+ */
+
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/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 Mon Oct 05 18:23:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAQI-0008Rn-EN; Mon, 05 Oct 2015 18:23: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 1ZjAQG-0008RQ-NY
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:40 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	68/A2-03819-C20C2165; Mon, 05 Oct 2015 18:23:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1444069418!7927750!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26082 invoked from network); 5 Oct 2015 18:23:39 -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;
	5 Oct 2015 18:23:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQE-0004wH-8g
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQE-00048Y-66
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:38 +0000
Date: Mon, 05 Oct 2015 18:23:38 +0000
Message-Id: <E1ZjAQE-00048Y-66@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: write a high level description of
	the sub-arch choices for heap layout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6e348570c80206fa17476e2feb4ac77371e4f10
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Sep 30 14:36:03 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 2 12:04:15 2015 +0100

    xen: write a high level description of the sub-arch choices for heap layout
    
    The 3 options which (sub)arches have for the layout of their heaps is
    a little subtle (in particular the two CONFIG_SEPARATE_XENHEAP=n
    submodes) and can be a bit tricky to derive from the code.
    
    Therefore try and write down some guidance on what the various modes
    are.
    
    Note that this is intended more as a high level overview rather than a
    detailed guide to the full page allocator interfaces.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/page_alloc.c |  100 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 100 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2b8810c..abd5448 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -20,6 +20,106 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+/*
+ * In general Xen maintains two pools of memory:
+ *
+ * - Xen heap: Memory which is always mapped (i.e accessible by
+ *             virtual address), via a permanent and contiguous
+ *             "direct mapping". Macros like va() and pa() are valid
+ *             for such memory and it is always permissible to stash
+ *             pointers to Xen heap memory in data structures etc.
+ *
+ *             Xen heap pages are always anonymous (that is, not tied
+ *             or accounted to any particular domain).
+ *
+ * - Dom heap: Memory which must be explicitly mapped, usually
+ *             transiently with map_domain_page(), in order to be
+ *             used. va() and pa() are not valid for such memory. Care
+ *             should be taken when stashing pointers to dom heap
+ *             pages that those mappings are permanent (e.g. vmap() or
+ *             map_domain_page_global()), it is not safe to stash
+ *             transient mappings such as those from map_domain_page()
+ *
+ *             Dom heap pages are often tied to a particular domain,
+ *             but need not be (passing domain==NULL results in an
+ *             anonymous dom heap allocation).
+ *
+ * The exact nature of this split is a (sub)arch decision which can
+ * select one of three main variants:
+ *
+ * CONFIG_SEPARATE_XENHEAP=y
+ *
+ *   The xen heap is maintained as an entirely separate heap.
+ *
+ *   Arch code arranges for some (perhaps small) amount of physical
+ *   memory to be covered by a direct mapping and registers that
+ *   memory as the Xen heap (via init_xenheap_pages()) and the
+ *   remainder as the dom heap.
+ *
+ *   This mode of operation is most commonly used by 32-bit arches
+ *   where the virtual address space is insufficient to map all RAM.
+ *
+ * CONFIG_SEPARATE_XENHEAP=n W/ DIRECT MAP OF ALL RAM
+ *
+ *   All of RAM is covered by a permanent contiguous mapping and there
+ *   is only a single heap.
+ *
+ *   Memory allocated from the Xen heap is flagged (in
+ *   page_info.count_info) with PGC_xen_heap. Memory allocated from
+ *   the Dom heap must still be explicitly mapped before use
+ *   (e.g. with map_domain_page) in particular in common code.
+ *
+ *   xenheap_max_mfn() should not be called by arch code.
+ *
+ *   This mode of operation is most commonly used by 64-bit arches
+ *   which have sufficient free virtual address space to permanently
+ *   map the largest practical amount RAM currently expected on that
+ *   arch.
+ *
+ * CONFIG_SEPARATE_XENHEAP=n W/ DIRECT MAP OF ONLY PARTIAL RAM
+ *
+ *   There is a single heap, but only the beginning (up to some
+ *   threshold) is covered by a permanent contiguous mapping.
+ *
+ *   Memory allocated from the Xen heap is allocated from below the
+ *   threshold and flagged with PGC_xen_heap. Memory allocated from
+ *   the dom heap is allocated from anywhere in the heap (although it
+ *   will prefer to allocate from as high as possible to try and keep
+ *   Xen heap suitable memory available).
+ *
+ *   Arch code must call xenheap_max_mfn() to signal the limit of the
+ *   direct mapping.
+ *
+ *   This mode of operation is most commonly used by 64-bit arches
+ *   which have a restricted amount of virtual address space available
+ *   for a direct map (due to e.g. reservations for other purposes)
+ *   such that it is not possible to map all of RAM on systems with
+ *   the largest practical amount of RAM currently expected on that
+ *   arch.
+ *
+ * Boot Allocator
+ *
+ *   In addition to the two primary pools (xen heap and dom heap) a
+ *   third "boot allocator" is used at start of day. This is a
+ *   simplified allocator which can be used.
+ *
+ *   Typically all memory which is destined to be dom heap memory
+ *   (which is everything in the CONFIG_SEPARATE_XENHEAP=n
+ *   configurations) is first allocated to the boot allocator (with
+ *   init_boot_pages()) and is then handed over to the main dom heap in
+ *   end_boot_allocator().
+ *
+ * "Contiguous" mappings
+ *
+ *   Note that although the above talks about "contiguous" mappings
+ *   some architectures implement a scheme ("PDX compression") to
+ *   compress unused portions of the machine address space (i.e. large
+ *   gaps between distinct banks of memory) in order to avoid creating
+ *   enormous frame tables and direct maps which mostly map
+ *   nothing. Thus a contiguous mapping may still have distinct
+ *   regions within it.
+ */
+
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/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 Mon Oct 05 18:23:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23: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 1ZjAQV-0008To-HE; Mon, 05 Oct 2015 18:23: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 1ZjAQT-0008TT-Gk
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:53 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	28/98-18886-830C2165; Mon, 05 Oct 2015 18:23:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1444069428!23001390!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 11129 invoked from network); 5 Oct 2015 18:23:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:23:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQO-0004wP-HR
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQO-000490-Ec
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:48 +0000
Date: Mon, 05 Oct 2015 18:23:48 +0000
Message-Id: <E1ZjAQO-000490-Ec@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EPT: work around hardware erratum
	setting A bit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33b55dc10342570aad77bd2fa221189df0ebca4e
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Fri Oct 2 13:39:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:39:12 2015 +0200

    x86/EPT: work around hardware erratum setting A bit
    
    Since commit 191b3f3344ee ("p2m/ept: enable PML in p2m-ept for
    log-dirty"), the A and D bits of EPT paging entries are set
    unconditionally, regardless of whether PML is enabled or not. This
    causes a regression in Xen 4.6 on some processors due to Intel Errata
    AVR41 -- HVM guests get severe memory corruption when the A bit is set
    due to incorrect TLB flushing on mov to cr3. The erratum affects the
    Atom C2000 family (Avoton).
    
    To fix, do not set the A bit on this processor family.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    
    Move feature suppression to feature detection code. Add command line
    override.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |   27 ++++++++++++++++++---------
 xen/arch/x86/hvm/vmx/vmcs.c         |   11 +++++++++++
 xen/arch/x86/mm/p2m-ept.c           |   16 ++++++++--------
 xen/include/asm-x86/hvm/vmx/vmx.h   |    1 +
 4 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a2e427c..a565c1b 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -705,19 +705,28 @@ virtualization, to allow the L1 hypervisor to use EPT even if the L0 hypervisor
 does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT.
 
 ### ept (Intel)
-> `= List of ( pml<boolean> )`
+> `= List of ( {no-}pml | {no-}ad )`
+
+Controls EPT related features.
+
+> Sub-options:
+
+> `pml`
 
 > Default: `false`
 
-Controls EPT related features. Currently only Page Modification Logging (PML) is
-the controllable feature as boolean type.
+>> PML is a new hardware feature in Intel's Broadwell Server and further
+>> platforms which reduces hypervisor overhead of log-dirty mechanism by
+>> automatically recording GPAs (guest physical addresses) when guest memory
+>> gets dirty, and therefore significantly reducing number of EPT violation
+>> caused by write protection of guest memory, which is a necessity to
+>> implement log-dirty mechanism before PML.
+
+> `ad`
+
+> Default: Hardware dependent
 
-PML is a new hardware feature in Intel's Broadwell Server and further platforms
-which reduces hypervisor overhead of log-dirty mechanism by automatically
-recording GPAs (guest physical addresses) when guest memory gets dirty, and
-therefore significantly reducing number of EPT violation caused by write
-protection of guest memory, which is a necessity to implement log-dirty
-mechanism before PML.
+>> Have hardware keep accessed/dirty (A/D) bits updated.
 
 ### gdb
 > `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 15b136b..3592a88 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -64,12 +64,14 @@ static unsigned int __read_mostly ple_window = 4096;
 integer_param("ple_window", ple_window);
 
 static bool_t __read_mostly opt_pml_enabled = 0;
+static s8 __read_mostly opt_ept_ad = -1;
 
 /*
  * The 'ept' parameter controls functionalities that depend on, or impact the
  * EPT mechanism. Optional comma separated value may contain:
  *
  *  pml                 Enable PML
+ *  ad                  Use A/D bits
  */
 static void __init parse_ept_param(char *s)
 {
@@ -87,6 +89,8 @@ static void __init parse_ept_param(char *s)
 
         if ( !strcmp(s, "pml") )
             opt_pml_enabled = val;
+        else if ( !strcmp(s, "ad") )
+            opt_ept_ad = val;
 
         s = ss + 1;
     } while ( ss );
@@ -268,6 +272,13 @@ static int vmx_init_vmcs_config(void)
     {
         rdmsrl(MSR_IA32_VMX_EPT_VPID_CAP, _vmx_ept_vpid_cap);
 
+        if ( !opt_ept_ad )
+            _vmx_ept_vpid_cap &= ~VMX_EPT_AD_BIT;
+        else if ( /* Work around Erratum AVR41 on Avoton processors. */
+                  boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x4d &&
+                  opt_ept_ad < 0 )
+            _vmx_ept_vpid_cap &= ~VMX_EPT_AD_BIT;
+
         /*
          * Additional sanity checking before using EPT:
          * 1) the CPU we are running on must support EPT WB, as we will set
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 0d87ebc..74ce9e0 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -130,14 +130,14 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
             break;
         case p2m_ram_rw:
             entry->r = entry->w = entry->x = 1;
-            entry->a = entry->d = 1;
+            entry->a = entry->d = !!cpu_has_vmx_ept_ad;
             break;
         case p2m_mmio_direct:
             entry->r = entry->x = 1;
             entry->w = !rangeset_contains_singleton(mmio_ro_ranges,
                                                     entry->mfn);
-            entry->a = 1;
-            entry->d = entry->w;
+            entry->a = !!cpu_has_vmx_ept_ad;
+            entry->d = entry->w && cpu_has_vmx_ept_ad;
             break;
         case p2m_ram_logdirty:
             entry->r = entry->x = 1;
@@ -152,7 +152,7 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
                 entry->w = 1;
             else
                 entry->w = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             /* For both PML or non-PML cases we clear D bit anyway */
             entry->d = 0;
             break;
@@ -160,20 +160,20 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
         case p2m_ram_shared:
             entry->r = entry->x = 1;
             entry->w = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             entry->d = 0;
             break;
         case p2m_grant_map_rw:
         case p2m_map_foreign:
             entry->r = entry->w = 1;
             entry->x = 0;
-            entry->a = entry->d = 1;
+            entry->a = entry->d = !!cpu_has_vmx_ept_ad;
             break;
         case p2m_grant_map_ro:
         case p2m_mmio_write_dm:
             entry->r = 1;
             entry->w = entry->x = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             entry->d = 0;
             break;
     }
@@ -233,7 +233,7 @@ static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry)
 
     ept_entry->r = ept_entry->w = ept_entry->x = 1;
     /* Manually set A bit to avoid overhead of MMU having to write it later. */
-    ept_entry->a = 1;
+    ept_entry->a = !!cpu_has_vmx_ept_ad;
 
     ept_entry->suppress_ve = 1;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 3fbfa44..2ed62f9 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -262,6 +262,7 @@ extern uint8_t posted_intr_vector;
     (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_1GB)
 #define cpu_has_vmx_ept_2mb                     \
     (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_2MB)
+#define cpu_has_vmx_ept_ad (vmx_ept_vpid_cap & VMX_EPT_AD_BIT)
 #define cpu_has_vmx_ept_invept_single_context   \
     (vmx_ept_vpid_cap & VMX_EPT_INVEPT_SINGLE_CONTEXT)
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:23:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:23: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 1ZjAQV-0008To-HE; Mon, 05 Oct 2015 18:23: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 1ZjAQT-0008TT-Gk
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:53 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	28/98-18886-830C2165; Mon, 05 Oct 2015 18:23:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1444069428!23001390!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 11129 invoked from network); 5 Oct 2015 18:23:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:23:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQO-0004wP-HR
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQO-000490-Ec
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:48 +0000
Date: Mon, 05 Oct 2015 18:23:48 +0000
Message-Id: <E1ZjAQO-000490-Ec@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EPT: work around hardware erratum
	setting A bit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33b55dc10342570aad77bd2fa221189df0ebca4e
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Fri Oct 2 13:39:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:39:12 2015 +0200

    x86/EPT: work around hardware erratum setting A bit
    
    Since commit 191b3f3344ee ("p2m/ept: enable PML in p2m-ept for
    log-dirty"), the A and D bits of EPT paging entries are set
    unconditionally, regardless of whether PML is enabled or not. This
    causes a regression in Xen 4.6 on some processors due to Intel Errata
    AVR41 -- HVM guests get severe memory corruption when the A bit is set
    due to incorrect TLB flushing on mov to cr3. The erratum affects the
    Atom C2000 family (Avoton).
    
    To fix, do not set the A bit on this processor family.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    
    Move feature suppression to feature detection code. Add command line
    override.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |   27 ++++++++++++++++++---------
 xen/arch/x86/hvm/vmx/vmcs.c         |   11 +++++++++++
 xen/arch/x86/mm/p2m-ept.c           |   16 ++++++++--------
 xen/include/asm-x86/hvm/vmx/vmx.h   |    1 +
 4 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a2e427c..a565c1b 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -705,19 +705,28 @@ virtualization, to allow the L1 hypervisor to use EPT even if the L0 hypervisor
 does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT.
 
 ### ept (Intel)
-> `= List of ( pml<boolean> )`
+> `= List of ( {no-}pml | {no-}ad )`
+
+Controls EPT related features.
+
+> Sub-options:
+
+> `pml`
 
 > Default: `false`
 
-Controls EPT related features. Currently only Page Modification Logging (PML) is
-the controllable feature as boolean type.
+>> PML is a new hardware feature in Intel's Broadwell Server and further
+>> platforms which reduces hypervisor overhead of log-dirty mechanism by
+>> automatically recording GPAs (guest physical addresses) when guest memory
+>> gets dirty, and therefore significantly reducing number of EPT violation
+>> caused by write protection of guest memory, which is a necessity to
+>> implement log-dirty mechanism before PML.
+
+> `ad`
+
+> Default: Hardware dependent
 
-PML is a new hardware feature in Intel's Broadwell Server and further platforms
-which reduces hypervisor overhead of log-dirty mechanism by automatically
-recording GPAs (guest physical addresses) when guest memory gets dirty, and
-therefore significantly reducing number of EPT violation caused by write
-protection of guest memory, which is a necessity to implement log-dirty
-mechanism before PML.
+>> Have hardware keep accessed/dirty (A/D) bits updated.
 
 ### gdb
 > `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 15b136b..3592a88 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -64,12 +64,14 @@ static unsigned int __read_mostly ple_window = 4096;
 integer_param("ple_window", ple_window);
 
 static bool_t __read_mostly opt_pml_enabled = 0;
+static s8 __read_mostly opt_ept_ad = -1;
 
 /*
  * The 'ept' parameter controls functionalities that depend on, or impact the
  * EPT mechanism. Optional comma separated value may contain:
  *
  *  pml                 Enable PML
+ *  ad                  Use A/D bits
  */
 static void __init parse_ept_param(char *s)
 {
@@ -87,6 +89,8 @@ static void __init parse_ept_param(char *s)
 
         if ( !strcmp(s, "pml") )
             opt_pml_enabled = val;
+        else if ( !strcmp(s, "ad") )
+            opt_ept_ad = val;
 
         s = ss + 1;
     } while ( ss );
@@ -268,6 +272,13 @@ static int vmx_init_vmcs_config(void)
     {
         rdmsrl(MSR_IA32_VMX_EPT_VPID_CAP, _vmx_ept_vpid_cap);
 
+        if ( !opt_ept_ad )
+            _vmx_ept_vpid_cap &= ~VMX_EPT_AD_BIT;
+        else if ( /* Work around Erratum AVR41 on Avoton processors. */
+                  boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x4d &&
+                  opt_ept_ad < 0 )
+            _vmx_ept_vpid_cap &= ~VMX_EPT_AD_BIT;
+
         /*
          * Additional sanity checking before using EPT:
          * 1) the CPU we are running on must support EPT WB, as we will set
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 0d87ebc..74ce9e0 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -130,14 +130,14 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
             break;
         case p2m_ram_rw:
             entry->r = entry->w = entry->x = 1;
-            entry->a = entry->d = 1;
+            entry->a = entry->d = !!cpu_has_vmx_ept_ad;
             break;
         case p2m_mmio_direct:
             entry->r = entry->x = 1;
             entry->w = !rangeset_contains_singleton(mmio_ro_ranges,
                                                     entry->mfn);
-            entry->a = 1;
-            entry->d = entry->w;
+            entry->a = !!cpu_has_vmx_ept_ad;
+            entry->d = entry->w && cpu_has_vmx_ept_ad;
             break;
         case p2m_ram_logdirty:
             entry->r = entry->x = 1;
@@ -152,7 +152,7 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
                 entry->w = 1;
             else
                 entry->w = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             /* For both PML or non-PML cases we clear D bit anyway */
             entry->d = 0;
             break;
@@ -160,20 +160,20 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
         case p2m_ram_shared:
             entry->r = entry->x = 1;
             entry->w = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             entry->d = 0;
             break;
         case p2m_grant_map_rw:
         case p2m_map_foreign:
             entry->r = entry->w = 1;
             entry->x = 0;
-            entry->a = entry->d = 1;
+            entry->a = entry->d = !!cpu_has_vmx_ept_ad;
             break;
         case p2m_grant_map_ro:
         case p2m_mmio_write_dm:
             entry->r = 1;
             entry->w = entry->x = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             entry->d = 0;
             break;
     }
@@ -233,7 +233,7 @@ static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry)
 
     ept_entry->r = ept_entry->w = ept_entry->x = 1;
     /* Manually set A bit to avoid overhead of MMU having to write it later. */
-    ept_entry->a = 1;
+    ept_entry->a = !!cpu_has_vmx_ept_ad;
 
     ept_entry->suppress_ve = 1;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 3fbfa44..2ed62f9 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -262,6 +262,7 @@ extern uint8_t posted_intr_vector;
     (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_1GB)
 #define cpu_has_vmx_ept_2mb                     \
     (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_2MB)
+#define cpu_has_vmx_ept_ad (vmx_ept_vpid_cap & VMX_EPT_AD_BIT)
 #define cpu_has_vmx_ept_invept_single_context   \
     (vmx_ept_vpid_cap & VMX_EPT_INVEPT_SINGLE_CONTEXT)
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:24:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjAQd-0008V7-Jh; Mon, 05 Oct 2015 18:24:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQb-0008Uo-Gr
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:02 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	C7/9A-28791-040C2165; Mon, 05 Oct 2015 18:24:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1444069438!55903667!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32056 invoked from network); 5 Oct 2015 18:23:59 -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;
	5 Oct 2015 18:23:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQY-0004wY-Os
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQY-00049Y-ME
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:58 +0000
Date: Mon, 05 Oct 2015 18:23:58 +0000
Message-Id: <E1ZjAQY-00049Y-ME@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-pt: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 660fd65d5578a95ec5eac522128bba23325179eb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:40:36 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:40:36 2015 +0200

    x86/p2m-pt: tighten conditions of IOMMU mapping updates
    
    Whether the MFN changes does not depend on the new entry being valid
    (but solely on the old one), and the need to update or TLB-flush also
    depends on permission changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pt.c |   71 +++++++++++++++++++++++++++++----------------
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index e61d503..9621eb1 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -494,7 +494,18 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     l3_pgentry_t l3e_content;
     int rc;
     unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
-    unsigned long old_mfn = 0;
+    /*
+     * old_mfn and iommu_old_flags control possible flush/update needs on the
+     * IOMMU: We need to flush when MFN or flags (i.e. permissions) change.
+     * iommu_old_flags being initialized to zero covers the case of the entry
+     * getting replaced being a non-present (leaf or intermediate) one. For
+     * present leaf entries the real value will get calculated below, while
+     * for present intermediate entries ~0 (guaranteed != iommu_pte_flags)
+     * will be used (to cover all cases of what the leaf entries underneath
+     * the intermediate one might be).
+     */
+    unsigned int flags, iommu_old_flags = 0;
+    unsigned long old_mfn = INVALID_MFN;
 
     ASSERT(sve != 0);
 
@@ -543,12 +554,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -559,10 +578,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l3e_content.l3;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -587,7 +603,10 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
+        iommu_old_flags =
+            p2m_get_iommu_flags(p2m_flags_to_type(l1e_get_flags(*p2m_entry)));
+        old_mfn = l1e_get_pfn(*p2m_entry);
+
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
                             || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
@@ -596,10 +615,8 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             entry_content = l1e_empty();
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
+
         /* level 1 entry */
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 1);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -610,14 +627,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
-        /* FIXME: Deal with 4k replaced by 2meg pages */
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -631,10 +654,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l2e_content.l2;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -645,11 +665,12 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
-    if ( iommu_enabled && need_iommu(p2m->domain) )
+    if ( iommu_enabled && need_iommu(p2m->domain) &&
+         (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
     {
         if ( iommu_use_hap_pt(p2m->domain) )
         {
-            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
+            if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
         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 Mon Oct 05 18:24:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjAQd-0008V7-Jh; Mon, 05 Oct 2015 18:24:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQb-0008Uo-Gr
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:02 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	C7/9A-28791-040C2165; Mon, 05 Oct 2015 18:24:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1444069438!55903667!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32056 invoked from network); 5 Oct 2015 18:23:59 -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;
	5 Oct 2015 18:23:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQY-0004wY-Os
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQY-00049Y-ME
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:23:58 +0000
Date: Mon, 05 Oct 2015 18:23:58 +0000
Message-Id: <E1ZjAQY-00049Y-ME@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-pt: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 660fd65d5578a95ec5eac522128bba23325179eb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:40:36 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:40:36 2015 +0200

    x86/p2m-pt: tighten conditions of IOMMU mapping updates
    
    Whether the MFN changes does not depend on the new entry being valid
    (but solely on the old one), and the need to update or TLB-flush also
    depends on permission changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pt.c |   71 +++++++++++++++++++++++++++++----------------
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index e61d503..9621eb1 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -494,7 +494,18 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     l3_pgentry_t l3e_content;
     int rc;
     unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
-    unsigned long old_mfn = 0;
+    /*
+     * old_mfn and iommu_old_flags control possible flush/update needs on the
+     * IOMMU: We need to flush when MFN or flags (i.e. permissions) change.
+     * iommu_old_flags being initialized to zero covers the case of the entry
+     * getting replaced being a non-present (leaf or intermediate) one. For
+     * present leaf entries the real value will get calculated below, while
+     * for present intermediate entries ~0 (guaranteed != iommu_pte_flags)
+     * will be used (to cover all cases of what the leaf entries underneath
+     * the intermediate one might be).
+     */
+    unsigned int flags, iommu_old_flags = 0;
+    unsigned long old_mfn = INVALID_MFN;
 
     ASSERT(sve != 0);
 
@@ -543,12 +554,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -559,10 +578,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l3e_content.l3;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -587,7 +603,10 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
+        iommu_old_flags =
+            p2m_get_iommu_flags(p2m_flags_to_type(l1e_get_flags(*p2m_entry)));
+        old_mfn = l1e_get_pfn(*p2m_entry);
+
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
                             || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
@@ -596,10 +615,8 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             entry_content = l1e_empty();
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
+
         /* level 1 entry */
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 1);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -610,14 +627,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
-        /* FIXME: Deal with 4k replaced by 2meg pages */
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -631,10 +654,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l2e_content.l2;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -645,11 +665,12 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
-    if ( iommu_enabled && need_iommu(p2m->domain) )
+    if ( iommu_enabled && need_iommu(p2m->domain) &&
+         (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
     {
         if ( iommu_use_hap_pt(p2m->domain) )
         {
-            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
+            if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
         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 Mon Oct 05 18:24:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjAQm-00005V-Oo; Mon, 05 Oct 2015 18:24: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 1ZjAQl-00005I-Gb
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:11 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	15/94-00475-A40C2165; Mon, 05 Oct 2015 18:24:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1444069449!55925319!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11143 invoked from network); 5 Oct 2015 18:24:10 -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;
	5 Oct 2015 18:24:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQj-0004xC-1g
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQi-0004AC-V7
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:08 +0000
Date: Mon, 05 Oct 2015 18:24:08 +0000
Message-Id: <E1ZjAQi-0004AC-V7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-pt: use pre-calculated IOMMU
	flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit edb9531263e1698343ef3f8743d23b8044979341
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:41:24 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:41:24 2015 +0200

    x86/p2m-pt: use pre-calculated IOMMU flags
    
    ... instead of recalculating them.
    
    At once clean up formatting of the touched code and drop a stray loop
    local variable shadowing a function scope one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/p2m-pt.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 9621eb1..28a31ee 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -673,17 +673,13 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
+        else if ( iommu_pte_flags )
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_map_page(p2m->domain, gfn + i, mfn_x(mfn) + i,
+                               iommu_pte_flags);
         else
-        {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
-                for ( i = 0; i < (1UL << page_order); i++ )
-                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
-            else
-                for ( int i = 0; i < (1UL << page_order); i++ )
-                    iommu_unmap_page(p2m->domain, gfn+i);
-        }
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_unmap_page(p2m->domain, gfn + i);
     }
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:24:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjAQm-00005V-Oo; Mon, 05 Oct 2015 18:24: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 1ZjAQl-00005I-Gb
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:11 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	15/94-00475-A40C2165; Mon, 05 Oct 2015 18:24:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1444069449!55925319!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11143 invoked from network); 5 Oct 2015 18:24:10 -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;
	5 Oct 2015 18:24:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQj-0004xC-1g
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQi-0004AC-V7
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:08 +0000
Date: Mon, 05 Oct 2015 18:24:08 +0000
Message-Id: <E1ZjAQi-0004AC-V7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m-pt: use pre-calculated IOMMU
	flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit edb9531263e1698343ef3f8743d23b8044979341
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:41:24 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:41:24 2015 +0200

    x86/p2m-pt: use pre-calculated IOMMU flags
    
    ... instead of recalculating them.
    
    At once clean up formatting of the touched code and drop a stray loop
    local variable shadowing a function scope one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/p2m-pt.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 9621eb1..28a31ee 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -673,17 +673,13 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
+        else if ( iommu_pte_flags )
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_map_page(p2m->domain, gfn + i, mfn_x(mfn) + i,
+                               iommu_pte_flags);
         else
-        {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
-                for ( i = 0; i < (1UL << page_order); i++ )
-                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
-            else
-                for ( int i = 0; i < (1UL << page_order); i++ )
-                    iommu_unmap_page(p2m->domain, gfn+i);
-        }
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_unmap_page(p2m->domain, gfn + i);
     }
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:24:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAQx-00007M-RS; Mon, 05 Oct 2015 18:24:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQw-00007A-1y
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:22 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	01/61-19110-550C2165; Mon, 05 Oct 2015 18:24:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1444069459!19077858!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16259 invoked from network); 5 Oct 2015 18:24:20 -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;
	5 Oct 2015 18:24:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQt-0004xK-AS
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQt-0004Af-7a
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:19 +0000
Date: Mon, 05 Oct 2015 18:24:19 +0000
Message-Id: <E1ZjAQt-0004Af-7a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: shorten certain operations on
	higher order 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 3c352011c0d39ed23656986f5786498a14f9a96e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:42:01 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:42:01 2015 +0200

    x86/PoD: shorten certain operations on higher order ranges
    
    Now that p2m->get_entry() always returns a valid order, utilize this
    to accelerate some of the operations in PoD code. (There are two uses
    of p2m->get_entry() left which don't easily lend themselves to this
    optimization.)
    
    Also adjust a few types as needed and remove stale comments from
    p2m_pod_cache_add() (to avoid duplicating them yet another time).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |  130 +++++++++++++++++++++++++++------------------
 1 files changed, 78 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 026d455..901da37 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -119,20 +119,23 @@ p2m_pod_cache_add(struct p2m_domain *p2m,
 
     unlock_page_alloc(p2m);
 
-    /* Then add the first one to the appropriate populate-on-demand list */
-    switch(order)
+    /* Then add to the appropriate populate-on-demand list. */
+    switch ( order )
     {
+    case PAGE_ORDER_1G:
+        for ( i = 0; i < (1UL << PAGE_ORDER_1G); i += 1UL << PAGE_ORDER_2M )
+            page_list_add_tail(page + i, &p2m->pod.super);
+        break;
     case PAGE_ORDER_2M:
-        page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */
-        p2m->pod.count += 1 << order;
+        page_list_add_tail(page, &p2m->pod.super);
         break;
     case PAGE_ORDER_4K:
-        page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */
-        p2m->pod.count += 1;
+        page_list_add_tail(page, &p2m->pod.single);
         break;
     default:
         BUG();
     }
+    p2m->pod.count += 1L << order;
 
     return 0;
 }
@@ -502,11 +505,10 @@ p2m_pod_decrease_reservation(struct domain *d,
                              unsigned int order)
 {
     int ret=0;
-    int i;
+    unsigned long i, n;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    int steal_for_cache;
-    int pod, nonpod, ram;
+    bool_t steal_for_cache;
+    long pod, nonpod, ram;
 
     gfn_lock(p2m, gpfn, order);
     pod_lock(p2m);    
@@ -525,21 +527,21 @@ recount:
     /* Figure out if we need to steal some freed memory for our cache */
     steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-    /* FIXME: Add contiguous; query for PSE entries? */
-    for ( i=0; i<(1<<order); i++)
+    for ( i = 0; i < (1UL << order); i += n )
     {
         p2m_access_t a;
         p2m_type_t t;
+        unsigned int cur_order;
 
-        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
-
+        p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
+        n = 1UL << min(order, cur_order);
         if ( t == p2m_populate_on_demand )
-            pod++;
+            pod += n;
         else
         {
-            nonpod++;
+            nonpod += n;
             if ( p2m_is_ram(t) )
-                ram++;
+                ram += n;
         }
     }
 
@@ -574,41 +576,53 @@ recount:
      * + There are PoD entries to handle, or
      * + There is ram left, and we want to steal it
      */
-    for ( i=0;
-          i<(1<<order) && (pod>0 || (steal_for_cache && ram > 0));
-          i++)
+    for ( i = 0;
+          i < (1UL << order) && (pod > 0 || (steal_for_cache && ram > 0));
+          i += n )
     {
         mfn_t mfn;
         p2m_type_t t;
         p2m_access_t a;
+        unsigned int cur_order;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
+        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
+        if ( order < cur_order )
+            cur_order = order;
+        n = 1UL << cur_order;
         if ( t == p2m_populate_on_demand )
         {
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
-                          p2m->default_access);
-            p2m->pod.entry_count--;
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
+                          p2m_invalid, p2m->default_access);
+            p2m->pod.entry_count -= n;
             BUG_ON(p2m->pod.entry_count < 0);
-            pod--;
+            pod -= n;
         }
         else if ( steal_for_cache && p2m_is_ram(t) )
         {
+            /*
+             * If we need less than 1 << cur_order, we may end up stealing
+             * more memory here than we actually need. This will be rectified
+             * below, however; and stealing too much and then freeing what we
+             * need may allow us to free smaller pages from the cache, and
+             * avoid breaking up superpages.
+             */
             struct page_info *page;
+            unsigned int j;
 
             ASSERT(mfn_valid(mfn));
 
             page = mfn_to_page(mfn);
 
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
-                          p2m->default_access);
-            set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
-
-            p2m_pod_cache_add(p2m, page, 0);
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
+                          p2m_invalid, p2m->default_access);
+            for ( j = 0; j < n; ++j )
+                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+            p2m_pod_cache_add(p2m, page, cur_order);
 
             steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-            nonpod--;
-            ram--;
+            nonpod -= n;
+            ram -= n;
         }
     }    
 
@@ -649,7 +663,8 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     p2m_type_t type, type0 = 0;
     unsigned long * map = NULL;
     int ret=0, reset = 0;
-    int i, j;
+    unsigned long i, n;
+    unsigned int j;
     int max_ref = 1;
     struct domain *d = p2m->domain;
 
@@ -668,16 +683,14 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
 
     /* Look up the mfns, checking to make sure they're the same mfn
      * and aligned, and mapping them. */
-    for ( i=0; i<SUPERPAGE_PAGES; i++ )
+    for ( i = 0; i < SUPERPAGE_PAGES; i += n )
     {
         p2m_access_t a; 
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL, NULL);
+        unsigned int cur_order;
+        unsigned long k;
+        const struct page_info *page;
 
-        if ( i == 0 )
-        {
-            mfn0 = mfn;
-            type0 = type;
-        }
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, &cur_order, NULL);
 
         /* Conditions that must be met for superpage-superpage:
          * + All gfns are ram types
@@ -690,15 +703,25 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
          * + None of the mfns are likely to be mapped elsewhere (refcount
          *   2 or less for shadow, 1 for hap)
          */
-        if ( !p2m_is_ram(type)
-             || type != type0
-             || ( (mfn_to_page(mfn)->count_info & PGC_allocated) == 0 )
-             || ( (mfn_to_page(mfn)->count_info & (PGC_page_table|PGC_xen_heap)) != 0 )
-             || ( (mfn_to_page(mfn)->count_info & PGC_xen_heap  ) != 0 )
-             || ( (mfn_to_page(mfn)->count_info & PGC_count_mask) > max_ref )
-             || !( ( i == 0 && superpage_aligned(mfn_x(mfn0)) )
-                   || ( i != 0 && mfn_x(mfn) == (mfn_x(mfn0) + i) ) ) )
+        if ( !p2m_is_ram(type) )
+            goto out;
+
+        if ( i == 0 )
+        {
+            if ( !superpage_aligned(mfn_x(mfn)) )
+                goto out;
+            mfn0 = mfn;
+            type0 = type;
+        }
+        else if ( type != type0 || mfn_x(mfn) != (mfn_x(mfn0) + i) )
             goto out;
+
+        n = 1UL << min(cur_order, SUPERPAGE_ORDER + 0U);
+        for ( k = 0, page = mfn_to_page(mfn); k < n; ++k, ++page )
+            if ( !(page->count_info & PGC_allocated) ||
+                 (page->count_info & (PGC_page_table | PGC_xen_heap)) ||
+                 (page->count_info & PGC_count_mask) > max_ref )
+                goto out;
     }
 
     /* Now, do a quick check to see if it may be zero before unmapping. */
@@ -1114,7 +1137,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                       unsigned int order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    unsigned long i, pod_count = 0;
+    unsigned long i, n, pod_count = 0;
     p2m_type_t ot;
     mfn_t omfn;
     int rc = 0;
@@ -1127,10 +1150,13 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     P2M_DEBUG("mark pod gfn=%#lx\n", gfn);
 
     /* Make sure all gpfns are unused */
-    for ( i = 0; i < (1UL << order); i++ )
+    for ( i = 0; i < (1UL << order); i += n )
     {
         p2m_access_t a;
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
+        unsigned int cur_order;
+
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, &cur_order, NULL);
+        n = 1UL << min(order, cur_order);
         if ( p2m_is_ram(ot) )
         {
             P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
@@ -1140,7 +1166,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
         else if ( ot == p2m_populate_on_demand )
         {
             /* Count how man PoD entries we'll be replacing if successful */
-            pod_count++;
+            pod_count += n;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:24:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjAQx-00007M-RS; Mon, 05 Oct 2015 18:24:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQw-00007A-1y
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:22 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	01/61-19110-550C2165; Mon, 05 Oct 2015 18:24:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1444069459!19077858!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16259 invoked from network); 5 Oct 2015 18:24:20 -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;
	5 Oct 2015 18:24:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQt-0004xK-AS
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAQt-0004Af-7a
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:19 +0000
Date: Mon, 05 Oct 2015 18:24:19 +0000
Message-Id: <E1ZjAQt-0004Af-7a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: shorten certain operations on
	higher order 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 3c352011c0d39ed23656986f5786498a14f9a96e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:42:01 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:42:01 2015 +0200

    x86/PoD: shorten certain operations on higher order ranges
    
    Now that p2m->get_entry() always returns a valid order, utilize this
    to accelerate some of the operations in PoD code. (There are two uses
    of p2m->get_entry() left which don't easily lend themselves to this
    optimization.)
    
    Also adjust a few types as needed and remove stale comments from
    p2m_pod_cache_add() (to avoid duplicating them yet another time).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |  130 +++++++++++++++++++++++++++------------------
 1 files changed, 78 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 026d455..901da37 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -119,20 +119,23 @@ p2m_pod_cache_add(struct p2m_domain *p2m,
 
     unlock_page_alloc(p2m);
 
-    /* Then add the first one to the appropriate populate-on-demand list */
-    switch(order)
+    /* Then add to the appropriate populate-on-demand list. */
+    switch ( order )
     {
+    case PAGE_ORDER_1G:
+        for ( i = 0; i < (1UL << PAGE_ORDER_1G); i += 1UL << PAGE_ORDER_2M )
+            page_list_add_tail(page + i, &p2m->pod.super);
+        break;
     case PAGE_ORDER_2M:
-        page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */
-        p2m->pod.count += 1 << order;
+        page_list_add_tail(page, &p2m->pod.super);
         break;
     case PAGE_ORDER_4K:
-        page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */
-        p2m->pod.count += 1;
+        page_list_add_tail(page, &p2m->pod.single);
         break;
     default:
         BUG();
     }
+    p2m->pod.count += 1L << order;
 
     return 0;
 }
@@ -502,11 +505,10 @@ p2m_pod_decrease_reservation(struct domain *d,
                              unsigned int order)
 {
     int ret=0;
-    int i;
+    unsigned long i, n;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    int steal_for_cache;
-    int pod, nonpod, ram;
+    bool_t steal_for_cache;
+    long pod, nonpod, ram;
 
     gfn_lock(p2m, gpfn, order);
     pod_lock(p2m);    
@@ -525,21 +527,21 @@ recount:
     /* Figure out if we need to steal some freed memory for our cache */
     steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-    /* FIXME: Add contiguous; query for PSE entries? */
-    for ( i=0; i<(1<<order); i++)
+    for ( i = 0; i < (1UL << order); i += n )
     {
         p2m_access_t a;
         p2m_type_t t;
+        unsigned int cur_order;
 
-        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
-
+        p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
+        n = 1UL << min(order, cur_order);
         if ( t == p2m_populate_on_demand )
-            pod++;
+            pod += n;
         else
         {
-            nonpod++;
+            nonpod += n;
             if ( p2m_is_ram(t) )
-                ram++;
+                ram += n;
         }
     }
 
@@ -574,41 +576,53 @@ recount:
      * + There are PoD entries to handle, or
      * + There is ram left, and we want to steal it
      */
-    for ( i=0;
-          i<(1<<order) && (pod>0 || (steal_for_cache && ram > 0));
-          i++)
+    for ( i = 0;
+          i < (1UL << order) && (pod > 0 || (steal_for_cache && ram > 0));
+          i += n )
     {
         mfn_t mfn;
         p2m_type_t t;
         p2m_access_t a;
+        unsigned int cur_order;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL, NULL);
+        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, &cur_order, NULL);
+        if ( order < cur_order )
+            cur_order = order;
+        n = 1UL << cur_order;
         if ( t == p2m_populate_on_demand )
         {
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
-                          p2m->default_access);
-            p2m->pod.entry_count--;
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
+                          p2m_invalid, p2m->default_access);
+            p2m->pod.entry_count -= n;
             BUG_ON(p2m->pod.entry_count < 0);
-            pod--;
+            pod -= n;
         }
         else if ( steal_for_cache && p2m_is_ram(t) )
         {
+            /*
+             * If we need less than 1 << cur_order, we may end up stealing
+             * more memory here than we actually need. This will be rectified
+             * below, however; and stealing too much and then freeing what we
+             * need may allow us to free smaller pages from the cache, and
+             * avoid breaking up superpages.
+             */
             struct page_info *page;
+            unsigned int j;
 
             ASSERT(mfn_valid(mfn));
 
             page = mfn_to_page(mfn);
 
-            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid,
-                          p2m->default_access);
-            set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
-
-            p2m_pod_cache_add(p2m, page, 0);
+            p2m_set_entry(p2m, gpfn + i, _mfn(INVALID_MFN), cur_order,
+                          p2m_invalid, p2m->default_access);
+            for ( j = 0; j < n; ++j )
+                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+            p2m_pod_cache_add(p2m, page, cur_order);
 
             steal_for_cache =  ( p2m->pod.entry_count > p2m->pod.count );
 
-            nonpod--;
-            ram--;
+            nonpod -= n;
+            ram -= n;
         }
     }    
 
@@ -649,7 +663,8 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     p2m_type_t type, type0 = 0;
     unsigned long * map = NULL;
     int ret=0, reset = 0;
-    int i, j;
+    unsigned long i, n;
+    unsigned int j;
     int max_ref = 1;
     struct domain *d = p2m->domain;
 
@@ -668,16 +683,14 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
 
     /* Look up the mfns, checking to make sure they're the same mfn
      * and aligned, and mapping them. */
-    for ( i=0; i<SUPERPAGE_PAGES; i++ )
+    for ( i = 0; i < SUPERPAGE_PAGES; i += n )
     {
         p2m_access_t a; 
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL, NULL);
+        unsigned int cur_order;
+        unsigned long k;
+        const struct page_info *page;
 
-        if ( i == 0 )
-        {
-            mfn0 = mfn;
-            type0 = type;
-        }
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, &cur_order, NULL);
 
         /* Conditions that must be met for superpage-superpage:
          * + All gfns are ram types
@@ -690,15 +703,25 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
          * + None of the mfns are likely to be mapped elsewhere (refcount
          *   2 or less for shadow, 1 for hap)
          */
-        if ( !p2m_is_ram(type)
-             || type != type0
-             || ( (mfn_to_page(mfn)->count_info & PGC_allocated) == 0 )
-             || ( (mfn_to_page(mfn)->count_info & (PGC_page_table|PGC_xen_heap)) != 0 )
-             || ( (mfn_to_page(mfn)->count_info & PGC_xen_heap  ) != 0 )
-             || ( (mfn_to_page(mfn)->count_info & PGC_count_mask) > max_ref )
-             || !( ( i == 0 && superpage_aligned(mfn_x(mfn0)) )
-                   || ( i != 0 && mfn_x(mfn) == (mfn_x(mfn0) + i) ) ) )
+        if ( !p2m_is_ram(type) )
+            goto out;
+
+        if ( i == 0 )
+        {
+            if ( !superpage_aligned(mfn_x(mfn)) )
+                goto out;
+            mfn0 = mfn;
+            type0 = type;
+        }
+        else if ( type != type0 || mfn_x(mfn) != (mfn_x(mfn0) + i) )
             goto out;
+
+        n = 1UL << min(cur_order, SUPERPAGE_ORDER + 0U);
+        for ( k = 0, page = mfn_to_page(mfn); k < n; ++k, ++page )
+            if ( !(page->count_info & PGC_allocated) ||
+                 (page->count_info & (PGC_page_table | PGC_xen_heap)) ||
+                 (page->count_info & PGC_count_mask) > max_ref )
+                goto out;
     }
 
     /* Now, do a quick check to see if it may be zero before unmapping. */
@@ -1114,7 +1137,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                       unsigned int order)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    unsigned long i, pod_count = 0;
+    unsigned long i, n, pod_count = 0;
     p2m_type_t ot;
     mfn_t omfn;
     int rc = 0;
@@ -1127,10 +1150,13 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     P2M_DEBUG("mark pod gfn=%#lx\n", gfn);
 
     /* Make sure all gpfns are unused */
-    for ( i = 0; i < (1UL << order); i++ )
+    for ( i = 0; i < (1UL << order); i += n )
     {
         p2m_access_t a;
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
+        unsigned int cur_order;
+
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, &cur_order, NULL);
+        n = 1UL << min(order, cur_order);
         if ( p2m_is_ram(ot) )
         {
             P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
@@ -1140,7 +1166,7 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
         else if ( ot == p2m_populate_on_demand )
         {
             /* Count how man PoD entries we'll be replacing if successful */
-            pod_count++;
+            pod_count += n;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 05 18:24:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjAR6-00008i-U0; Mon, 05 Oct 2015 18:24: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 1ZjAR5-00008Y-Qt
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:31 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	CF/2A-10422-F50C2165; Mon, 05 Oct 2015 18:24:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1444069469!40033624!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14607 invoked from network); 5 Oct 2015 18:24:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:24:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAR3-0004xS-IU
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAR3-0004Bi-Fi
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:29 +0000
Date: Mon, 05 Oct 2015 18:24:29 +0000
Message-Id: <E1ZjAR3-0004Bi-Fi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for RTDS bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bddb98662e78ea32ec12dea52611f79466c6065a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 13:43:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:43:35 2015 +0200

    use masking operation instead of test_bit for RTDS bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/sched_rt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 4b5c5e4..6a341b1 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -931,7 +931,7 @@ rt_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
         cpu_raise_softirq(vc->processor, SCHEDULE_SOFTIRQ);
     else if ( __vcpu_on_q(svc) )
         __q_remove(svc);
-    else if ( test_bit(__RTDS_delayed_runq_add, &svc->flags) )
+    else if ( svc->flags & RTDS_delayed_runq_add )
         clear_bit(__RTDS_delayed_runq_add, &svc->flags);
 }
 
@@ -1064,7 +1064,7 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
      * the Runqueue/DepletedQ. Instead, we set a flag so that it will be
      * put on the Runqueue/DepletedQ after the context has been saved.
      */
-    if ( unlikely(test_bit(__RTDS_scheduled, &svc->flags)) )
+    if ( unlikely(svc->flags & RTDS_scheduled) )
     {
         set_bit(__RTDS_delayed_runq_add, &svc->flags);
         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 Mon Oct 05 18:24:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjAR6-00008i-U0; Mon, 05 Oct 2015 18:24: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 1ZjAR5-00008Y-Qt
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:31 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	CF/2A-10422-F50C2165; Mon, 05 Oct 2015 18:24:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1444069469!40033624!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14607 invoked from network); 5 Oct 2015 18:24:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:24:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAR3-0004xS-IU
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjAR3-0004Bi-Fi
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:29 +0000
Date: Mon, 05 Oct 2015 18:24:29 +0000
Message-Id: <E1ZjAR3-0004Bi-Fi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for RTDS bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bddb98662e78ea32ec12dea52611f79466c6065a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 13:43:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:43:35 2015 +0200

    use masking operation instead of test_bit for RTDS bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/sched_rt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 4b5c5e4..6a341b1 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -931,7 +931,7 @@ rt_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
         cpu_raise_softirq(vc->processor, SCHEDULE_SOFTIRQ);
     else if ( __vcpu_on_q(svc) )
         __q_remove(svc);
-    else if ( test_bit(__RTDS_delayed_runq_add, &svc->flags) )
+    else if ( svc->flags & RTDS_delayed_runq_add )
         clear_bit(__RTDS_delayed_runq_add, &svc->flags);
 }
 
@@ -1064,7 +1064,7 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
      * the Runqueue/DepletedQ. Instead, we set a flag so that it will be
      * put on the Runqueue/DepletedQ after the context has been saved.
      */
-    if ( unlikely(test_bit(__RTDS_scheduled, &svc->flags)) )
+    if ( unlikely(svc->flags & RTDS_scheduled) )
     {
         set_bit(__RTDS_delayed_runq_add, &svc->flags);
         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 Mon Oct 05 18:24:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjARH-0000AK-0e; Mon, 05 Oct 2015 18:24:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARG-0000AC-LE
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:42 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	BA/60-28221-A60C2165; Mon, 05 Oct 2015 18:24:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1444069480!55848250!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20496 invoked from network); 5 Oct 2015 18:24:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:24:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARD-0004xa-Tb
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARD-0004C7-QG
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:39 +0000
Date: Mon, 05 Oct 2015 18:24:39 +0000
Message-Id: <E1ZjARD-0004C7-QG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for VGCF bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 613623b6fd1f09c2a8ee16739f823d826e3c0c77
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 13:44:04 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:44:04 2015 +0200

    use masking operation instead of test_bit for VGCF bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index dc3bb08..4e96f6c 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1352,7 +1352,7 @@ static void load_segments(struct vcpu *n)
                 domain_crash(n->domain);
             }
 
-            if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) )
+            if ( n->arch.vgc_flags & VGCF_failsafe_disables_events )
                 vcpu_info(n, evtchn_upcall_mask) = 1;
 
             regs->entry_vector |= TRAP_syscall;
@@ -1394,7 +1394,7 @@ static void load_segments(struct vcpu *n)
             domain_crash(n->domain);
         }
 
-        if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) )
+        if ( n->arch.vgc_flags & VGCF_failsafe_disables_events )
             vcpu_info(n, evtchn_upcall_mask) = 1;
 
         regs->entry_vector |= TRAP_syscall;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:24:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjARH-0000AK-0e; Mon, 05 Oct 2015 18:24:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARG-0000AC-LE
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:42 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	BA/60-28221-A60C2165; Mon, 05 Oct 2015 18:24:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1444069480!55848250!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20496 invoked from network); 5 Oct 2015 18:24:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:24:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARD-0004xa-Tb
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARD-0004C7-QG
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:39 +0000
Date: Mon, 05 Oct 2015 18:24:39 +0000
Message-Id: <E1ZjARD-0004C7-QG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for VGCF bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 613623b6fd1f09c2a8ee16739f823d826e3c0c77
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 13:44:04 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:44:04 2015 +0200

    use masking operation instead of test_bit for VGCF bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index dc3bb08..4e96f6c 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1352,7 +1352,7 @@ static void load_segments(struct vcpu *n)
                 domain_crash(n->domain);
             }
 
-            if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) )
+            if ( n->arch.vgc_flags & VGCF_failsafe_disables_events )
                 vcpu_info(n, evtchn_upcall_mask) = 1;
 
             regs->entry_vector |= TRAP_syscall;
@@ -1394,7 +1394,7 @@ static void load_segments(struct vcpu *n)
             domain_crash(n->domain);
         }
 
-        if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) )
+        if ( n->arch.vgc_flags & VGCF_failsafe_disables_events )
             vcpu_info(n, evtchn_upcall_mask) = 1;
 
         regs->entry_vector |= TRAP_syscall;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:24:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjARS-0000CI-3O; Mon, 05 Oct 2015 18:24:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARQ-0000C0-Vt
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:53 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	F8/56-19220-470C2165; Mon, 05 Oct 2015 18:24:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1444069490!7927920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12142 invoked from network); 5 Oct 2015 18:24:51 -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;
	5 Oct 2015 18:24:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARO-0004xl-8q
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARO-0004CZ-60
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:50 +0000
Date: Mon, 05 Oct 2015 18:24:50 +0000
Message-Id: <E1ZjARO-0004CZ-60@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for VPF bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ad97f333cf8c5045e939baf30960b52e19fcaa9
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 13:44:31 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:44:31 2015 +0200

    use masking operation instead of test_bit for VPF bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domctl.c  |    2 +-
 xen/arch/x86/hvm/hvm.c |    4 ++--
 xen/arch/x86/hvm/vpt.c |    2 +-
 xen/common/domain.c    |    4 ++--
 xen/common/domctl.c    |    8 ++++----
 xen/common/schedule.c  |   16 ++++++++--------
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 6172c0d..f8a559c 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1213,7 +1213,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
     c(flags = v->arch.vgc_flags & ~(VGCF_i387_valid|VGCF_in_kernel));
     if ( v->fpu_initialised )
         c(flags |= VGCF_i387_valid);
-    if ( !test_bit(_VPF_down, &v->pause_flags) )
+    if ( !(v->pause_flags & VPF_down) )
         c(flags |= VGCF_online);
     if ( !compat )
     {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6afc344..3fa2280 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1728,7 +1728,7 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     {
         /* We don't need to save state for a vcpu that is down; the restore 
          * code will leave it down if there is nothing saved. */
-        if ( test_bit(_VPF_down, &v->pause_flags) ) 
+        if ( v->pause_flags & VPF_down )
             continue;
 
         /* Architecture-specific vmcs/vmcb bits */
@@ -2512,7 +2512,7 @@ void hvm_vcpu_down(struct vcpu *v)
     /* Any other VCPUs online? ... */
     domain_lock(d);
     for_each_vcpu ( d, v )
-        if ( !test_bit(_VPF_down, &v->pause_flags) )
+        if ( !(v->pause_flags & VPF_down) )
             online_count++;
     domain_unlock(d);
 
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 0c8b22e..4fa6566 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -178,7 +178,7 @@ void pt_save_timer(struct vcpu *v)
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
     struct periodic_time *pt;
 
-    if ( test_bit(_VPF_blocked, &v->pause_flags) )
+    if ( v->pause_flags & VPF_blocked )
         return;
 
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index cda60a9..7c362eb 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1135,7 +1135,7 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
-    if ( (v != current) && !test_bit(_VPF_down, &v->pause_flags) )
+    if ( (v != current) && !(v->pause_flags & VPF_down) )
         return -EINVAL;
 
     page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
@@ -1263,7 +1263,7 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case VCPUOP_is_up:
-        rc = !test_bit(_VPF_down, &v->pause_flags);
+        rc = !(v->pause_flags & VPF_down);
         break;
 
     case VCPUOP_get_runstate_info:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 08de32d..46b967e 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -170,7 +170,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
         vcpu_runstate_get(v, &runstate);
         cpu_time += runstate.time[RUNSTATE_running];
         info->max_vcpu_id = v->vcpu_id;
-        if ( !test_bit(_VPF_down, &v->pause_flags) )
+        if ( !(v->pause_flags & VPF_down) )
         {
             if ( !(v->pause_flags & VPF_blocked) )
                 flags &= ~XEN_DOMINF_blocked;
@@ -231,7 +231,7 @@ static unsigned int default_vcpu0_location(cpumask_t *online)
         rcu_read_lock(&domlist_read_lock);
         for_each_domain ( d )
             for_each_vcpu ( d, v )
-                if ( !test_bit(_VPF_down, &v->pause_flags)
+                if ( !(v->pause_flags & VPF_down)
                      && ((cpu = v->processor) < nr_cpus) )
                     cnt[cpu]++;
         rcu_read_unlock(&domlist_read_lock);
@@ -944,8 +944,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         vcpu_runstate_get(v, &runstate);
 
-        op->u.getvcpuinfo.online   = !test_bit(_VPF_down, &v->pause_flags);
-        op->u.getvcpuinfo.blocked  = test_bit(_VPF_blocked, &v->pause_flags);
+        op->u.getvcpuinfo.online   = !(v->pause_flags & VPF_down);
+        op->u.getvcpuinfo.blocked  = !!(v->pause_flags & VPF_blocked);
         op->u.getvcpuinfo.running  = v->is_running;
         op->u.getvcpuinfo.cpu_time = runstate.time[RUNSTATE_running];
         op->u.getvcpuinfo.cpu      = v->processor;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 5ffa1a1..c5f640f 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -119,7 +119,7 @@ static inline void vcpu_urgent_count_update(struct vcpu *v)
 
     if ( unlikely(v->is_urgent) )
     {
-        if ( !test_bit(_VPF_blocked, &v->pause_flags) ||
+        if ( !(v->pause_flags & VPF_blocked) ||
              !test_bit(v->vcpu_id, v->domain->poll_mask) )
         {
             v->is_urgent = 0;
@@ -128,8 +128,8 @@ static inline void vcpu_urgent_count_update(struct vcpu *v)
     }
     else
     {
-        if ( unlikely(test_bit(_VPF_blocked, &v->pause_flags) &&
-                      test_bit(v->vcpu_id, v->domain->poll_mask)) )
+        if ( unlikely(v->pause_flags & VPF_blocked) &&
+             unlikely(test_bit(v->vcpu_id, v->domain->poll_mask)) )
         {
             v->is_urgent = 1;
             atomic_inc(&per_cpu(schedule_data,v->processor).urgent_count);
@@ -418,7 +418,7 @@ void vcpu_wake(struct vcpu *v)
             vcpu_runstate_change(v, RUNSTATE_runnable, NOW());
         SCHED_OP(VCPU2OP(v), wake, v);
     }
-    else if ( !test_bit(_VPF_blocked, &v->pause_flags) )
+    else if ( !(v->pause_flags & VPF_blocked) )
     {
         if ( v->runstate.state == RUNSTATE_blocked )
             vcpu_runstate_change(v, RUNSTATE_offline, NOW());
@@ -595,7 +595,7 @@ void vcpu_force_reschedule(struct vcpu *v)
         set_bit(_VPF_migrating, &v->pause_flags);
     vcpu_schedule_unlock_irq(lock, v);
 
-    if ( test_bit(_VPF_migrating, &v->pause_flags) )
+    if ( v->pause_flags & VPF_migrating )
     {
         vcpu_sleep_nosync(v);
         vcpu_migrate(v);
@@ -763,7 +763,7 @@ static int vcpu_set_affinity(
 
     domain_update_node_affinity(v->domain);
 
-    if ( test_bit(_VPF_migrating, &v->pause_flags) )
+    if ( v->pause_flags & VPF_migrating )
     {
         vcpu_sleep_nosync(v);
         vcpu_migrate(v);
@@ -1285,7 +1285,7 @@ static void schedule(void)
 
     vcpu_runstate_change(
         prev,
-        (test_bit(_VPF_blocked, &prev->pause_flags) ? RUNSTATE_blocked :
+        ((prev->pause_flags & VPF_blocked) ? RUNSTATE_blocked :
          (vcpu_runnable(prev) ? RUNSTATE_runnable : RUNSTATE_offline)),
         now);
     prev->last_run_time = now;
@@ -1327,7 +1327,7 @@ void context_saved(struct vcpu *prev)
 
     SCHED_OP(VCPU2OP(prev), context_saved, prev);
 
-    if ( unlikely(test_bit(_VPF_migrating, &prev->pause_flags)) )
+    if ( unlikely(prev->pause_flags & VPF_migrating) )
         vcpu_migrate(prev);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:24:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:24: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 1ZjARS-0000CI-3O; Mon, 05 Oct 2015 18:24:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARQ-0000C0-Vt
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:53 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	F8/56-19220-470C2165; Mon, 05 Oct 2015 18:24:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1444069490!7927920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12142 invoked from network); 5 Oct 2015 18:24:51 -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;
	5 Oct 2015 18:24:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARO-0004xl-8q
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARO-0004CZ-60
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:24:50 +0000
Date: Mon, 05 Oct 2015 18:24:50 +0000
Message-Id: <E1ZjARO-0004CZ-60@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for VPF bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ad97f333cf8c5045e939baf30960b52e19fcaa9
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 13:44:31 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:44:31 2015 +0200

    use masking operation instead of test_bit for VPF bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domctl.c  |    2 +-
 xen/arch/x86/hvm/hvm.c |    4 ++--
 xen/arch/x86/hvm/vpt.c |    2 +-
 xen/common/domain.c    |    4 ++--
 xen/common/domctl.c    |    8 ++++----
 xen/common/schedule.c  |   16 ++++++++--------
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 6172c0d..f8a559c 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1213,7 +1213,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
     c(flags = v->arch.vgc_flags & ~(VGCF_i387_valid|VGCF_in_kernel));
     if ( v->fpu_initialised )
         c(flags |= VGCF_i387_valid);
-    if ( !test_bit(_VPF_down, &v->pause_flags) )
+    if ( !(v->pause_flags & VPF_down) )
         c(flags |= VGCF_online);
     if ( !compat )
     {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6afc344..3fa2280 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1728,7 +1728,7 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     {
         /* We don't need to save state for a vcpu that is down; the restore 
          * code will leave it down if there is nothing saved. */
-        if ( test_bit(_VPF_down, &v->pause_flags) ) 
+        if ( v->pause_flags & VPF_down )
             continue;
 
         /* Architecture-specific vmcs/vmcb bits */
@@ -2512,7 +2512,7 @@ void hvm_vcpu_down(struct vcpu *v)
     /* Any other VCPUs online? ... */
     domain_lock(d);
     for_each_vcpu ( d, v )
-        if ( !test_bit(_VPF_down, &v->pause_flags) )
+        if ( !(v->pause_flags & VPF_down) )
             online_count++;
     domain_unlock(d);
 
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 0c8b22e..4fa6566 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -178,7 +178,7 @@ void pt_save_timer(struct vcpu *v)
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
     struct periodic_time *pt;
 
-    if ( test_bit(_VPF_blocked, &v->pause_flags) )
+    if ( v->pause_flags & VPF_blocked )
         return;
 
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index cda60a9..7c362eb 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1135,7 +1135,7 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
-    if ( (v != current) && !test_bit(_VPF_down, &v->pause_flags) )
+    if ( (v != current) && !(v->pause_flags & VPF_down) )
         return -EINVAL;
 
     page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
@@ -1263,7 +1263,7 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case VCPUOP_is_up:
-        rc = !test_bit(_VPF_down, &v->pause_flags);
+        rc = !(v->pause_flags & VPF_down);
         break;
 
     case VCPUOP_get_runstate_info:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 08de32d..46b967e 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -170,7 +170,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
         vcpu_runstate_get(v, &runstate);
         cpu_time += runstate.time[RUNSTATE_running];
         info->max_vcpu_id = v->vcpu_id;
-        if ( !test_bit(_VPF_down, &v->pause_flags) )
+        if ( !(v->pause_flags & VPF_down) )
         {
             if ( !(v->pause_flags & VPF_blocked) )
                 flags &= ~XEN_DOMINF_blocked;
@@ -231,7 +231,7 @@ static unsigned int default_vcpu0_location(cpumask_t *online)
         rcu_read_lock(&domlist_read_lock);
         for_each_domain ( d )
             for_each_vcpu ( d, v )
-                if ( !test_bit(_VPF_down, &v->pause_flags)
+                if ( !(v->pause_flags & VPF_down)
                      && ((cpu = v->processor) < nr_cpus) )
                     cnt[cpu]++;
         rcu_read_unlock(&domlist_read_lock);
@@ -944,8 +944,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
         vcpu_runstate_get(v, &runstate);
 
-        op->u.getvcpuinfo.online   = !test_bit(_VPF_down, &v->pause_flags);
-        op->u.getvcpuinfo.blocked  = test_bit(_VPF_blocked, &v->pause_flags);
+        op->u.getvcpuinfo.online   = !(v->pause_flags & VPF_down);
+        op->u.getvcpuinfo.blocked  = !!(v->pause_flags & VPF_blocked);
         op->u.getvcpuinfo.running  = v->is_running;
         op->u.getvcpuinfo.cpu_time = runstate.time[RUNSTATE_running];
         op->u.getvcpuinfo.cpu      = v->processor;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 5ffa1a1..c5f640f 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -119,7 +119,7 @@ static inline void vcpu_urgent_count_update(struct vcpu *v)
 
     if ( unlikely(v->is_urgent) )
     {
-        if ( !test_bit(_VPF_blocked, &v->pause_flags) ||
+        if ( !(v->pause_flags & VPF_blocked) ||
              !test_bit(v->vcpu_id, v->domain->poll_mask) )
         {
             v->is_urgent = 0;
@@ -128,8 +128,8 @@ static inline void vcpu_urgent_count_update(struct vcpu *v)
     }
     else
     {
-        if ( unlikely(test_bit(_VPF_blocked, &v->pause_flags) &&
-                      test_bit(v->vcpu_id, v->domain->poll_mask)) )
+        if ( unlikely(v->pause_flags & VPF_blocked) &&
+             unlikely(test_bit(v->vcpu_id, v->domain->poll_mask)) )
         {
             v->is_urgent = 1;
             atomic_inc(&per_cpu(schedule_data,v->processor).urgent_count);
@@ -418,7 +418,7 @@ void vcpu_wake(struct vcpu *v)
             vcpu_runstate_change(v, RUNSTATE_runnable, NOW());
         SCHED_OP(VCPU2OP(v), wake, v);
     }
-    else if ( !test_bit(_VPF_blocked, &v->pause_flags) )
+    else if ( !(v->pause_flags & VPF_blocked) )
     {
         if ( v->runstate.state == RUNSTATE_blocked )
             vcpu_runstate_change(v, RUNSTATE_offline, NOW());
@@ -595,7 +595,7 @@ void vcpu_force_reschedule(struct vcpu *v)
         set_bit(_VPF_migrating, &v->pause_flags);
     vcpu_schedule_unlock_irq(lock, v);
 
-    if ( test_bit(_VPF_migrating, &v->pause_flags) )
+    if ( v->pause_flags & VPF_migrating )
     {
         vcpu_sleep_nosync(v);
         vcpu_migrate(v);
@@ -763,7 +763,7 @@ static int vcpu_set_affinity(
 
     domain_update_node_affinity(v->domain);
 
-    if ( test_bit(_VPF_migrating, &v->pause_flags) )
+    if ( v->pause_flags & VPF_migrating )
     {
         vcpu_sleep_nosync(v);
         vcpu_migrate(v);
@@ -1285,7 +1285,7 @@ static void schedule(void)
 
     vcpu_runstate_change(
         prev,
-        (test_bit(_VPF_blocked, &prev->pause_flags) ? RUNSTATE_blocked :
+        ((prev->pause_flags & VPF_blocked) ? RUNSTATE_blocked :
          (vcpu_runnable(prev) ? RUNSTATE_runnable : RUNSTATE_offline)),
         now);
     prev->last_run_time = now;
@@ -1327,7 +1327,7 @@ void context_saved(struct vcpu *prev)
 
     SCHED_OP(VCPU2OP(prev), context_saved, prev);
 
-    if ( unlikely(test_bit(_VPF_migrating, &prev->pause_flags)) )
+    if ( unlikely(prev->pause_flags & VPF_migrating) )
         vcpu_migrate(prev);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:25:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:25: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 1ZjARc-0000EO-8E; Mon, 05 Oct 2015 18:25:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARa-0000E9-TG
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:25:03 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	43/9D-06179-E70C2165; Mon, 05 Oct 2015 18:25:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1444069500!16576361!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21636 invoked from network); 5 Oct 2015 18:25:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:25:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARY-0004xw-IJ
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:25:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARY-0004D2-GT
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:25:00 +0000
Date: Mon, 05 Oct 2015 18:25:00 +0000
Message-Id: <E1ZjARY-0004D2-GT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for MCSF bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 90f2e2a307fc6a6258c39cc87b3b2bf9441c0fa7
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 13:44:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:44:59 2015 +0200

    use masking operation instead of test_bit for MCSF bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c           |    8 ++++----
 xen/arch/x86/x86_64/compat/mm.c |    4 ++--
 xen/common/multicall.c          |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4e96f6c..7ca9b93 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1750,7 +1750,7 @@ void hypercall_cancel_continuation(void)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     struct mc_state *mcs = &current->mc_state;
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
         __clear_bit(_MCSF_call_preempted, &mcs->flags);
     }
@@ -1774,7 +1774,7 @@ unsigned long hypercall_create_continuation(
 
     va_start(args, format);
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
         __set_bit(_MCSF_call_preempted, &mcs->flags);
 
@@ -1852,9 +1852,9 @@ int hypercall_xlat_continuation(unsigned int *id, unsigned int nr,
 
     va_start(args, mask);
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
-        if ( !test_bit(_MCSF_call_preempted, &mcs->flags) )
+        if ( !(mcs->flags & MCSF_call_preempted) )
         {
             va_end(args);
             return 0;
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index d034bd0..178e42d 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -324,7 +324,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
             {
                 struct cpu_user_regs *regs = guest_cpu_user_regs();
                 struct mc_state *mcs = &current->mc_state;
-                unsigned int arg1 = !test_bit(_MCSF_in_multicall, &mcs->flags)
+                unsigned int arg1 = !(mcs->flags & MCSF_in_multicall)
                                     ? regs->ecx
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
@@ -338,7 +338,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                 {
                     BUG_ON(!hypercall_xlat_continuation(&left, 4, 0x01, nat_ops,
                                                         cmp_uops));
-                    if ( !test_bit(_MCSF_in_multicall, &mcs->flags) )
+                    if ( !(mcs->flags & MCSF_in_multicall) )
                         regs->_ecx += count - i;
                     else
                         mcs->compat_call.args[1] += count - i;
diff --git a/xen/common/multicall.c b/xen/common/multicall.c
index fa9d910..21661ee 100644
--- a/xen/common/multicall.c
+++ b/xen/common/multicall.c
@@ -79,7 +79,7 @@ do_multicall(
 
         if ( unlikely(__copy_field_to_guest(call_list, &mcs->call, result)) )
             rc = -EFAULT;
-        else if ( test_bit(_MCSF_call_preempted, &mcs->flags) )
+        else if ( mcs->flags & MCSF_call_preempted )
         {
             /* Translate sub-call continuation to guest layout */
             xlat_multicall_entry(mcs);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 05 18:25:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2015 18:25: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 1ZjARc-0000EO-8E; Mon, 05 Oct 2015 18:25:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARa-0000E9-TG
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:25:03 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	43/9D-06179-E70C2165; Mon, 05 Oct 2015 18:25:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1444069500!16576361!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21636 invoked from network); 5 Oct 2015 18:25:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2015 18:25:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARY-0004xw-IJ
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:25:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjARY-0004D2-GT
	for xen-changelog@lists.xensource.com; Mon, 05 Oct 2015 18:25:00 +0000
Date: Mon, 05 Oct 2015 18:25:00 +0000
Message-Id: <E1ZjARY-0004D2-GT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for MCSF bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 90f2e2a307fc6a6258c39cc87b3b2bf9441c0fa7
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 13:44:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:44:59 2015 +0200

    use masking operation instead of test_bit for MCSF bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c           |    8 ++++----
 xen/arch/x86/x86_64/compat/mm.c |    4 ++--
 xen/common/multicall.c          |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4e96f6c..7ca9b93 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1750,7 +1750,7 @@ void hypercall_cancel_continuation(void)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     struct mc_state *mcs = &current->mc_state;
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
         __clear_bit(_MCSF_call_preempted, &mcs->flags);
     }
@@ -1774,7 +1774,7 @@ unsigned long hypercall_create_continuation(
 
     va_start(args, format);
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
         __set_bit(_MCSF_call_preempted, &mcs->flags);
 
@@ -1852,9 +1852,9 @@ int hypercall_xlat_continuation(unsigned int *id, unsigned int nr,
 
     va_start(args, mask);
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
-        if ( !test_bit(_MCSF_call_preempted, &mcs->flags) )
+        if ( !(mcs->flags & MCSF_call_preempted) )
         {
             va_end(args);
             return 0;
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index d034bd0..178e42d 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -324,7 +324,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
             {
                 struct cpu_user_regs *regs = guest_cpu_user_regs();
                 struct mc_state *mcs = &current->mc_state;
-                unsigned int arg1 = !test_bit(_MCSF_in_multicall, &mcs->flags)
+                unsigned int arg1 = !(mcs->flags & MCSF_in_multicall)
                                     ? regs->ecx
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
@@ -338,7 +338,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                 {
                     BUG_ON(!hypercall_xlat_continuation(&left, 4, 0x01, nat_ops,
                                                         cmp_uops));
-                    if ( !test_bit(_MCSF_in_multicall, &mcs->flags) )
+                    if ( !(mcs->flags & MCSF_in_multicall) )
                         regs->_ecx += count - i;
                     else
                         mcs->compat_call.args[1] += count - i;
diff --git a/xen/common/multicall.c b/xen/common/multicall.c
index fa9d910..21661ee 100644
--- a/xen/common/multicall.c
+++ b/xen/common/multicall.c
@@ -79,7 +79,7 @@ do_multicall(
 
         if ( unlikely(__copy_field_to_guest(call_list, &mcs->call, result)) )
             rc = -EFAULT;
-        else if ( test_bit(_MCSF_call_preempted, &mcs->flags) )
+        else if ( mcs->flags & MCSF_call_preempted )
         {
             /* Translate sub-call continuation to guest layout */
             xlat_multicall_entry(mcs);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 06 15:22:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjU4E-0002kQ-CC; Tue, 06 Oct 2015 15:22: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 1ZjU4D-0002k8-Dq
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:13 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	32/85-25435-127E3165; Tue, 06 Oct 2015 15:22:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1444144927!23867804!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 1932 invoked from network); 6 Oct 2015 15:22:08 -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;
	6 Oct 2015 15:22:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU46-0008Pd-WA
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU45-0002AR-LF
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:06 +0000
Date: Tue, 06 Oct 2015 15:22:05 +0000
Message-Id: <E1ZjU45-0002AR-LF@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
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 27b82b08b17f589f638f3d5be8dcea42b5e73330
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Aug 20 16:19:38 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 20 16:19:38 2015 +0200

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

diff --git a/Config.mk b/Config.mk
index 5f4f162..06768f6 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 ?= qemu-xen-4.4.3-rc1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.3
 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 ?= 30c002bffcd6287a7d5bb4e2c691b101c0937013
+QEMU_TAG ?= xen-4.4.3
 # Wed Jun 3 14:41:27 2015 +0200
 # ide: Clear DRQ after handling all expected accesses
 
diff --git a/xen/Makefile b/xen/Makefile
index b26ff5b..dccc47d 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-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3$(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 Oct 06 15:22:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjU4E-0002kQ-CC; Tue, 06 Oct 2015 15:22: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 1ZjU4D-0002k8-Dq
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:13 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	32/85-25435-127E3165; Tue, 06 Oct 2015 15:22:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1444144927!23867804!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 1932 invoked from network); 6 Oct 2015 15:22:08 -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;
	6 Oct 2015 15:22:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU46-0008Pd-WA
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU45-0002AR-LF
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:06 +0000
Date: Tue, 06 Oct 2015 15:22:05 +0000
Message-Id: <E1ZjU45-0002AR-LF@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
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 27b82b08b17f589f638f3d5be8dcea42b5e73330
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Aug 20 16:19:38 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 20 16:19:38 2015 +0200

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

diff --git a/Config.mk b/Config.mk
index 5f4f162..06768f6 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 ?= qemu-xen-4.4.3-rc1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.3
 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 ?= 30c002bffcd6287a7d5bb4e2c691b101c0937013
+QEMU_TAG ?= xen-4.4.3
 # Wed Jun 3 14:41:27 2015 +0200
 # ide: Clear DRQ after handling all expected accesses
 
diff --git a/xen/Makefile b/xen/Makefile
index b26ff5b..dccc47d 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-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3$(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 Oct 06 15:22:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjU4L-0002nl-Rt; Tue, 06 Oct 2015 15:22: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 1ZjU4L-0002my-2P
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:21 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	30/02-31069-C27E3165; Tue, 06 Oct 2015 15:22:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1444144938!49548461!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 376 invoked from network); 6 Oct 2015 15:22:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:22:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4I-0008Ph-7E
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4H-0002An-83
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:17 +0000
Date: Tue, 06 Oct 2015 15:22:17 +0000
Message-Id: <E1ZjU4H-0002An-83@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.4-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5b6f36000c40654491ab84a0c55af37129ec4793
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 2 14:47:25 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 2 14:47:25 2015 +0200

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

diff --git a/xen/Makefile b/xen/Makefile
index dccc47d..8071927 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$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Tue Oct 06 15:22:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjU4L-0002nl-Rt; Tue, 06 Oct 2015 15:22: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 1ZjU4L-0002my-2P
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:21 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	30/02-31069-C27E3165; Tue, 06 Oct 2015 15:22:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1444144938!49548461!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 376 invoked from network); 6 Oct 2015 15:22:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:22:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4I-0008Ph-7E
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4H-0002An-83
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:17 +0000
Date: Tue, 06 Oct 2015 15:22:17 +0000
Message-Id: <E1ZjU4H-0002An-83@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.4-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5b6f36000c40654491ab84a0c55af37129ec4793
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 2 14:47:25 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 2 14:47:25 2015 +0200

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

diff --git a/xen/Makefile b/xen/Makefile
index dccc47d..8071927 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$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Tue Oct 06 15:22:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22: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 1ZjU4V-0002rg-Up; Tue, 06 Oct 2015 15:22: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 1ZjU4U-0002rE-So
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:30 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	FE/15-04752-637E3165; Tue, 06 Oct 2015 15:22:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1444144948!20212505!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26176 invoked from network); 6 Oct 2015 15:22:29 -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;
	6 Oct 2015 15:22:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4S-0008Pt-Hm
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4S-0002Bs-ES
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:28 +0000
Date: Tue, 06 Oct 2015 15:22:28 +0000
Message-Id: <E1ZjU4S-0002Bs-ES@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/arm: mm: Do not dump the p2m
	when mapping a foreign gfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 339f5743e84a28dd01ffa7498372e410301cd0b4
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Aug 13 12:03:43 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Sep 2 14:03:39 2015 +0100

    xen/arm: mm: Do not dump the p2m when mapping a foreign gfn
    
    The physmap operation XENMAPSPACE_gfmn_foreign is dumping the p2m when
    an error occured by calling dump_p2m_lookup. But this function is not
    using ratelimited printk.
    
    Any domain able to map foreign gfmn would be able to flood the Xen
    console.
    
    The information wasn't not useful so drop it.
    
    This is XSA-141.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit afc13fe5e21d18c09e44f8ae6f7f4484e9f1de7f)
---
 xen/arch/arm/mm.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 308a798..1d14593 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1065,7 +1065,6 @@ int xenmem_add_to_physmap_one(
         page = get_page_from_gfn(od, idx, &p2mt, P2M_ALLOC);
         if ( !page )
         {
-            dump_p2m_lookup(od, pfn_to_paddr(idx));
             rcu_unlock_domain(od);
             return -EINVAL;
         }
--
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 Oct 06 15:22:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22: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 1ZjU4V-0002rg-Up; Tue, 06 Oct 2015 15:22: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 1ZjU4U-0002rE-So
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:30 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	FE/15-04752-637E3165; Tue, 06 Oct 2015 15:22:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1444144948!20212505!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26176 invoked from network); 6 Oct 2015 15:22:29 -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;
	6 Oct 2015 15:22:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4S-0008Pt-Hm
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4S-0002Bs-ES
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:28 +0000
Date: Tue, 06 Oct 2015 15:22:28 +0000
Message-Id: <E1ZjU4S-0002Bs-ES@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/arm: mm: Do not dump the p2m
	when mapping a foreign gfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 339f5743e84a28dd01ffa7498372e410301cd0b4
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Aug 13 12:03:43 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Sep 2 14:03:39 2015 +0100

    xen/arm: mm: Do not dump the p2m when mapping a foreign gfn
    
    The physmap operation XENMAPSPACE_gfmn_foreign is dumping the p2m when
    an error occured by calling dump_p2m_lookup. But this function is not
    using ratelimited printk.
    
    Any domain able to map foreign gfmn would be able to flood the Xen
    console.
    
    The information wasn't not useful so drop it.
    
    This is XSA-141.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit afc13fe5e21d18c09e44f8ae6f7f4484e9f1de7f)
---
 xen/arch/arm/mm.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 308a798..1d14593 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1065,7 +1065,6 @@ int xenmem_add_to_physmap_one(
         page = get_page_from_gfn(od, idx, &p2mt, P2M_ALLOC);
         if ( !page )
         {
-            dump_p2m_lookup(od, pfn_to_paddr(idx));
             rcu_unlock_domain(od);
             return -EINVAL;
         }
--
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 Oct 06 15:22:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22: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 1ZjU4h-0002v5-1R; Tue, 06 Oct 2015 15:22: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 1ZjU4f-0002uT-QF
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:41 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	76/B2-09570-147E3165; Tue, 06 Oct 2015 15:22:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1444144959!18009015!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25138 invoked from network); 6 Oct 2015 15:22:40 -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;
	6 Oct 2015 15:22:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4c-0008Q6-RB
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4c-0002CK-No
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:38 +0000
Date: Tue, 06 Oct 2015 15:22:38 +0000
Message-Id: <E1ZjU4c-0002CK-No@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] 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 ff9758b54ffe27ce2961de5412c0dc5af9c6abef
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Sep 9 16:14:16 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 9 16:14:16 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 06768f6..5024398 100644
--- a/Config.mk
+++ b/Config.mk
@@ -233,7 +233,7 @@ OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.4-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.4.3
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
--
generated by git-patchbot for /home/xen/git/xen.git#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 Oct 06 15:22:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22: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 1ZjU4h-0002v5-1R; Tue, 06 Oct 2015 15:22: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 1ZjU4f-0002uT-QF
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:41 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	76/B2-09570-147E3165; Tue, 06 Oct 2015 15:22:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1444144959!18009015!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25138 invoked from network); 6 Oct 2015 15:22:40 -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;
	6 Oct 2015 15:22:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4c-0008Q6-RB
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4c-0002CK-No
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:38 +0000
Date: Tue, 06 Oct 2015 15:22:38 +0000
Message-Id: <E1ZjU4c-0002CK-No@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] 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 ff9758b54ffe27ce2961de5412c0dc5af9c6abef
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Sep 9 16:14:16 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 9 16:14:16 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 06768f6..5024398 100644
--- a/Config.mk
+++ b/Config.mk
@@ -233,7 +233,7 @@ OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.4-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.4.3
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
--
generated by git-patchbot for /home/xen/git/xen.git#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 Oct 06 15:22:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22: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 1ZjU4q-0002xf-4D; Tue, 06 Oct 2015 15:22:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4p-0002xH-C1
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:51 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	F3/E6-30270-A47E3165; Tue, 06 Oct 2015 15:22:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1444144969!40327139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24484 invoked from network); 6 Oct 2015 15:22: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;
	6 Oct 2015 15:22:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4n-0008QE-4e
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4n-0002Cp-28
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:49 +0000
Date: Tue, 06 Oct 2015 15:22:49 +0000
Message-Id: <E1ZjU4n-0002Cp-28@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/gdt: Drop write-only,
	xalloc()'d array from set_gdt()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 23c132291d62931be5cc58a67aaa757ebba83ddc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Sep 10 15:49:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:49:59 2015 +0200

    x86/gdt: Drop write-only, xalloc()'d array from set_gdt()
    
    It is not used, and can cause a spurious failure of the set_gdt() hypercall in
    low memory situations.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    master commit: a7bd9b1661304500cd18b7d216d616ecf053ebdb
    master date: 2015-08-05 10:32:45 +0100
---
 xen/arch/x86/mm.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 68cc33b..3f39358 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4361,20 +4361,15 @@ long set_gdt(struct vcpu *v,
     l1_pgentry_t *pl1e;
     /* NB. There are 512 8-byte entries per GDT page. */
     int i, nr_pages = (entries + 511) / 512;
-    unsigned long mfn, *pfns;
 
     if ( entries > FIRST_RESERVED_GDT_ENTRY )
         return -EINVAL;
 
-    pfns = xmalloc_array(unsigned long, nr_pages);
-    if ( !pfns )
-        return -ENOMEM;
-
     /* Check the pages in the new GDT. */
     for ( i = 0; i < nr_pages; i++ )
     {
         struct page_info *page;
-        pfns[i] = frames[i];
+
         page = get_page_from_gfn(d, frames[i], NULL, P2M_ALLOC);
         if ( !page )
             goto fail;
@@ -4383,7 +4378,7 @@ long set_gdt(struct vcpu *v,
             put_page(page);
             goto fail;
         }
-        mfn = frames[i] = page_to_mfn(page);
+        frames[i] = page_to_mfn(page);
     }
 
     /* Tear down the old GDT. */
@@ -4398,7 +4393,6 @@ long set_gdt(struct vcpu *v,
         l1e_write(&pl1e[i], l1e_from_pfn(frames[i], __PAGE_HYPERVISOR));
     }
 
-    xfree(pfns);
     return 0;
 
  fail:
@@ -4406,7 +4400,6 @@ long set_gdt(struct vcpu *v,
     {
         put_page_and_type(mfn_to_page(frames[i]));
     }
-    xfree(pfns);
     return -EINVAL;
 }
 
--
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 Oct 06 15:22:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:22: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 1ZjU4q-0002xf-4D; Tue, 06 Oct 2015 15:22:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4p-0002xH-C1
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:51 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	F3/E6-30270-A47E3165; Tue, 06 Oct 2015 15:22:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1444144969!40327139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24484 invoked from network); 6 Oct 2015 15:22: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;
	6 Oct 2015 15:22:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4n-0008QE-4e
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4n-0002Cp-28
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:49 +0000
Date: Tue, 06 Oct 2015 15:22:49 +0000
Message-Id: <E1ZjU4n-0002Cp-28@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/gdt: Drop write-only,
	xalloc()'d array from set_gdt()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 23c132291d62931be5cc58a67aaa757ebba83ddc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Sep 10 15:49:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:49:59 2015 +0200

    x86/gdt: Drop write-only, xalloc()'d array from set_gdt()
    
    It is not used, and can cause a spurious failure of the set_gdt() hypercall in
    low memory situations.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    master commit: a7bd9b1661304500cd18b7d216d616ecf053ebdb
    master date: 2015-08-05 10:32:45 +0100
---
 xen/arch/x86/mm.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 68cc33b..3f39358 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4361,20 +4361,15 @@ long set_gdt(struct vcpu *v,
     l1_pgentry_t *pl1e;
     /* NB. There are 512 8-byte entries per GDT page. */
     int i, nr_pages = (entries + 511) / 512;
-    unsigned long mfn, *pfns;
 
     if ( entries > FIRST_RESERVED_GDT_ENTRY )
         return -EINVAL;
 
-    pfns = xmalloc_array(unsigned long, nr_pages);
-    if ( !pfns )
-        return -ENOMEM;
-
     /* Check the pages in the new GDT. */
     for ( i = 0; i < nr_pages; i++ )
     {
         struct page_info *page;
-        pfns[i] = frames[i];
+
         page = get_page_from_gfn(d, frames[i], NULL, P2M_ALLOC);
         if ( !page )
             goto fail;
@@ -4383,7 +4378,7 @@ long set_gdt(struct vcpu *v,
             put_page(page);
             goto fail;
         }
-        mfn = frames[i] = page_to_mfn(page);
+        frames[i] = page_to_mfn(page);
     }
 
     /* Tear down the old GDT. */
@@ -4398,7 +4393,6 @@ long set_gdt(struct vcpu *v,
         l1e_write(&pl1e[i], l1e_from_pfn(frames[i], __PAGE_HYPERVISOR));
     }
 
-    xfree(pfns);
     return 0;
 
  fail:
@@ -4406,7 +4400,6 @@ long set_gdt(struct vcpu *v,
     {
         put_page_and_type(mfn_to_page(frames[i]));
     }
-    xfree(pfns);
     return -EINVAL;
 }
 
--
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 Oct 06 15:23:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU51-00030H-6s; Tue, 06 Oct 2015 15:23: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 1ZjU50-0002zu-2D
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:02 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	2A/63-09570-557E3165; Tue, 06 Oct 2015 15:23:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1444144979!46401538!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 31091 invoked from network); 6 Oct 2015 15:23:00 -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;
	6 Oct 2015 15:23:00 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4x-0008QM-Dy
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4x-0002DC-Bq
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:59 +0000
Date: Tue, 06 Oct 2015 15:22:59 +0000
Message-Id: <E1ZjU4x-0002DC-Bq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86,
	amd_ucode: skip microcode updates for final levels
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6657f1b596c046c676d280ae6d57ae59de17804e
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Thu Sep 10 15:51:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:51:02 2015 +0200

    x86, amd_ucode: skip microcode updates for final levels
    
    Some of older[Fam10h] systems require that certain number of
    applied microcode patch levels should not be overwritten by
    the microcode loader. Otherwise, system hangs are known to occur.
    
    The 'final_levels' of patch ids have been obtained empirically.
    Refer bug https://bugzilla.suse.com/show_bug.cgi?id=913996
    for details of the issue.
    
    The short version is that people have predominantly noticed
    system hang issues when trying to update microcode levels
    beyond the patch IDs below.
    [0x01000098, 0x0100009f, 0x010000af]
    
    From internal discussions, we gathered that OS/hypervisor
    cannot reliably perform microcode updates beyond these levels
    due to hardware issues. Therefore, we need to abort microcode
    update process if we hit any of these levels.
    
    In this patch, we check for those microcode versions and abort
    if the current core has one of those final patch levels applied
    by the BIOS
    
    A linux version of the patch has already made it into tip-
    http://marc.info/?l=linux-kernel&m=143703405627170
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 22c5675877c8209adcfdb6bceddb561320374529
    master date: 2015-08-25 16:17:13 +0200
---
 xen/arch/x86/microcode_amd.c |   45 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index 32d7fa1..ed7f7ea 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -270,6 +270,43 @@ static int install_equiv_cpu_table(
     return 0;
 }
 
+/*
+ * The 'final_levels' of patch ids have been obtained empirically.
+ * Refer bug https://bugzilla.suse.com/show_bug.cgi?id=913996
+ * for details of the issue. The short version is that people
+ * using certain Fam10h systems noticed system hang issues when
+ * trying to update microcode levels beyond the patch IDs below.
+ * From internal discussions, we gathered that OS/hypervisor
+ * cannot reliably perform microcode updates beyond these levels
+ * due to hardware issues. Therefore, we need to abort microcode
+ * update process if we hit any of these levels.
+ */
+static const unsigned int final_levels[] = {
+    0x01000098,
+    0x0100009f,
+    0x010000af
+};
+
+static bool_t check_final_patch_levels(unsigned int cpu)
+{
+    /*
+     * Check the current patch levels on the cpu. If they are equal to
+     * any of the 'final_levels', then we should not update the microcode
+     * patch on the cpu as system will hang otherwise.
+     */
+    struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
+    unsigned int i;
+
+    if ( boot_cpu_data.x86 != 0x10 )
+        return 0;
+
+    for ( i = 0; i < ARRAY_SIZE(final_levels); i++ )
+        if ( uci->cpu_sig.rev == final_levels[i] )
+            return 1;
+
+    return 0;
+}
+
 static int cpu_request_microcode(int cpu, const void *buf, size_t bufsize)
 {
     struct microcode_amd *mc_amd, *mc_old;
@@ -288,6 +325,14 @@ static int cpu_request_microcode(int cpu, const void *buf, size_t bufsize)
         goto out;
     }
 
+    if ( check_final_patch_levels(cpu) )
+    {
+        printk(XENLOG_INFO
+               "microcode: Cannot update microcode patch on the cpu as we hit a final level\n");
+        error = -EPERM;
+        goto out;
+    }
+
     mc_amd = xmalloc(struct microcode_amd);
     if ( !mc_amd )
     {
--
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 Oct 06 15:23:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU51-00030H-6s; Tue, 06 Oct 2015 15:23: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 1ZjU50-0002zu-2D
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:02 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	2A/63-09570-557E3165; Tue, 06 Oct 2015 15:23:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1444144979!46401538!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 31091 invoked from network); 6 Oct 2015 15:23:00 -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;
	6 Oct 2015 15:23:00 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4x-0008QM-Dy
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU4x-0002DC-Bq
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:22:59 +0000
Date: Tue, 06 Oct 2015 15:22:59 +0000
Message-Id: <E1ZjU4x-0002DC-Bq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86,
	amd_ucode: skip microcode updates for final levels
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6657f1b596c046c676d280ae6d57ae59de17804e
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Thu Sep 10 15:51:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:51:02 2015 +0200

    x86, amd_ucode: skip microcode updates for final levels
    
    Some of older[Fam10h] systems require that certain number of
    applied microcode patch levels should not be overwritten by
    the microcode loader. Otherwise, system hangs are known to occur.
    
    The 'final_levels' of patch ids have been obtained empirically.
    Refer bug https://bugzilla.suse.com/show_bug.cgi?id=913996
    for details of the issue.
    
    The short version is that people have predominantly noticed
    system hang issues when trying to update microcode levels
    beyond the patch IDs below.
    [0x01000098, 0x0100009f, 0x010000af]
    
    From internal discussions, we gathered that OS/hypervisor
    cannot reliably perform microcode updates beyond these levels
    due to hardware issues. Therefore, we need to abort microcode
    update process if we hit any of these levels.
    
    In this patch, we check for those microcode versions and abort
    if the current core has one of those final patch levels applied
    by the BIOS
    
    A linux version of the patch has already made it into tip-
    http://marc.info/?l=linux-kernel&m=143703405627170
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 22c5675877c8209adcfdb6bceddb561320374529
    master date: 2015-08-25 16:17:13 +0200
---
 xen/arch/x86/microcode_amd.c |   45 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index 32d7fa1..ed7f7ea 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -270,6 +270,43 @@ static int install_equiv_cpu_table(
     return 0;
 }
 
+/*
+ * The 'final_levels' of patch ids have been obtained empirically.
+ * Refer bug https://bugzilla.suse.com/show_bug.cgi?id=913996
+ * for details of the issue. The short version is that people
+ * using certain Fam10h systems noticed system hang issues when
+ * trying to update microcode levels beyond the patch IDs below.
+ * From internal discussions, we gathered that OS/hypervisor
+ * cannot reliably perform microcode updates beyond these levels
+ * due to hardware issues. Therefore, we need to abort microcode
+ * update process if we hit any of these levels.
+ */
+static const unsigned int final_levels[] = {
+    0x01000098,
+    0x0100009f,
+    0x010000af
+};
+
+static bool_t check_final_patch_levels(unsigned int cpu)
+{
+    /*
+     * Check the current patch levels on the cpu. If they are equal to
+     * any of the 'final_levels', then we should not update the microcode
+     * patch on the cpu as system will hang otherwise.
+     */
+    struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
+    unsigned int i;
+
+    if ( boot_cpu_data.x86 != 0x10 )
+        return 0;
+
+    for ( i = 0; i < ARRAY_SIZE(final_levels); i++ )
+        if ( uci->cpu_sig.rev == final_levels[i] )
+            return 1;
+
+    return 0;
+}
+
 static int cpu_request_microcode(int cpu, const void *buf, size_t bufsize)
 {
     struct microcode_amd *mc_amd, *mc_old;
@@ -288,6 +325,14 @@ static int cpu_request_microcode(int cpu, const void *buf, size_t bufsize)
         goto out;
     }
 
+    if ( check_final_patch_levels(cpu) )
+    {
+        printk(XENLOG_INFO
+               "microcode: Cannot update microcode patch on the cpu as we hit a final level\n");
+        error = -EPERM;
+        goto out;
+    }
+
     mc_amd = xmalloc(struct microcode_amd);
     if ( !mc_amd )
     {
--
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 Oct 06 15:23:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU5B-00032u-9b; Tue, 06 Oct 2015 15:23: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 1ZjU5A-00032T-G9
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:12 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	07/15-15765-F57E3165; Tue, 06 Oct 2015 15:23:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1444144990!56229951!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10140 invoked from network); 6 Oct 2015 15:23:11 -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;
	6 Oct 2015 15:23:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU57-0008Qx-Rx
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU57-0002Dk-J9
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:09 +0000
Date: Tue, 06 Oct 2015 15:23:09 +0000
Message-Id: <E1ZjU57-0002Dk-J9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/IO-APIC: don't create pIRQ
	mapping from masked RTE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9a00f96bb09ff8642bef2a3edde855a924093614
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:51:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:51:56 2015 +0200

    x86/IO-APIC: don't create pIRQ mapping from masked RTE
    
    While moving our XenoLinux patches to 4.2-rc I noticed bogus "already
    mapped" messages resulting from Linux (legitimately) writing RTEs with
    only the mask bit set. Clearly we shouldn't even attempt to create a
    pIRQ <-> IRQ mapping from such RTEs.
    
    In the course of this I also found that the respective message isn't
    really useful without also printing the pre-existing mapping. And I
    noticed that map_domain_pirq() allowed IRQ0 to get through, despite us
    never allowing a domain to control that interrupt.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 669d4b85c433674ab3b52ef707af0d3a551c941f
    master date: 2015-08-25 16:18:31 +0200
---
 xen/arch/x86/io_apic.c |   25 ++++++++++++++++---------
 xen/arch/x86/irq.c     |    7 ++++---
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 8f41a06..3ab29b0 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2370,9 +2370,14 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
      * pirq and irq mapping. Where the GSI is greater than 256, we assume
      * that dom0 pirq == irq.
      */
-    pirq = (irq >= 256) ? irq : rte.vector;
-    if ( (pirq < 0) || (pirq >= dom0->nr_pirqs) )
-        return -EINVAL;
+    if ( !rte.mask )
+    {
+        pirq = (irq >= 256) ? irq : rte.vector;
+        if ( pirq >= dom0->nr_pirqs )
+            return -EINVAL;
+    }
+    else
+        pirq = -1;
     
     if ( desc->action )
     {
@@ -2407,12 +2412,14 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 
         printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
-    spin_lock(&dom0->event_lock);
-    ret = map_domain_pirq(dom0, pirq, irq,
-            MAP_PIRQ_TYPE_GSI, NULL);
-    spin_unlock(&dom0->event_lock);
-    if ( ret < 0 )
-        return ret;
+    if ( pirq >= 0 )
+    {
+        spin_lock(&dom0->event_lock);
+        ret = map_domain_pirq(dom0, pirq, irq, MAP_PIRQ_TYPE_GSI, NULL);
+        spin_unlock(&dom0->event_lock);
+        if ( ret < 0 )
+            return ret;
+    }
 
     spin_lock_irqsave(&ioapic_lock, flags);
     /* Set the correct irq-handling type. */
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 194d508..77aded7 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1897,7 +1897,7 @@ int map_domain_pirq(
     if ( !irq_access_permitted(current->domain, irq))
         return -EPERM;
 
-    if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
+    if ( pirq < 0 || pirq >= d->nr_pirqs || irq <= 0 || irq >= nr_irqs )
     {
         dprintk(XENLOG_G_ERR, "dom%d: invalid pirq %d or irq %d\n",
                 d->domain_id, pirq, irq);
@@ -1910,8 +1910,9 @@ int map_domain_pirq(
     if ( (old_irq > 0 && (old_irq != irq) ) ||
          (old_pirq && (old_pirq != pirq)) )
     {
-        dprintk(XENLOG_G_WARNING, "dom%d: pirq %d or irq %d already mapped\n",
-                d->domain_id, pirq, irq);
+        dprintk(XENLOG_G_WARNING,
+                "dom%d: pirq %d or irq %d already mapped (%d,%d)\n",
+                d->domain_id, pirq, irq, old_pirq, old_irq);
         return 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 Tue Oct 06 15:23:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU5B-00032u-9b; Tue, 06 Oct 2015 15:23: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 1ZjU5A-00032T-G9
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:12 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	07/15-15765-F57E3165; Tue, 06 Oct 2015 15:23:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1444144990!56229951!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10140 invoked from network); 6 Oct 2015 15:23:11 -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;
	6 Oct 2015 15:23:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU57-0008Qx-Rx
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU57-0002Dk-J9
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:09 +0000
Date: Tue, 06 Oct 2015 15:23:09 +0000
Message-Id: <E1ZjU57-0002Dk-J9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/IO-APIC: don't create pIRQ
	mapping from masked RTE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9a00f96bb09ff8642bef2a3edde855a924093614
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:51:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:51:56 2015 +0200

    x86/IO-APIC: don't create pIRQ mapping from masked RTE
    
    While moving our XenoLinux patches to 4.2-rc I noticed bogus "already
    mapped" messages resulting from Linux (legitimately) writing RTEs with
    only the mask bit set. Clearly we shouldn't even attempt to create a
    pIRQ <-> IRQ mapping from such RTEs.
    
    In the course of this I also found that the respective message isn't
    really useful without also printing the pre-existing mapping. And I
    noticed that map_domain_pirq() allowed IRQ0 to get through, despite us
    never allowing a domain to control that interrupt.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 669d4b85c433674ab3b52ef707af0d3a551c941f
    master date: 2015-08-25 16:18:31 +0200
---
 xen/arch/x86/io_apic.c |   25 ++++++++++++++++---------
 xen/arch/x86/irq.c     |    7 ++++---
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 8f41a06..3ab29b0 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2370,9 +2370,14 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
      * pirq and irq mapping. Where the GSI is greater than 256, we assume
      * that dom0 pirq == irq.
      */
-    pirq = (irq >= 256) ? irq : rte.vector;
-    if ( (pirq < 0) || (pirq >= dom0->nr_pirqs) )
-        return -EINVAL;
+    if ( !rte.mask )
+    {
+        pirq = (irq >= 256) ? irq : rte.vector;
+        if ( pirq >= dom0->nr_pirqs )
+            return -EINVAL;
+    }
+    else
+        pirq = -1;
     
     if ( desc->action )
     {
@@ -2407,12 +2412,14 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 
         printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
-    spin_lock(&dom0->event_lock);
-    ret = map_domain_pirq(dom0, pirq, irq,
-            MAP_PIRQ_TYPE_GSI, NULL);
-    spin_unlock(&dom0->event_lock);
-    if ( ret < 0 )
-        return ret;
+    if ( pirq >= 0 )
+    {
+        spin_lock(&dom0->event_lock);
+        ret = map_domain_pirq(dom0, pirq, irq, MAP_PIRQ_TYPE_GSI, NULL);
+        spin_unlock(&dom0->event_lock);
+        if ( ret < 0 )
+            return ret;
+    }
 
     spin_lock_irqsave(&ioapic_lock, flags);
     /* Set the correct irq-handling type. */
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 194d508..77aded7 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1897,7 +1897,7 @@ int map_domain_pirq(
     if ( !irq_access_permitted(current->domain, irq))
         return -EPERM;
 
-    if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
+    if ( pirq < 0 || pirq >= d->nr_pirqs || irq <= 0 || irq >= nr_irqs )
     {
         dprintk(XENLOG_G_ERR, "dom%d: invalid pirq %d or irq %d\n",
                 d->domain_id, pirq, irq);
@@ -1910,8 +1910,9 @@ int map_domain_pirq(
     if ( (old_irq > 0 && (old_irq != irq) ) ||
          (old_pirq && (old_pirq != pirq)) )
     {
-        dprintk(XENLOG_G_WARNING, "dom%d: pirq %d or irq %d already mapped\n",
-                d->domain_id, pirq, irq);
+        dprintk(XENLOG_G_WARNING,
+                "dom%d: pirq %d or irq %d already mapped (%d,%d)\n",
+                d->domain_id, pirq, irq, old_pirq, old_irq);
         return 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 Tue Oct 06 15:23:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU5M-00035h-Ch; Tue, 06 Oct 2015 15:23: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 1ZjU5K-00035E-SA
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:22 +0000
Content-Length: 1641
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	DF/A7-25435-A67E3165; Tue, 06 Oct 2015 15:23:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1444145000!23326753!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9978 invoked from network); 6 Oct 2015 15:23:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:23:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5I-0008R5-44
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5I-0002EE-2O
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:20 +0000
Date: Tue, 06 Oct 2015 15:23:20 +0000
Message-Id: <E1ZjU5I-0002EE-2O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] IOMMU: skip domains without page
	tables when dumping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1689702783271426244=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1689702783271426244==
Content-Length: 1221
Content-Transfer-Encoding: quoted-printable

commit 181ebad4a0e9f140054208b17e4936f85c4ee39c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:52:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:52:28 2015 +0200

    IOMMU: skip domains without page tables when dumping
    
    Reported-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    master commit: 5f335544cf5b716b0af51223e33373c4a7d65e8c
    master date: 2015-08-27 17:40:38 +0200
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index c687c53..a4fccc5 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -817,7 +817,7 @@ static void iommu_dump_p2m_table(unsigned char key)
     ops =3D iommu_get_ops();
     for_each_domain(d)
     {
-        if ( !d->domain_id )
+        if ( !d->domain_id || need_iommu(d) <=3D 0 )
             continue;
 
         if ( iommu_use_hap_pt(d) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4


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

From xen-changelog-bounces@lists.xen.org Tue Oct 06 15:23:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU5M-00035h-Ch; Tue, 06 Oct 2015 15:23: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 1ZjU5K-00035E-SA
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:22 +0000
Content-Length: 1641
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	DF/A7-25435-A67E3165; Tue, 06 Oct 2015 15:23:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1444145000!23326753!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9978 invoked from network); 6 Oct 2015 15:23:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:23:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5I-0008R5-44
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5I-0002EE-2O
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:20 +0000
Date: Tue, 06 Oct 2015 15:23:20 +0000
Message-Id: <E1ZjU5I-0002EE-2O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] IOMMU: skip domains without page
	tables when dumping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1689702783271426244=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1689702783271426244==
Content-Length: 1221
Content-Transfer-Encoding: quoted-printable

commit 181ebad4a0e9f140054208b17e4936f85c4ee39c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:52:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:52:28 2015 +0200

    IOMMU: skip domains without page tables when dumping
    
    Reported-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    master commit: 5f335544cf5b716b0af51223e33373c4a7d65e8c
    master date: 2015-08-27 17:40:38 +0200
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index c687c53..a4fccc5 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -817,7 +817,7 @@ static void iommu_dump_p2m_table(unsigned char key)
     ops =3D iommu_get_ops();
     for_each_domain(d)
     {
-        if ( !d->domain_id )
+        if ( !d->domain_id || need_iommu(d) <=3D 0 )
             continue;
 
         if ( iommu_use_hap_pt(d) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4


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

From xen-changelog-bounces@lists.xen.org Tue Oct 06 15:23:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjU5W-000391-Hf; Tue, 06 Oct 2015 15:23:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5V-00038Z-2h
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:33 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	A8/05-09570-477E3165; Tue, 06 Oct 2015 15:23:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1444145010!18830764!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7882 invoked from network); 6 Oct 2015 15:23:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:23:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5S-0008RD-Dd
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5S-0002FD-AY
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:30 +0000
Date: Tue, 06 Oct 2015 15:23:30 +0000
Message-Id: <E1ZjU5S-0002FD-AY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/NUMA: fix setup_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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8bea7194a645d5ecb27ad2874eeff7a5734510ce
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:53:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:53:37 2015 +0200

    x86/NUMA: fix setup_node()
    
    The function referenced an __initdata object (nodes_found). Since this
    being a node mask was more complicated than needed, the variable gets
    replaced by a simple counter. Check at once that the count of nodes
    doesn't go beyond MAX_NUMNODES.
    
    Also consolidate three printk()s related to the function's use into just
    one.
    
    Finally (quite the opposite of the above issue) __init-annotate
    nodes_cover_memory().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8f945d36d9bddd5b589ba23c7322b30d623dd084
    master date: 2015-08-31 13:51:52 +0200
---
 xen/arch/x86/srat.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 2b05272..78ea7c0 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -25,7 +25,6 @@ static struct acpi_table_slit *__read_mostly acpi_slit;
 
 static nodemask_t memory_nodes_parsed __initdata;
 static nodemask_t processor_nodes_parsed __initdata;
-static nodemask_t nodes_found __initdata;
 static struct node nodes[MAX_NUMNODES] __initdata;
 static u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
 
@@ -45,17 +44,25 @@ int pxm_to_node(int pxm)
 	return (signed char)pxm2node[pxm];
 }
 
-__devinit int setup_node(int pxm)
+int setup_node(int pxm)
 {
 	unsigned node = pxm2node[pxm];
-	if (node == 0xff) {
-		if (nodes_weight(nodes_found) >= MAX_NUMNODES)
+
+	if (node == NUMA_NO_NODE) {
+		static bool_t warned;
+		static unsigned nodes_found;
+
+		node = nodes_found++;
+		if (node >= MAX_NUMNODES) {
+			printk(KERN_WARNING
+			       "SRAT: Too many proximity domains (%#x)\n",
+			       pxm);
+			warned = 1;
 			return -1;
-		node = first_unset_node(nodes_found); 
-		node_set(node, nodes_found);
+		}
 		pxm2node[pxm] = node;
 	}
-	return pxm2node[pxm];
+	return node;
 }
 
 int valid_numa_range(u64 start, u64 end, int node)
@@ -176,7 +183,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 	pxm = pa->proximity_domain;
 	node = setup_node(pxm);
 	if (node < 0) {
-		printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
 		bad_srat();
 		return;
 	}
@@ -209,7 +215,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	}
 	node = setup_node(pxm);
 	if (node < 0) {
-		printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
 		bad_srat();
 		return;
 	}
@@ -253,7 +258,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		pxm &= 0xff;
 	node = setup_node(pxm);
 	if (node < 0) {
-		printk(KERN_ERR "SRAT: Too many proximity domains.\n");
 		bad_srat();
 		return;
 	}
@@ -295,7 +299,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 
 /* Sanity check to catch more bad SRATs (they are amazingly common).
    Make sure the PXMs cover all memory. */
-static int nodes_cover_memory(void)
+static int __init nodes_cover_memory(void)
 {
 	int i;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Tue Oct 06 15:23:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjU5W-000391-Hf; Tue, 06 Oct 2015 15:23:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5V-00038Z-2h
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:33 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	A8/05-09570-477E3165; Tue, 06 Oct 2015 15:23:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1444145010!18830764!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7882 invoked from network); 6 Oct 2015 15:23:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:23:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5S-0008RD-Dd
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5S-0002FD-AY
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:30 +0000
Date: Tue, 06 Oct 2015 15:23:30 +0000
Message-Id: <E1ZjU5S-0002FD-AY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/NUMA: fix setup_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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8bea7194a645d5ecb27ad2874eeff7a5734510ce
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:53:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:53:37 2015 +0200

    x86/NUMA: fix setup_node()
    
    The function referenced an __initdata object (nodes_found). Since this
    being a node mask was more complicated than needed, the variable gets
    replaced by a simple counter. Check at once that the count of nodes
    doesn't go beyond MAX_NUMNODES.
    
    Also consolidate three printk()s related to the function's use into just
    one.
    
    Finally (quite the opposite of the above issue) __init-annotate
    nodes_cover_memory().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8f945d36d9bddd5b589ba23c7322b30d623dd084
    master date: 2015-08-31 13:51:52 +0200
---
 xen/arch/x86/srat.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 2b05272..78ea7c0 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -25,7 +25,6 @@ static struct acpi_table_slit *__read_mostly acpi_slit;
 
 static nodemask_t memory_nodes_parsed __initdata;
 static nodemask_t processor_nodes_parsed __initdata;
-static nodemask_t nodes_found __initdata;
 static struct node nodes[MAX_NUMNODES] __initdata;
 static u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
 
@@ -45,17 +44,25 @@ int pxm_to_node(int pxm)
 	return (signed char)pxm2node[pxm];
 }
 
-__devinit int setup_node(int pxm)
+int setup_node(int pxm)
 {
 	unsigned node = pxm2node[pxm];
-	if (node == 0xff) {
-		if (nodes_weight(nodes_found) >= MAX_NUMNODES)
+
+	if (node == NUMA_NO_NODE) {
+		static bool_t warned;
+		static unsigned nodes_found;
+
+		node = nodes_found++;
+		if (node >= MAX_NUMNODES) {
+			printk(KERN_WARNING
+			       "SRAT: Too many proximity domains (%#x)\n",
+			       pxm);
+			warned = 1;
 			return -1;
-		node = first_unset_node(nodes_found); 
-		node_set(node, nodes_found);
+		}
 		pxm2node[pxm] = node;
 	}
-	return pxm2node[pxm];
+	return node;
 }
 
 int valid_numa_range(u64 start, u64 end, int node)
@@ -176,7 +183,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 	pxm = pa->proximity_domain;
 	node = setup_node(pxm);
 	if (node < 0) {
-		printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
 		bad_srat();
 		return;
 	}
@@ -209,7 +215,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	}
 	node = setup_node(pxm);
 	if (node < 0) {
-		printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
 		bad_srat();
 		return;
 	}
@@ -253,7 +258,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		pxm &= 0xff;
 	node = setup_node(pxm);
 	if (node < 0) {
-		printk(KERN_ERR "SRAT: Too many proximity domains.\n");
 		bad_srat();
 		return;
 	}
@@ -295,7 +299,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 
 /* Sanity check to catch more bad SRATs (they are amazingly common).
    Make sure the PXMs cover all memory. */
-static int nodes_cover_memory(void)
+static int __init nodes_cover_memory(void)
 {
 	int i;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Tue Oct 06 15:23:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU5g-0003BH-KT; Tue, 06 Oct 2015 15:23:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5f-0003Aw-6e
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:43 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	2E/37-16618-E77E3165; Tue, 06 Oct 2015 15:23:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1444145020!56149070!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 15992 invoked from network); 6 Oct 2015 15:23:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:23:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5c-0008RL-JS
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5c-0002Fd-Hx
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:40 +0000
Date: Tue, 06 Oct 2015 15:23:40 +0000
Message-Id: <E1ZjU5c-0002Fd-Hx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/NUMA: don't account hotplug
	regions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cfb5d2001784dfdec638ba335fd9252f5833ee2d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:54:13 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:54:13 2015 +0200

    x86/NUMA: don't account hotplug regions
    
    ... except in cases where they really matter: node_memblk_range[] now
    is the only place all regions get stored. nodes[] and NODE_DATA() track
    present memory only. This improves the reporting when nodes have
    disjoint "normal" and hotplug regions, with the hotplug region sitting
    above the highest populated page. In such cases a node's spanned-pages
    value (visible in both XEN_SYSCTL_numainfo and 'u' debug key output)
    covered all the way up to top of populated memory, giving quite
    different a picture from what an otherwise identically configured
    system without and hotplug regions would report. Note, however, that
    the actual hotplug case (as well as cases of nodes with multiple
    disjoint present regions) is still not being handled such that the
    reported values would represent how much memory a node really has (but
    that can be considered intentional).
    
    Reported-by: Jim Fehlig <jfehlig@suse.com>
    
    This at once makes nodes_cover_memory() no longer consider E820_RAM
    regions covered by SRAT hotplug regions.
    
    Also reject self-overlaps with mismatching hotplug flags.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jim Fehlig <jfehlig@suse.com>
    master commit: c011f470e6e79208f5baa071b4d072b78c88e2ba
    master date: 2015-08-31 13:52:24 +0200
---
 xen/arch/x86/srat.c |   56 +++++++++++++++++++++++++++++++-------------------
 1 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 78ea7c0..d4e479c 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -32,7 +32,7 @@ static u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
 static int num_node_memblks;
 static struct node node_memblk_range[NR_NODE_MEMBLKS];
 static int memblk_nodeid[NR_NODE_MEMBLKS];
-
+static __initdata DECLARE_BITMAP(memblk_hotplug, NR_NODE_MEMBLKS);
 
 static int node_to_pxm(int n);
 
@@ -89,9 +89,9 @@ static __init int conflicting_memblks(u64 start, u64 end)
 		if (nd->start == nd->end)
 			continue;
 		if (nd->end > start && nd->start < end)
-			return memblk_nodeid[i];
+			return i;
 		if (nd->end == end && nd->start == start)
-			return memblk_nodeid[i];
+			return i;
 	}
 	return -1;
 }
@@ -229,7 +229,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 void __init
 acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 {
-	struct node *nd;
 	u64 start, end;
 	int node, pxm;
 	int i;
@@ -263,30 +262,40 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 	}
 	/* It is fine to add this area to the nodes data it will be used later*/
 	i = conflicting_memblks(start, end);
-	if (i == node) {
-		printk(KERN_WARNING
-		"SRAT: Warning: PXM %d (%"PRIx64"-%"PRIx64") overlaps with itself (%"
-		PRIx64"-%"PRIx64")\n", pxm, start, end, nodes[i].start, nodes[i].end);
-	} else if (i >= 0) {
+	if (i < 0)
+		/* everything fine */;
+	else if (memblk_nodeid[i] == node) {
+		bool_t mismatch = !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) !=
+		                  !test_bit(i, memblk_hotplug);
+
+		printk("%sSRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with itself (%"PRIx64"-%"PRIx64")\n",
+		       mismatch ? KERN_ERR : KERN_WARNING, pxm, start, end,
+		       node_memblk_range[i].start, node_memblk_range[i].end);
+		if (mismatch) {
+			bad_srat();
+			return;
+		}
+	} else {
 		printk(KERN_ERR
-		       "SRAT: PXM %d (%"PRIx64"-%"PRIx64") overlaps with PXM %d (%"
-		       PRIx64"-%"PRIx64")\n", pxm, start, end, node_to_pxm(i),
-			   nodes[i].start, nodes[i].end);
+		       "SRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with PXM %u (%"PRIx64"-%"PRIx64")\n",
+		       pxm, start, end, node_to_pxm(memblk_nodeid[i]),
+		       node_memblk_range[i].start, node_memblk_range[i].end);
 		bad_srat();
 		return;
 	}
-	nd = &nodes[node];
-	if (!node_test_and_set(node, memory_nodes_parsed)) {
-		nd->start = start;
-		nd->end = end;
-	} else {
-		if (start < nd->start)
+	if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) {
+		struct node *nd = &nodes[node];
+
+		if (!node_test_and_set(node, memory_nodes_parsed)) {
 			nd->start = start;
-		if (nd->end < end)
 			nd->end = end;
+		} else {
+			if (start < nd->start)
+				nd->start = start;
+			if (nd->end < end)
+				nd->end = end;
+		}
 	}
-	if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && end > mem_hotplug)
-		mem_hotplug = end;
 	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"%s\n",
 	       node, pxm, start, end,
 	       ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : "");
@@ -294,6 +303,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 	node_memblk_range[num_node_memblks].start = start;
 	node_memblk_range[num_node_memblks].end = end;
 	memblk_nodeid[num_node_memblks] = node;
+	if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
+		__set_bit(num_node_memblks, memblk_hotplug);
+		if (end > mem_hotplug)
+			mem_hotplug = end;
+	}
 	num_node_memblks++;
 }
 
--
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 Oct 06 15:23:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU5g-0003BH-KT; Tue, 06 Oct 2015 15:23:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5f-0003Aw-6e
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:43 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	2E/37-16618-E77E3165; Tue, 06 Oct 2015 15:23:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1444145020!56149070!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 15992 invoked from network); 6 Oct 2015 15:23:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:23:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5c-0008RL-JS
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5c-0002Fd-Hx
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:40 +0000
Date: Tue, 06 Oct 2015 15:23:40 +0000
Message-Id: <E1ZjU5c-0002Fd-Hx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/NUMA: don't account hotplug
	regions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cfb5d2001784dfdec638ba335fd9252f5833ee2d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:54:13 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:54:13 2015 +0200

    x86/NUMA: don't account hotplug regions
    
    ... except in cases where they really matter: node_memblk_range[] now
    is the only place all regions get stored. nodes[] and NODE_DATA() track
    present memory only. This improves the reporting when nodes have
    disjoint "normal" and hotplug regions, with the hotplug region sitting
    above the highest populated page. In such cases a node's spanned-pages
    value (visible in both XEN_SYSCTL_numainfo and 'u' debug key output)
    covered all the way up to top of populated memory, giving quite
    different a picture from what an otherwise identically configured
    system without and hotplug regions would report. Note, however, that
    the actual hotplug case (as well as cases of nodes with multiple
    disjoint present regions) is still not being handled such that the
    reported values would represent how much memory a node really has (but
    that can be considered intentional).
    
    Reported-by: Jim Fehlig <jfehlig@suse.com>
    
    This at once makes nodes_cover_memory() no longer consider E820_RAM
    regions covered by SRAT hotplug regions.
    
    Also reject self-overlaps with mismatching hotplug flags.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Jim Fehlig <jfehlig@suse.com>
    master commit: c011f470e6e79208f5baa071b4d072b78c88e2ba
    master date: 2015-08-31 13:52:24 +0200
---
 xen/arch/x86/srat.c |   56 +++++++++++++++++++++++++++++++-------------------
 1 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 78ea7c0..d4e479c 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -32,7 +32,7 @@ static u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
 static int num_node_memblks;
 static struct node node_memblk_range[NR_NODE_MEMBLKS];
 static int memblk_nodeid[NR_NODE_MEMBLKS];
-
+static __initdata DECLARE_BITMAP(memblk_hotplug, NR_NODE_MEMBLKS);
 
 static int node_to_pxm(int n);
 
@@ -89,9 +89,9 @@ static __init int conflicting_memblks(u64 start, u64 end)
 		if (nd->start == nd->end)
 			continue;
 		if (nd->end > start && nd->start < end)
-			return memblk_nodeid[i];
+			return i;
 		if (nd->end == end && nd->start == start)
-			return memblk_nodeid[i];
+			return i;
 	}
 	return -1;
 }
@@ -229,7 +229,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 void __init
 acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 {
-	struct node *nd;
 	u64 start, end;
 	int node, pxm;
 	int i;
@@ -263,30 +262,40 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 	}
 	/* It is fine to add this area to the nodes data it will be used later*/
 	i = conflicting_memblks(start, end);
-	if (i == node) {
-		printk(KERN_WARNING
-		"SRAT: Warning: PXM %d (%"PRIx64"-%"PRIx64") overlaps with itself (%"
-		PRIx64"-%"PRIx64")\n", pxm, start, end, nodes[i].start, nodes[i].end);
-	} else if (i >= 0) {
+	if (i < 0)
+		/* everything fine */;
+	else if (memblk_nodeid[i] == node) {
+		bool_t mismatch = !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) !=
+		                  !test_bit(i, memblk_hotplug);
+
+		printk("%sSRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with itself (%"PRIx64"-%"PRIx64")\n",
+		       mismatch ? KERN_ERR : KERN_WARNING, pxm, start, end,
+		       node_memblk_range[i].start, node_memblk_range[i].end);
+		if (mismatch) {
+			bad_srat();
+			return;
+		}
+	} else {
 		printk(KERN_ERR
-		       "SRAT: PXM %d (%"PRIx64"-%"PRIx64") overlaps with PXM %d (%"
-		       PRIx64"-%"PRIx64")\n", pxm, start, end, node_to_pxm(i),
-			   nodes[i].start, nodes[i].end);
+		       "SRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with PXM %u (%"PRIx64"-%"PRIx64")\n",
+		       pxm, start, end, node_to_pxm(memblk_nodeid[i]),
+		       node_memblk_range[i].start, node_memblk_range[i].end);
 		bad_srat();
 		return;
 	}
-	nd = &nodes[node];
-	if (!node_test_and_set(node, memory_nodes_parsed)) {
-		nd->start = start;
-		nd->end = end;
-	} else {
-		if (start < nd->start)
+	if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) {
+		struct node *nd = &nodes[node];
+
+		if (!node_test_and_set(node, memory_nodes_parsed)) {
 			nd->start = start;
-		if (nd->end < end)
 			nd->end = end;
+		} else {
+			if (start < nd->start)
+				nd->start = start;
+			if (nd->end < end)
+				nd->end = end;
+		}
 	}
-	if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && end > mem_hotplug)
-		mem_hotplug = end;
 	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"%s\n",
 	       node, pxm, start, end,
 	       ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : "");
@@ -294,6 +303,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 	node_memblk_range[num_node_memblks].start = start;
 	node_memblk_range[num_node_memblks].end = end;
 	memblk_nodeid[num_node_memblks] = node;
+	if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
+		__set_bit(num_node_memblks, memblk_hotplug);
+		if (end > mem_hotplug)
+			mem_hotplug = end;
+	}
 	num_node_memblks++;
 }
 
--
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 Oct 06 15:23:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU5q-0003D2-N2; Tue, 06 Oct 2015 15:23:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5p-0003Ck-Gn
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:53 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	73/EA-19220-887E3165; Tue, 06 Oct 2015 15:23:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1444145031!34918377!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18646 invoked from network); 6 Oct 2015 15:23:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:23:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5m-0008RT-TR
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5m-0002G3-RC
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:50 +0000
Date: Tue, 06 Oct 2015 15:23:50 +0000
Message-Id: <E1ZjU5m-0002G3-RC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/mm: Make {hap,
	shadow}_teardown() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e19042ffbdf07e217c827eb0f722be5fe1623ea3
Author:     Anshul Makkar <anshul.makkar@citrix.com>
AuthorDate: Thu Sep 10 15:55:23 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:55:23 2015 +0200

    x86/mm: Make {hap, shadow}_teardown() preemptible
    
    A domain with sufficient shadow allocation can cause a watchdog timeout
    during domain destruction.  Expand the existing -EAGAIN logic in
    paging_teardown() to allow {hap/sh}_set_allocation() to become
    restartable during the DOMCTL_destroydomain hypercall.
    
    Signed-off-by: Anshul Makkar <anshul.makkar@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    master commit: 0174da5b79752e2d5d6ca0faed89536e8f3d91c7
    master date: 2015-08-06 10:04:43 +0100
---
 xen/arch/x86/mm/hap/hap.c       |   22 ++++++++--------------
 xen/arch/x86/mm/paging.c        |    9 ++++++---
 xen/arch/x86/mm/shadow/common.c |   24 +++++++++---------------
 xen/include/asm-x86/hap.h       |    2 +-
 xen/include/asm-x86/shadow.h    |    2 +-
 5 files changed, 25 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 71227ef..c06369b 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -498,7 +498,7 @@ void hap_final_teardown(struct domain *d)
     }
 
     if ( d->arch.paging.hap.total_pages != 0 )
-        hap_teardown(d);
+        hap_teardown(d, NULL);
 
     p2m_teardown(p2m_get_hostp2m(d));
     /* Free any memory that the p2m teardown released */
@@ -508,7 +508,7 @@ void hap_final_teardown(struct domain *d)
     paging_unlock(d);
 }
 
-void hap_teardown(struct domain *d)
+void hap_teardown(struct domain *d, int *preempted)
 {
     struct vcpu *v;
     mfn_t mfn;
@@ -536,18 +536,11 @@ void hap_teardown(struct domain *d)
 
     if ( d->arch.paging.hap.total_pages != 0 )
     {
-        HAP_PRINTK("teardown of domain %u starts."
-                      "  pages total = %u, free = %u, p2m=%u\n",
-                      d->domain_id,
-                      d->arch.paging.hap.total_pages,
-                      d->arch.paging.hap.free_pages,
-                      d->arch.paging.hap.p2m_pages);
-        hap_set_allocation(d, 0, NULL);
-        HAP_PRINTK("teardown done."
-                      "  pages total = %u, free = %u, p2m=%u\n",
-                      d->arch.paging.hap.total_pages,
-                      d->arch.paging.hap.free_pages,
-                      d->arch.paging.hap.p2m_pages);
+        hap_set_allocation(d, 0, preempted);
+
+        if ( preempted && *preempted )
+            goto out;
+
         ASSERT(d->arch.paging.hap.total_pages == 0);
     }
 
@@ -556,6 +549,7 @@ void hap_teardown(struct domain *d)
     xfree(d->arch.hvm_domain.dirty_vram);
     d->arch.hvm_domain.dirty_vram = NULL;
 
+out:
     paging_unlock(d);
 }
 
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index fb418fe..72555b3 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -777,12 +777,15 @@ long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 /* Call when destroying a domain */
 int paging_teardown(struct domain *d)
 {
-    int rc;
+    int rc, preempted = 0;
 
     if ( hap_enabled(d) )
-        hap_teardown(d);
+        hap_teardown(d, &preempted);
     else
-        shadow_teardown(d);
+        shadow_teardown(d, &preempted);
+
+    if ( preempted )
+        return -EAGAIN;
 
     /* clean up log dirty resources. */
     rc = paging_free_log_dirty_bitmap(d, 0);
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 3ed48c4..90ba4d6 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3031,7 +3031,7 @@ int shadow_enable(struct domain *d, u32 mode)
     return rv;
 }
 
-void shadow_teardown(struct domain *d)
+void shadow_teardown(struct domain *d, int *preempted)
 /* Destroy the shadow pagetables of this domain and free its shadow memory.
  * Should only be called for dying domains. */
 {
@@ -3092,23 +3092,16 @@ void shadow_teardown(struct domain *d)
 
     if ( d->arch.paging.shadow.total_pages != 0 )
     {
-        SHADOW_PRINTK("teardown of domain %u starts."
-                       "  Shadow pages total = %u, free = %u, p2m=%u\n",
-                       d->domain_id,
-                       d->arch.paging.shadow.total_pages, 
-                       d->arch.paging.shadow.free_pages, 
-                       d->arch.paging.shadow.p2m_pages);
         /* Destroy all the shadows and release memory to domheap */
-        sh_set_allocation(d, 0, NULL);
+        sh_set_allocation(d, 0, preempted);
+
+        if ( preempted && *preempted )
+            goto out;
+
         /* Release the hash table back to xenheap */
         if (d->arch.paging.shadow.hash_table) 
             shadow_hash_teardown(d);
-        /* Should not have any more memory held */
-        SHADOW_PRINTK("teardown done."
-                       "  Shadow pages total = %u, free = %u, p2m=%u\n",
-                       d->arch.paging.shadow.total_pages, 
-                       d->arch.paging.shadow.free_pages, 
-                       d->arch.paging.shadow.p2m_pages);
+
         ASSERT(d->arch.paging.shadow.total_pages == 0);
     }
 
@@ -3139,6 +3132,7 @@ void shadow_teardown(struct domain *d)
         d->arch.hvm_domain.dirty_vram = NULL;
     }
 
+out:
     paging_unlock(d);
 
     /* Must be called outside the lock */
@@ -3160,7 +3154,7 @@ void shadow_final_teardown(struct domain *d)
      * It is possible for a domain that never got domain_kill()ed
      * to get here with its shadow allocation intact. */
     if ( d->arch.paging.shadow.total_pages != 0 )
-        shadow_teardown(d);
+        shadow_teardown(d, NULL);
 
     /* It is now safe to pull down the p2m map. */
     p2m_teardown(p2m_get_hostp2m(d));
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index e03f983..e67c08e 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -54,7 +54,7 @@ int   hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 int   hap_enable(struct domain *d, u32 mode);
 void  hap_final_teardown(struct domain *d);
-void  hap_teardown(struct domain *d);
+void  hap_teardown(struct domain *d, int *preempted);
 void  hap_vcpu_init(struct vcpu *v);
 void  hap_logdirty_init(struct domain *d);
 int   hap_track_dirty_vram(struct domain *d,
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 348915e..8834213 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -76,7 +76,7 @@ int shadow_domctl(struct domain *d,
                   XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 
 /* Call when destroying a domain */
-void shadow_teardown(struct domain *d);
+void shadow_teardown(struct domain *d, int *preempted);
 
 /* Call once all of the references to the domain have gone away */
 void shadow_final_teardown(struct domain *d);
--
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 Oct 06 15:23:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:23: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 1ZjU5q-0003D2-N2; Tue, 06 Oct 2015 15:23:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5p-0003Ck-Gn
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:53 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	73/EA-19220-887E3165; Tue, 06 Oct 2015 15:23:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1444145031!34918377!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18646 invoked from network); 6 Oct 2015 15:23:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:23:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5m-0008RT-TR
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5m-0002G3-RC
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:23:50 +0000
Date: Tue, 06 Oct 2015 15:23:50 +0000
Message-Id: <E1ZjU5m-0002G3-RC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/mm: Make {hap,
	shadow}_teardown() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e19042ffbdf07e217c827eb0f722be5fe1623ea3
Author:     Anshul Makkar <anshul.makkar@citrix.com>
AuthorDate: Thu Sep 10 15:55:23 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:55:23 2015 +0200

    x86/mm: Make {hap, shadow}_teardown() preemptible
    
    A domain with sufficient shadow allocation can cause a watchdog timeout
    during domain destruction.  Expand the existing -EAGAIN logic in
    paging_teardown() to allow {hap/sh}_set_allocation() to become
    restartable during the DOMCTL_destroydomain hypercall.
    
    Signed-off-by: Anshul Makkar <anshul.makkar@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    master commit: 0174da5b79752e2d5d6ca0faed89536e8f3d91c7
    master date: 2015-08-06 10:04:43 +0100
---
 xen/arch/x86/mm/hap/hap.c       |   22 ++++++++--------------
 xen/arch/x86/mm/paging.c        |    9 ++++++---
 xen/arch/x86/mm/shadow/common.c |   24 +++++++++---------------
 xen/include/asm-x86/hap.h       |    2 +-
 xen/include/asm-x86/shadow.h    |    2 +-
 5 files changed, 25 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 71227ef..c06369b 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -498,7 +498,7 @@ void hap_final_teardown(struct domain *d)
     }
 
     if ( d->arch.paging.hap.total_pages != 0 )
-        hap_teardown(d);
+        hap_teardown(d, NULL);
 
     p2m_teardown(p2m_get_hostp2m(d));
     /* Free any memory that the p2m teardown released */
@@ -508,7 +508,7 @@ void hap_final_teardown(struct domain *d)
     paging_unlock(d);
 }
 
-void hap_teardown(struct domain *d)
+void hap_teardown(struct domain *d, int *preempted)
 {
     struct vcpu *v;
     mfn_t mfn;
@@ -536,18 +536,11 @@ void hap_teardown(struct domain *d)
 
     if ( d->arch.paging.hap.total_pages != 0 )
     {
-        HAP_PRINTK("teardown of domain %u starts."
-                      "  pages total = %u, free = %u, p2m=%u\n",
-                      d->domain_id,
-                      d->arch.paging.hap.total_pages,
-                      d->arch.paging.hap.free_pages,
-                      d->arch.paging.hap.p2m_pages);
-        hap_set_allocation(d, 0, NULL);
-        HAP_PRINTK("teardown done."
-                      "  pages total = %u, free = %u, p2m=%u\n",
-                      d->arch.paging.hap.total_pages,
-                      d->arch.paging.hap.free_pages,
-                      d->arch.paging.hap.p2m_pages);
+        hap_set_allocation(d, 0, preempted);
+
+        if ( preempted && *preempted )
+            goto out;
+
         ASSERT(d->arch.paging.hap.total_pages == 0);
     }
 
@@ -556,6 +549,7 @@ void hap_teardown(struct domain *d)
     xfree(d->arch.hvm_domain.dirty_vram);
     d->arch.hvm_domain.dirty_vram = NULL;
 
+out:
     paging_unlock(d);
 }
 
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index fb418fe..72555b3 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -777,12 +777,15 @@ long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 /* Call when destroying a domain */
 int paging_teardown(struct domain *d)
 {
-    int rc;
+    int rc, preempted = 0;
 
     if ( hap_enabled(d) )
-        hap_teardown(d);
+        hap_teardown(d, &preempted);
     else
-        shadow_teardown(d);
+        shadow_teardown(d, &preempted);
+
+    if ( preempted )
+        return -EAGAIN;
 
     /* clean up log dirty resources. */
     rc = paging_free_log_dirty_bitmap(d, 0);
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 3ed48c4..90ba4d6 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3031,7 +3031,7 @@ int shadow_enable(struct domain *d, u32 mode)
     return rv;
 }
 
-void shadow_teardown(struct domain *d)
+void shadow_teardown(struct domain *d, int *preempted)
 /* Destroy the shadow pagetables of this domain and free its shadow memory.
  * Should only be called for dying domains. */
 {
@@ -3092,23 +3092,16 @@ void shadow_teardown(struct domain *d)
 
     if ( d->arch.paging.shadow.total_pages != 0 )
     {
-        SHADOW_PRINTK("teardown of domain %u starts."
-                       "  Shadow pages total = %u, free = %u, p2m=%u\n",
-                       d->domain_id,
-                       d->arch.paging.shadow.total_pages, 
-                       d->arch.paging.shadow.free_pages, 
-                       d->arch.paging.shadow.p2m_pages);
         /* Destroy all the shadows and release memory to domheap */
-        sh_set_allocation(d, 0, NULL);
+        sh_set_allocation(d, 0, preempted);
+
+        if ( preempted && *preempted )
+            goto out;
+
         /* Release the hash table back to xenheap */
         if (d->arch.paging.shadow.hash_table) 
             shadow_hash_teardown(d);
-        /* Should not have any more memory held */
-        SHADOW_PRINTK("teardown done."
-                       "  Shadow pages total = %u, free = %u, p2m=%u\n",
-                       d->arch.paging.shadow.total_pages, 
-                       d->arch.paging.shadow.free_pages, 
-                       d->arch.paging.shadow.p2m_pages);
+
         ASSERT(d->arch.paging.shadow.total_pages == 0);
     }
 
@@ -3139,6 +3132,7 @@ void shadow_teardown(struct domain *d)
         d->arch.hvm_domain.dirty_vram = NULL;
     }
 
+out:
     paging_unlock(d);
 
     /* Must be called outside the lock */
@@ -3160,7 +3154,7 @@ void shadow_final_teardown(struct domain *d)
      * It is possible for a domain that never got domain_kill()ed
      * to get here with its shadow allocation intact. */
     if ( d->arch.paging.shadow.total_pages != 0 )
-        shadow_teardown(d);
+        shadow_teardown(d, NULL);
 
     /* It is now safe to pull down the p2m map. */
     p2m_teardown(p2m_get_hostp2m(d));
diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h
index e03f983..e67c08e 100644
--- a/xen/include/asm-x86/hap.h
+++ b/xen/include/asm-x86/hap.h
@@ -54,7 +54,7 @@ int   hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 int   hap_enable(struct domain *d, u32 mode);
 void  hap_final_teardown(struct domain *d);
-void  hap_teardown(struct domain *d);
+void  hap_teardown(struct domain *d, int *preempted);
 void  hap_vcpu_init(struct vcpu *v);
 void  hap_logdirty_init(struct domain *d);
 int   hap_track_dirty_vram(struct domain *d,
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 348915e..8834213 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -76,7 +76,7 @@ int shadow_domctl(struct domain *d,
                   XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 
 /* Call when destroying a domain */
-void shadow_teardown(struct domain *d);
+void shadow_teardown(struct domain *d, int *preempted);
 
 /* Call once all of the references to the domain have gone away */
 void shadow_final_teardown(struct domain *d);
--
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 Oct 06 15:24:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU60-0003Ek-Pc; Tue, 06 Oct 2015 15:24: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 1ZjU5z-0003EW-R3
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:03 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	A5/A0-01753-397E3165; Tue, 06 Oct 2015 15:24:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1444145041!18009482!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9984 invoked from network); 6 Oct 2015 15:24:02 -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;
	6 Oct 2015 15:24:02 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5x-0008Rb-8p
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5x-0002GZ-4y
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:01 +0000
Date: Tue, 06 Oct 2015 15:24:01 +0000
Message-Id: <E1ZjU5x-0002GZ-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] mm: populate_physmap: validate
	correctly the gfn for direct mapped 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 e554ae491d780435713381e43deb8356083be3ee
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Sep 10 15:56:03 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:56:03 2015 +0200

    mm: populate_physmap: validate correctly the gfn for direct mapped domain
    
    Direct mapped domain has already the memory allocated 1:1, so we are
    directly using the gfn as mfn to map the RAM in the guest.
    
    While we are validating that the page associated to the first mfn belongs to
    the domain, the subsequent MFN are not validated when the extent_order
    is > 0.
    
    This may result to map memory region (MMIO, RAM) which doesn't belong to the
    domain.
    
    Although, only DOM0 on ARM is using a direct memory mapped. So it
    doesn't affect any guest (at least on the upstream version) or even x86.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 9503ab0e9c6a41a1ee7a70c8ea9313d08ebaa8c5
    master date: 2015-08-13 14:41:09 +0200
---
 xen/common/memory.c |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 38f79b3..701c5fb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -129,22 +129,28 @@ static void populate_physmap(struct memop_args *a)
             if ( is_domain_direct_mapped(d) )
             {
                 mfn = gpfn;
-                if ( !mfn_valid(mfn) )
-                {
-                    gdprintk(XENLOG_INFO, "Invalid mfn %#"PRI_xen_pfn"\n",
-                             mfn);
-                    goto out;
-                }
 
-                page = mfn_to_page(mfn);
-                if ( !get_page(page, d) )
+                for ( j = 0; j < (1U << a->extent_order); j++, mfn++ )
                 {
-                    gdprintk(XENLOG_INFO,
-                             "mfn %#"PRI_xen_pfn" doesn't belong to the"
-                             " domain\n", mfn);
-                    goto out;
+                    if ( !mfn_valid(mfn) )
+                    {
+                        gdprintk(XENLOG_INFO, "Invalid mfn %#"PRI_xen_pfn"\n",
+                                 mfn);
+                        goto out;
+                    }
+
+                    page = mfn_to_page(mfn);
+                    if ( !get_page(page, d) )
+                    {
+                        gdprintk(XENLOG_INFO,
+                                 "mfn %#"PRI_xen_pfn" doesn't belong to the"
+                                 " domain\n", mfn);
+                        goto out;
+                    }
+                    put_page(page);
                 }
-                put_page(page);
+
+                page = mfn_to_page(gpfn);
             }
             else
                 page = alloc_domheap_pages(d, a->extent_order, a->memflags);
--
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 Oct 06 15:24:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU60-0003Ek-Pc; Tue, 06 Oct 2015 15:24: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 1ZjU5z-0003EW-R3
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:03 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	A5/A0-01753-397E3165; Tue, 06 Oct 2015 15:24:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1444145041!18009482!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9984 invoked from network); 6 Oct 2015 15:24:02 -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;
	6 Oct 2015 15:24:02 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5x-0008Rb-8p
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU5x-0002GZ-4y
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:01 +0000
Date: Tue, 06 Oct 2015 15:24:01 +0000
Message-Id: <E1ZjU5x-0002GZ-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] mm: populate_physmap: validate
	correctly the gfn for direct mapped 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 e554ae491d780435713381e43deb8356083be3ee
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Sep 10 15:56:03 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:56:03 2015 +0200

    mm: populate_physmap: validate correctly the gfn for direct mapped domain
    
    Direct mapped domain has already the memory allocated 1:1, so we are
    directly using the gfn as mfn to map the RAM in the guest.
    
    While we are validating that the page associated to the first mfn belongs to
    the domain, the subsequent MFN are not validated when the extent_order
    is > 0.
    
    This may result to map memory region (MMIO, RAM) which doesn't belong to the
    domain.
    
    Although, only DOM0 on ARM is using a direct memory mapped. So it
    doesn't affect any guest (at least on the upstream version) or even x86.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 9503ab0e9c6a41a1ee7a70c8ea9313d08ebaa8c5
    master date: 2015-08-13 14:41:09 +0200
---
 xen/common/memory.c |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 38f79b3..701c5fb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -129,22 +129,28 @@ static void populate_physmap(struct memop_args *a)
             if ( is_domain_direct_mapped(d) )
             {
                 mfn = gpfn;
-                if ( !mfn_valid(mfn) )
-                {
-                    gdprintk(XENLOG_INFO, "Invalid mfn %#"PRI_xen_pfn"\n",
-                             mfn);
-                    goto out;
-                }
 
-                page = mfn_to_page(mfn);
-                if ( !get_page(page, d) )
+                for ( j = 0; j < (1U << a->extent_order); j++, mfn++ )
                 {
-                    gdprintk(XENLOG_INFO,
-                             "mfn %#"PRI_xen_pfn" doesn't belong to the"
-                             " domain\n", mfn);
-                    goto out;
+                    if ( !mfn_valid(mfn) )
+                    {
+                        gdprintk(XENLOG_INFO, "Invalid mfn %#"PRI_xen_pfn"\n",
+                                 mfn);
+                        goto out;
+                    }
+
+                    page = mfn_to_page(mfn);
+                    if ( !get_page(page, d) )
+                    {
+                        gdprintk(XENLOG_INFO,
+                                 "mfn %#"PRI_xen_pfn" doesn't belong to the"
+                                 " domain\n", mfn);
+                        goto out;
+                    }
+                    put_page(page);
                 }
-                put_page(page);
+
+                page = mfn_to_page(gpfn);
             }
             else
                 page = alloc_domheap_pages(d, a->extent_order, a->memflags);
--
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 Oct 06 15:24:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU6B-0003HS-V4; Tue, 06 Oct 2015 15:24:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6A-0003H0-9Y
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:14 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	6C/6C-13905-D97E3165; Tue, 06 Oct 2015 15:24:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1444145051!15974455!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 20998 invoked from network); 6 Oct 2015 15:24:12 -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;
	6 Oct 2015 15:24:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU67-0008SC-JW
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU67-0002Gz-HC
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:11 +0000
Date: Tue, 06 Oct 2015 15:24:11 +0000
Message-Id: <E1ZjU67-0002Gz-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/NUMA: make init_node_heap()
	respect Xen heap limit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dbded5568e3978360bd044b13891fb81471945b7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:58:41 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:58:41 2015 +0200

    x86/NUMA: make init_node_heap() respect Xen heap limit
    
    On NUMA systems, where we try to use node local memory for the basic
    control structures of the buddy allocator, this special case needs to
    take into consideration a possible address width limit placed on the
    Xen heap. In turn this (but also other, more abstract considerations)
    requires that xenheap_max_mfn() not be called more than once (at most
    we might permit it to be called a second time with a larger value than
    was passed the first time), and be called only before calling
    end_boot_allocator().
    
    While inspecting all the involved code, a couple of off-by-one issues
    were found (and are being corrected here at once):
    - arch_init_memory() cleared one too many page table slots
    - the highmem_start based invocation of xenheap_max_mfn() passed too
      big a value
    - xenheap_max_mfn() calculated the wrong bit count in edge cases
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    xen/arm64: do not (incorrectly) limit size of xenheap
    
    The commit 88e3ed61642bb393458acc7a9bd2f96edc337190 "x86/NUMA: make
    init_node_heap() respect Xen heap limit" breaks boot on the arm64 board
    X-Gene.
    
    The xenheap bits variable is used to know the last RAM MFN always mapped
    in Xen virtual memory. If the value is 0, it means that all the memory is
    always mapped in Xen virtual memory.
    
    On X-gene the RAM bank resides above 128GB and last xenheap MFN is
    0x4400000. With the new way to calculate the number of bits, xenheap_bits
    will be equal to 38 bits. This will result to hide all the RAM and the
    impossibility to allocate xenheap memory.
    
    Given that aarch64 have always all the memory mapped in Xen virtual
    memory, it's not necessary to call xenheap_max_mfn which set the number
    of bits.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 88e3ed61642bb393458acc7a9bd2f96edc337190
    master date: 2015-09-01 14:02:57 +0200
    master commit: 0a7167d9b20cdc48e6ea320fbbb920b3267c9757
    master date: 2015-09-04 14:58:07 +0100
---
 xen/arch/arm/setup.c    |    1 -
 xen/arch/x86/mm.c       |    2 +-
 xen/arch/x86/setup.c    |   11 +++++++----
 xen/common/page_alloc.c |   24 ++++++++++++++++++------
 4 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 9480f42..d3586c6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -616,7 +616,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     xenheap_virt_end = XENHEAP_VIRT_START + ram_end - ram_start;
     xenheap_mfn_start = ram_start >> PAGE_SHIFT;
     xenheap_mfn_end = ram_end >> PAGE_SHIFT;
-    xenheap_max_mfn(xenheap_mfn_end);
 
     /*
      * Need enough mapped pages for copying the DTB.
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3f39358..f4987f9 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -379,7 +379,7 @@ void __init arch_init_memory(void)
 
                     for ( i = 0; i < l3_table_offset(split_va); ++i )
                         l3tab[i] = l3idle[i];
-                    for ( ; i <= L3_PAGETABLE_ENTRIES; ++i )
+                    for ( ; i < L3_PAGETABLE_ENTRIES; ++i )
                         l3tab[i] = l3e_empty();
                     split_l4e = l4e_from_pfn(virt_to_mfn(l3tab),
                                              __PAGE_HYPERVISOR);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a6c3fed..4f75af2 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -975,7 +975,7 @@ void __init __start_xen(unsigned long mbi_p)
 
     setup_max_pdx(raw_max_page);
     if ( highmem_start )
-        xenheap_max_mfn(PFN_DOWN(highmem_start));
+        xenheap_max_mfn(PFN_DOWN(highmem_start - 1));
 
     /*
      * Walk every RAM region and map it in its entirety (on x86/64, at least)
@@ -1156,9 +1156,6 @@ void __init __start_xen(unsigned long mbi_p)
 
     numa_initmem_init(0, raw_max_page);
 
-    end_boot_allocator();
-    system_state = SYS_STATE_boot;
-
     if ( max_page - 1 > virt_to_mfn(HYPERVISOR_VIRT_END - 1) )
     {
         unsigned long limit = virt_to_mfn(HYPERVISOR_VIRT_END - 1);
@@ -1167,6 +1164,8 @@ void __init __start_xen(unsigned long mbi_p)
         if ( !highmem_start )
             xenheap_max_mfn(limit);
 
+        end_boot_allocator();
+
         /* Pass the remaining memory to the allocator. */
         for ( i = 0; i < boot_e820.nr_map; i++ )
         {
@@ -1190,6 +1189,10 @@ void __init __start_xen(unsigned long mbi_p)
            opt_tmem = 0;
         }
     }
+    else
+        end_boot_allocator();
+
+    system_state = SYS_STATE_boot;
 
     vm_init();
     vesa_init();
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index e951a0a..5ca38be 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -388,13 +388,19 @@ void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages)
     spin_unlock(&heap_lock);
 }
 
+static bool_t __read_mostly first_node_initialised;
+#ifndef CONFIG_SEPARATE_XENHEAP
+static unsigned int __read_mostly xenheap_bits;
+#else
+#define xenheap_bits 0
+#endif
+
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
 {
     /* First node to be discovered has its heap metadata statically alloced. */
     static heap_by_zone_and_order_t _heap_static;
     static unsigned long avail_static[NR_ZONES];
-    static int first_node_initialised;
     unsigned long needed = (sizeof(**_heap) +
                             sizeof(**avail) * NR_ZONES +
                             PAGE_SIZE - 1) >> PAGE_SHIFT;
@@ -412,14 +418,18 @@ static unsigned long init_node_heap(int node, unsigned long mfn,
     }
 #ifdef DIRECTMAP_VIRT_END
     else if ( *use_tail && nr >= needed &&
-              (mfn + nr) <= (virt_to_mfn(eva - 1) + 1) )
+              (mfn + nr) <= (virt_to_mfn(eva - 1) + 1) &&
+              (!xenheap_bits ||
+               !((mfn + nr - 1) >> (xenheap_bits - PAGE_SHIFT))) )
     {
         _heap[node] = mfn_to_virt(mfn + nr - needed);
         avail[node] = mfn_to_virt(mfn + nr - 1) +
                       PAGE_SIZE - sizeof(**avail) * NR_ZONES;
     }
     else if ( nr >= needed &&
-              (mfn + needed) <= (virt_to_mfn(eva - 1) + 1) )
+              (mfn + needed) <= (virt_to_mfn(eva - 1) + 1) &&
+              (!xenheap_bits ||
+               !((mfn + needed - 1) >> (xenheap_bits - PAGE_SHIFT))) )
     {
         _heap[node] = mfn_to_virt(mfn);
         avail[node] = mfn_to_virt(mfn + needed - 1) +
@@ -1363,11 +1373,13 @@ void free_xenheap_pages(void *v, unsigned int order)
 
 #else
 
-static unsigned int __read_mostly xenheap_bits;
-
 void __init xenheap_max_mfn(unsigned long mfn)
 {
-    xenheap_bits = fls(mfn) + PAGE_SHIFT;
+    ASSERT(!first_node_initialised);
+    ASSERT(!xenheap_bits);
+    BUILD_BUG_ON(PADDR_BITS >= BITS_PER_LONG);
+    xenheap_bits = min(fls(mfn + 1) - 1 + PAGE_SHIFT, PADDR_BITS);
+    printk(XENLOG_INFO "Xen heap: %u bits\n", xenheap_bits);
 }
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
--
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 Oct 06 15:24:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU6B-0003HS-V4; Tue, 06 Oct 2015 15:24:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6A-0003H0-9Y
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:14 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	6C/6C-13905-D97E3165; Tue, 06 Oct 2015 15:24:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1444145051!15974455!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 20998 invoked from network); 6 Oct 2015 15:24:12 -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;
	6 Oct 2015 15:24:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU67-0008SC-JW
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU67-0002Gz-HC
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:11 +0000
Date: Tue, 06 Oct 2015 15:24:11 +0000
Message-Id: <E1ZjU67-0002Gz-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/NUMA: make init_node_heap()
	respect Xen heap limit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dbded5568e3978360bd044b13891fb81471945b7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Sep 10 15:58:41 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Sep 10 15:58:41 2015 +0200

    x86/NUMA: make init_node_heap() respect Xen heap limit
    
    On NUMA systems, where we try to use node local memory for the basic
    control structures of the buddy allocator, this special case needs to
    take into consideration a possible address width limit placed on the
    Xen heap. In turn this (but also other, more abstract considerations)
    requires that xenheap_max_mfn() not be called more than once (at most
    we might permit it to be called a second time with a larger value than
    was passed the first time), and be called only before calling
    end_boot_allocator().
    
    While inspecting all the involved code, a couple of off-by-one issues
    were found (and are being corrected here at once):
    - arch_init_memory() cleared one too many page table slots
    - the highmem_start based invocation of xenheap_max_mfn() passed too
      big a value
    - xenheap_max_mfn() calculated the wrong bit count in edge cases
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    xen/arm64: do not (incorrectly) limit size of xenheap
    
    The commit 88e3ed61642bb393458acc7a9bd2f96edc337190 "x86/NUMA: make
    init_node_heap() respect Xen heap limit" breaks boot on the arm64 board
    X-Gene.
    
    The xenheap bits variable is used to know the last RAM MFN always mapped
    in Xen virtual memory. If the value is 0, it means that all the memory is
    always mapped in Xen virtual memory.
    
    On X-gene the RAM bank resides above 128GB and last xenheap MFN is
    0x4400000. With the new way to calculate the number of bits, xenheap_bits
    will be equal to 38 bits. This will result to hide all the RAM and the
    impossibility to allocate xenheap memory.
    
    Given that aarch64 have always all the memory mapped in Xen virtual
    memory, it's not necessary to call xenheap_max_mfn which set the number
    of bits.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 88e3ed61642bb393458acc7a9bd2f96edc337190
    master date: 2015-09-01 14:02:57 +0200
    master commit: 0a7167d9b20cdc48e6ea320fbbb920b3267c9757
    master date: 2015-09-04 14:58:07 +0100
---
 xen/arch/arm/setup.c    |    1 -
 xen/arch/x86/mm.c       |    2 +-
 xen/arch/x86/setup.c    |   11 +++++++----
 xen/common/page_alloc.c |   24 ++++++++++++++++++------
 4 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 9480f42..d3586c6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -616,7 +616,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     xenheap_virt_end = XENHEAP_VIRT_START + ram_end - ram_start;
     xenheap_mfn_start = ram_start >> PAGE_SHIFT;
     xenheap_mfn_end = ram_end >> PAGE_SHIFT;
-    xenheap_max_mfn(xenheap_mfn_end);
 
     /*
      * Need enough mapped pages for copying the DTB.
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3f39358..f4987f9 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -379,7 +379,7 @@ void __init arch_init_memory(void)
 
                     for ( i = 0; i < l3_table_offset(split_va); ++i )
                         l3tab[i] = l3idle[i];
-                    for ( ; i <= L3_PAGETABLE_ENTRIES; ++i )
+                    for ( ; i < L3_PAGETABLE_ENTRIES; ++i )
                         l3tab[i] = l3e_empty();
                     split_l4e = l4e_from_pfn(virt_to_mfn(l3tab),
                                              __PAGE_HYPERVISOR);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a6c3fed..4f75af2 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -975,7 +975,7 @@ void __init __start_xen(unsigned long mbi_p)
 
     setup_max_pdx(raw_max_page);
     if ( highmem_start )
-        xenheap_max_mfn(PFN_DOWN(highmem_start));
+        xenheap_max_mfn(PFN_DOWN(highmem_start - 1));
 
     /*
      * Walk every RAM region and map it in its entirety (on x86/64, at least)
@@ -1156,9 +1156,6 @@ void __init __start_xen(unsigned long mbi_p)
 
     numa_initmem_init(0, raw_max_page);
 
-    end_boot_allocator();
-    system_state = SYS_STATE_boot;
-
     if ( max_page - 1 > virt_to_mfn(HYPERVISOR_VIRT_END - 1) )
     {
         unsigned long limit = virt_to_mfn(HYPERVISOR_VIRT_END - 1);
@@ -1167,6 +1164,8 @@ void __init __start_xen(unsigned long mbi_p)
         if ( !highmem_start )
             xenheap_max_mfn(limit);
 
+        end_boot_allocator();
+
         /* Pass the remaining memory to the allocator. */
         for ( i = 0; i < boot_e820.nr_map; i++ )
         {
@@ -1190,6 +1189,10 @@ void __init __start_xen(unsigned long mbi_p)
            opt_tmem = 0;
         }
     }
+    else
+        end_boot_allocator();
+
+    system_state = SYS_STATE_boot;
 
     vm_init();
     vesa_init();
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index e951a0a..5ca38be 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -388,13 +388,19 @@ void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages)
     spin_unlock(&heap_lock);
 }
 
+static bool_t __read_mostly first_node_initialised;
+#ifndef CONFIG_SEPARATE_XENHEAP
+static unsigned int __read_mostly xenheap_bits;
+#else
+#define xenheap_bits 0
+#endif
+
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
 {
     /* First node to be discovered has its heap metadata statically alloced. */
     static heap_by_zone_and_order_t _heap_static;
     static unsigned long avail_static[NR_ZONES];
-    static int first_node_initialised;
     unsigned long needed = (sizeof(**_heap) +
                             sizeof(**avail) * NR_ZONES +
                             PAGE_SIZE - 1) >> PAGE_SHIFT;
@@ -412,14 +418,18 @@ static unsigned long init_node_heap(int node, unsigned long mfn,
     }
 #ifdef DIRECTMAP_VIRT_END
     else if ( *use_tail && nr >= needed &&
-              (mfn + nr) <= (virt_to_mfn(eva - 1) + 1) )
+              (mfn + nr) <= (virt_to_mfn(eva - 1) + 1) &&
+              (!xenheap_bits ||
+               !((mfn + nr - 1) >> (xenheap_bits - PAGE_SHIFT))) )
     {
         _heap[node] = mfn_to_virt(mfn + nr - needed);
         avail[node] = mfn_to_virt(mfn + nr - 1) +
                       PAGE_SIZE - sizeof(**avail) * NR_ZONES;
     }
     else if ( nr >= needed &&
-              (mfn + needed) <= (virt_to_mfn(eva - 1) + 1) )
+              (mfn + needed) <= (virt_to_mfn(eva - 1) + 1) &&
+              (!xenheap_bits ||
+               !((mfn + needed - 1) >> (xenheap_bits - PAGE_SHIFT))) )
     {
         _heap[node] = mfn_to_virt(mfn);
         avail[node] = mfn_to_virt(mfn + needed - 1) +
@@ -1363,11 +1373,13 @@ void free_xenheap_pages(void *v, unsigned int order)
 
 #else
 
-static unsigned int __read_mostly xenheap_bits;
-
 void __init xenheap_max_mfn(unsigned long mfn)
 {
-    xenheap_bits = fls(mfn) + PAGE_SHIFT;
+    ASSERT(!first_node_initialised);
+    ASSERT(!xenheap_bits);
+    BUILD_BUG_ON(PADDR_BITS >= BITS_PER_LONG);
+    xenheap_bits = min(fls(mfn + 1) - 1 + PAGE_SHIFT, PADDR_BITS);
+    printk(XENLOG_INFO "Xen heap: %u bits\n", xenheap_bits);
 }
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
--
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 Oct 06 15:24:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU6L-0003LL-Kw; Tue, 06 Oct 2015 15:24:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6K-0003Kd-6c
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:24 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	86/B7-21201-7A7E3165; Tue, 06 Oct 2015 15:24:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1444145062!46402026!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11961 invoked from network); 6 Oct 2015 15:24:22 -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;
	6 Oct 2015 15:24:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6H-0008SK-SV
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6H-0002HM-Qm
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:21 +0000
Date: Tue, 06 Oct 2015 15:24:21 +0000
Message-Id: <E1ZjU6H-0002HM-Qm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] 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 515d2e33913785273c7908519d31914507448b2b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Sep 11 11:51:06 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:51:06 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index 5024398..695e207 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.4.3
-# Wed Jun 3 14:41:27 2015 +0200
-# ide: Clear DRQ after handling all expected accesses
+QEMU_TAG ?= 5ae0569d964ad1a6d8dc781e5566d39210a5d063
+# Mon Jun 30 10:07:54 2014 +0200
+# vnc: limit client_cut_text msg payload size
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#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 Oct 06 15:24:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU6L-0003LL-Kw; Tue, 06 Oct 2015 15:24:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6K-0003Kd-6c
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:24 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	86/B7-21201-7A7E3165; Tue, 06 Oct 2015 15:24:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1444145062!46402026!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11961 invoked from network); 6 Oct 2015 15:24:22 -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;
	6 Oct 2015 15:24:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6H-0008SK-SV
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6H-0002HM-Qm
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:21 +0000
Date: Tue, 06 Oct 2015 15:24:21 +0000
Message-Id: <E1ZjU6H-0002HM-Qm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] 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 515d2e33913785273c7908519d31914507448b2b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Sep 11 11:51:06 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:51:06 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index 5024398..695e207 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.4.3
-# Wed Jun 3 14:41:27 2015 +0200
-# ide: Clear DRQ after handling all expected accesses
+QEMU_TAG ?= 5ae0569d964ad1a6d8dc781e5566d39210a5d063
+# Mon Jun 30 10:07:54 2014 +0200
+# vnc: limit client_cut_text msg payload size
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#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 Oct 06 15:24:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU6V-0003OJ-Nb; Tue, 06 Oct 2015 15:24: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 1ZjU6U-0003Nz-L9
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:34 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	24/0D-12889-2B7E3165; Tue, 06 Oct 2015 15:24:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444145072!56202979!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5263 invoked from network); 6 Oct 2015 15:24:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:24:33 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6S-0008SS-71
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6S-0002IS-4i
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:32 +0000
Date: Tue, 06 Oct 2015 15:24:32 +0000
Message-Id: <E1ZjU6S-0002IS-4i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xl: correct handling of
	extra_config 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 213e243819ba5f72e13afad41ce2f5df17715530
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jul 14 17:41:10 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:53:23 2015 +0100

    xl: correct handling of extra_config in main_cpupoolcreate
    
    Don't dereference extra_config if it's NULL. Don't leak extra_config in
    the end.
    
    Also fixed a typo in error string while I was there.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 705c9e12426cba82804cb578fc70785281655d94)
    (cherry picked from commit ffb4e6387f489b6b5ce287f51db43cb37ebae064)
---
 tools/libxl/xl_cmdimpl.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index f5c8656..521b0b5 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6637,9 +6637,9 @@ int main_cpupoolcreate(int argc, char **argv)
     else
         config_src="command line";
 
-    if (strlen(extra_config)) {
+    if (extra_config && strlen(extra_config)) {
         if (config_len > INT_MAX - (strlen(extra_config) + 2)) {
-            fprintf(stderr, "Failed to attach extra configration\n");
+            fprintf(stderr, "Failed to attach extra configuration\n");
             goto out;
         }
         config_data = xrealloc(config_data,
@@ -6762,6 +6762,7 @@ out_cfg:
     xlu_cfg_destroy(config);
 out:
     free(config_data);
+    free(extra_config);
     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 Oct 06 15:24:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU6V-0003OJ-Nb; Tue, 06 Oct 2015 15:24: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 1ZjU6U-0003Nz-L9
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:34 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	24/0D-12889-2B7E3165; Tue, 06 Oct 2015 15:24:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444145072!56202979!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5263 invoked from network); 6 Oct 2015 15:24:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:24:33 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6S-0008SS-71
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6S-0002IS-4i
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:32 +0000
Date: Tue, 06 Oct 2015 15:24:32 +0000
Message-Id: <E1ZjU6S-0002IS-4i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xl: correct handling of
	extra_config 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 213e243819ba5f72e13afad41ce2f5df17715530
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jul 14 17:41:10 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:53:23 2015 +0100

    xl: correct handling of extra_config in main_cpupoolcreate
    
    Don't dereference extra_config if it's NULL. Don't leak extra_config in
    the end.
    
    Also fixed a typo in error string while I was there.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 705c9e12426cba82804cb578fc70785281655d94)
    (cherry picked from commit ffb4e6387f489b6b5ce287f51db43cb37ebae064)
---
 tools/libxl/xl_cmdimpl.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index f5c8656..521b0b5 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6637,9 +6637,9 @@ int main_cpupoolcreate(int argc, char **argv)
     else
         config_src="command line";
 
-    if (strlen(extra_config)) {
+    if (extra_config && strlen(extra_config)) {
         if (config_len > INT_MAX - (strlen(extra_config) + 2)) {
-            fprintf(stderr, "Failed to attach extra configration\n");
+            fprintf(stderr, "Failed to attach extra configuration\n");
             goto out;
         }
         config_data = xrealloc(config_data,
@@ -6762,6 +6762,7 @@ out_cfg:
     xlu_cfg_destroy(config);
 out:
     free(config_data);
+    free(extra_config);
     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 Oct 06 15:24:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU6g-0003R4-6E; Tue, 06 Oct 2015 15:24:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6e-0003QD-Ne
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:44 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	B1/DC-06179-CB7E3165; Tue, 06 Oct 2015 15:24:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1444145082!40348130!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 19133 invoked from network); 6 Oct 2015 15:24:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:24:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6c-0008Sf-KL
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6c-0002Ip-GA
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:42 +0000
Date: Tue, 06 Oct 2015 15:24:42 +0000
Message-Id: <E1ZjU6c-0002Ip-GA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: Increase device model
	startup timeout to 1min.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe66a76a2d6e30f2cd3aea6b2c8cb41f20ca6ea2
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Tue Jul 7 16:09:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 18 16:29:47 2015 +0100

    libxl: Increase device model startup timeout to 1min.
    
    On a busy host, QEMU may take more than 10s to load and start.
    
    This is likely due to a bug in Linux where the I/O subsystem sometime
    produce high latency under load and result in QEMU taking a long time to
    load every single dynamic libraries.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 9acfbe14d7261b03e3b3f4dc3c850ba2a7093e1f)
    
    Conflicts:
    	tools/libxl/libxl_internal.h
    (cherry picked from commit bbbd29a25d090f1180d14210358c6d7ccdebef85)
---
 tools/libxl/libxl_internal.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 798b68d..f6d469b 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -83,7 +83,9 @@
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 10
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+/* 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_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
 #define LIBXL_XENCONSOLE_PROTOCOL "vt100"
--
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 Oct 06 15:24:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:24: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 1ZjU6g-0003R4-6E; Tue, 06 Oct 2015 15:24:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6e-0003QD-Ne
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:44 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	B1/DC-06179-CB7E3165; Tue, 06 Oct 2015 15:24:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1444145082!40348130!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 19133 invoked from network); 6 Oct 2015 15:24:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2015 15:24:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6c-0008Sf-KL
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6c-0002Ip-GA
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:42 +0000
Date: Tue, 06 Oct 2015 15:24:42 +0000
Message-Id: <E1ZjU6c-0002Ip-GA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: Increase device model
	startup timeout to 1min.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe66a76a2d6e30f2cd3aea6b2c8cb41f20ca6ea2
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Tue Jul 7 16:09:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 18 16:29:47 2015 +0100

    libxl: Increase device model startup timeout to 1min.
    
    On a busy host, QEMU may take more than 10s to load and start.
    
    This is likely due to a bug in Linux where the I/O subsystem sometime
    produce high latency under load and result in QEMU taking a long time to
    load every single dynamic libraries.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 9acfbe14d7261b03e3b3f4dc3c850ba2a7093e1f)
    
    Conflicts:
    	tools/libxl/libxl_internal.h
    (cherry picked from commit bbbd29a25d090f1180d14210358c6d7ccdebef85)
---
 tools/libxl/libxl_internal.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 798b68d..f6d469b 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -83,7 +83,9 @@
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 10
-#define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
+/* 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_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
 #define LIBXL_XENCONSOLE_PROTOCOL "vt100"
--
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 Oct 06 15:25:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:25:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjU6u-0003a9-GJ; Tue, 06 Oct 2015 15:25: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 1ZjU6t-0003Wd-7H
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:59 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	02/96-01143-6C7E3165; Tue, 06 Oct 2015 15:24:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1444145093!37443026!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9862 invoked from network); 6 Oct 2015 15:24:53 -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;
	6 Oct 2015 15:24:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6m-0008Ss-V0
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6m-0002JC-Se
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:52 +0000
Date: Tue, 06 Oct 2015 15:24:52 +0000
Message-Id: <E1ZjU6m-0002JC-Se@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: handle read-only drives
	with qemu-xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d99a76cfeba6d23504121a51e7750f230128d85
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Sep 22 16:56:29 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Sep 22 16:56:29 2015 +0100

    libxl: handle read-only drives with qemu-xen
    
    The current libxl code doesn't deal with read-only drives at all.
    
    Upstream QEMU and qemu-xen only support read-only cdrom drives: make
    sure to specify "readonly=on" for cdrom drives and return error in case
    the user requested a non-cdrom read-only drive.
    
    This is XSA-142, discovered by Lin Liu
    (https://bugzilla.redhat.com/show_bug.cgi?id=1257893).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    
    Backport to Xen 4.5 and earlier, apropos of report and review from
    Michael Young.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d7d2d3b..d7e199f 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -708,13 +708,18 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             if (disks[i].is_cdrom) {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
                     drive = libxl__sprintf
-                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback,id=ide-%i",
-                         disk, dev_number);
+                        (gc, "if=ide,index=%d,readonly=%s,media=cdrom,cache=writeback,id=ide-%i",
+                         disk, disks[i].readwrite ? "off" : "on", dev_number);
                 else
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback,id=ide-%i",
-                         disks[i].pdev_path, disk, format, dev_number);
+                        (gc, "file=%s,if=ide,index=%d,readonly=%s,media=cdrom,format=%s,cache=writeback,id=ide-%i",
+                         disks[i].pdev_path, disk, disks[i].readwrite ? "off" : "on", format, dev_number);
             } else {
+                if (!disks[i].readwrite) {
+                    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "qemu-xen doesn't support read-only disk drivers");
+                    return NULL;
+                }
+
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
                     LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "cannot support"
                                " empty disk format for %s", disks[i].vdev);
--
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 Oct 06 15:25:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2015 15:25:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjU6u-0003a9-GJ; Tue, 06 Oct 2015 15:25: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 1ZjU6t-0003Wd-7H
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:59 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	02/96-01143-6C7E3165; Tue, 06 Oct 2015 15:24:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1444145093!37443026!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9862 invoked from network); 6 Oct 2015 15:24:53 -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;
	6 Oct 2015 15:24:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6m-0008Ss-V0
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjU6m-0002JC-Se
	for xen-changelog@lists.xensource.com; Tue, 06 Oct 2015 15:24:52 +0000
Date: Tue, 06 Oct 2015 15:24:52 +0000
Message-Id: <E1ZjU6m-0002JC-Se@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: handle read-only drives
	with qemu-xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d99a76cfeba6d23504121a51e7750f230128d85
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Sep 22 16:56:29 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Sep 22 16:56:29 2015 +0100

    libxl: handle read-only drives with qemu-xen
    
    The current libxl code doesn't deal with read-only drives at all.
    
    Upstream QEMU and qemu-xen only support read-only cdrom drives: make
    sure to specify "readonly=on" for cdrom drives and return error in case
    the user requested a non-cdrom read-only drive.
    
    This is XSA-142, discovered by Lin Liu
    (https://bugzilla.redhat.com/show_bug.cgi?id=1257893).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    
    Backport to Xen 4.5 and earlier, apropos of report and review from
    Michael Young.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d7d2d3b..d7e199f 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -708,13 +708,18 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             if (disks[i].is_cdrom) {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
                     drive = libxl__sprintf
-                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback,id=ide-%i",
-                         disk, dev_number);
+                        (gc, "if=ide,index=%d,readonly=%s,media=cdrom,cache=writeback,id=ide-%i",
+                         disk, disks[i].readwrite ? "off" : "on", dev_number);
                 else
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback,id=ide-%i",
-                         disks[i].pdev_path, disk, format, dev_number);
+                        (gc, "file=%s,if=ide,index=%d,readonly=%s,media=cdrom,format=%s,cache=writeback,id=ide-%i",
+                         disks[i].pdev_path, disk, disks[i].readwrite ? "off" : "on", format, dev_number);
             } else {
+                if (!disks[i].readwrite) {
+                    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "qemu-xen doesn't support read-only disk drivers");
+                    return NULL;
+                }
+
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
                     LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "cannot support"
                                " empty disk format for %s", disks[i].vdev);
--
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 Oct 07 01:55:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdwn-0006G5-AU; Wed, 07 Oct 2015 01:55:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwm-0006G0-MN
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:12 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	B6/90-24856-08B74165; Wed, 07 Oct 2015 01:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1444182909!40396332!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22323 invoked from network); 7 Oct 2015 01:55:10 -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;
	7 Oct 2015 01:55:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwf-00054u-NU
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwd-0004Lc-KX
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:04 +0000
Date: Wed, 07 Oct 2015 01:55:03 +0000
Message-Id: <E1Zjdwd-0004Lc-KX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] credit1: fix tickling when it
	happens from a remote pCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d4f7d759cf5e3fe4379f54399535b06396201c6
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Oct 2 13:52:26 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:52:26 2015 +0200

    credit1: fix tickling when it happens from a remote pCPU
    
    especially if that is also from a different cpupool than the
    processor of the vCPU that triggered the tickling.
    
    In fact, it is possible that we get as far as calling vcpu_unblock()-->
    vcpu_wake()-->csched_vcpu_wake()-->__runq_tickle() for the vCPU 'vc',
    but all while running on a pCPU that is different from 'vc->processor'.
    
    For instance, this can happen when an HVM domain runs in a cpupool,
    with a different scheduler than the default one, and issues IOREQs
    to Dom0, running in Pool-0 with the default scheduler.
    In fact, right in this case, the following crash can be observed:
    
    (XEN) ----[ Xen-4.7-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    7
    (XEN) RIP:    e008:[<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN) RFLAGS: 0000000000010086   CONTEXT: hypervisor (d1v0)
    (XEN) rax: 0000000000000001   rbx: ffff8303184fee00   rcx: 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen stack trace from rsp=ffff83031fa57a08:
    (XEN)    ffff82d0801fe664 ffff82d08033c820 0000000100000002 0000000a00000001
    (XEN)    0000000000006831 0000000000000000 0000000000000000 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN)    [<ffff82d08012348a>] csched_vcpu_wake+0x10b/0x110
    (XEN)    [<ffff82d08012b421>] vcpu_wake+0x20a/0x3ce
    (XEN)    [<ffff82d08012b91c>] vcpu_unblock+0x4b/0x4e
    (XEN)    [<ffff82d080167bd0>] vcpu_kick+0x17/0x61
    (XEN)    [<ffff82d080167c46>] vcpu_mark_events_pending+0x2c/0x2f
    (XEN)    [<ffff82d08010ac35>] evtchn_fifo_set_pending+0x381/0x3f6
    (XEN)    [<ffff82d08010a0f6>] notify_via_xen_event_channel+0xc9/0xd6
    (XEN)    [<ffff82d0801c29ed>] hvm_send_ioreq+0x3e9/0x441
    (XEN)    [<ffff82d0801bba7d>] hvmemul_do_io+0x23f/0x2d2
    (XEN)    [<ffff82d0801bbb43>] hvmemul_do_io_buffer+0x33/0x64
    (XEN)    [<ffff82d0801bc92b>] hvmemul_do_pio_buffer+0x35/0x37
    (XEN)    [<ffff82d0801cc49f>] handle_pio+0x58/0x14c
    (XEN)    [<ffff82d0801eabcb>] vmx_vmexit_handler+0x16b3/0x1bea
    (XEN)    [<ffff82d0801efd21>] vmx_asm_vmexit_handler+0x41/0xc0
    
    In this case, pCPU 7 is not in Pool-0, while the (Dom0's) vCPU being
    woken is. pCPU's 7 pool has a different scheduler than credit, but it
    is, however, right from pCPU 7 that we are waking the Dom0's vCPUs.
    Therefore, the current code tries to access csched_balance_mask for
    pCPU 7, but that is not defined, and hence the Oops.
    
    (Note that, in case the two pools run the same scheduler we see no
    Oops, but things are still conceptually wrong.)
    
    Cure things by making the csched_balance_mask macro accept a
    parameter for fetching a specific pCPU's mask (instead than always
    using smp_processor_id()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: ea5637968a09a81a64fa5fd73ce49b4ea9789e12
    master date: 2015-09-30 14:44:22 +0200
---
 xen/common/sched_credit.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index a1945ac..57967c1 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -171,10 +171,10 @@ struct csched_pcpu {
  * Convenience macro for accessing the per-PCPU cpumask we need for
  * implementing the two steps (soft and hard affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
- * as there is a csched_pcpu for each PCPU and we always hold the
- * runqueue spin-lock when using this.
+ * as there is a csched_pcpu for each PCPU, and we always hold the
+ * runqueue lock for the proper PCPU when using this.
  */
-#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+#define csched_balance_mask(c) (CSCHED_PCPU(c)->balance_mask)
 
 /*
  * Virtual CPU
@@ -412,9 +412,10 @@ __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(csched_balance_mask, csched_balance_mask, &idle_mask);
-            new_idlers_empty = cpumask_empty(csched_balance_mask);
+                                   csched_balance_mask(cpu));
+            cpumask_and(csched_balance_mask(cpu),
+                        csched_balance_mask(cpu), &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask(cpu));
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1491,8 +1492,9 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
                  && !__vcpu_has_soft_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
-            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
-            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask(cpu));
+            if ( __csched_vcpu_is_migrateable(vc, cpu,
+                                              csched_balance_mask(cpu)) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdwn-0006G5-AU; Wed, 07 Oct 2015 01:55:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwm-0006G0-MN
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:12 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	B6/90-24856-08B74165; Wed, 07 Oct 2015 01:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1444182909!40396332!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22323 invoked from network); 7 Oct 2015 01:55:10 -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;
	7 Oct 2015 01:55:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwf-00054u-NU
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwd-0004Lc-KX
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:04 +0000
Date: Wed, 07 Oct 2015 01:55:03 +0000
Message-Id: <E1Zjdwd-0004Lc-KX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] credit1: fix tickling when it
	happens from a remote pCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d4f7d759cf5e3fe4379f54399535b06396201c6
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Oct 2 13:52:26 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:52:26 2015 +0200

    credit1: fix tickling when it happens from a remote pCPU
    
    especially if that is also from a different cpupool than the
    processor of the vCPU that triggered the tickling.
    
    In fact, it is possible that we get as far as calling vcpu_unblock()-->
    vcpu_wake()-->csched_vcpu_wake()-->__runq_tickle() for the vCPU 'vc',
    but all while running on a pCPU that is different from 'vc->processor'.
    
    For instance, this can happen when an HVM domain runs in a cpupool,
    with a different scheduler than the default one, and issues IOREQs
    to Dom0, running in Pool-0 with the default scheduler.
    In fact, right in this case, the following crash can be observed:
    
    (XEN) ----[ Xen-4.7-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    7
    (XEN) RIP:    e008:[<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN) RFLAGS: 0000000000010086   CONTEXT: hypervisor (d1v0)
    (XEN) rax: 0000000000000001   rbx: ffff8303184fee00   rcx: 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen stack trace from rsp=ffff83031fa57a08:
    (XEN)    ffff82d0801fe664 ffff82d08033c820 0000000100000002 0000000a00000001
    (XEN)    0000000000006831 0000000000000000 0000000000000000 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN)    [<ffff82d08012348a>] csched_vcpu_wake+0x10b/0x110
    (XEN)    [<ffff82d08012b421>] vcpu_wake+0x20a/0x3ce
    (XEN)    [<ffff82d08012b91c>] vcpu_unblock+0x4b/0x4e
    (XEN)    [<ffff82d080167bd0>] vcpu_kick+0x17/0x61
    (XEN)    [<ffff82d080167c46>] vcpu_mark_events_pending+0x2c/0x2f
    (XEN)    [<ffff82d08010ac35>] evtchn_fifo_set_pending+0x381/0x3f6
    (XEN)    [<ffff82d08010a0f6>] notify_via_xen_event_channel+0xc9/0xd6
    (XEN)    [<ffff82d0801c29ed>] hvm_send_ioreq+0x3e9/0x441
    (XEN)    [<ffff82d0801bba7d>] hvmemul_do_io+0x23f/0x2d2
    (XEN)    [<ffff82d0801bbb43>] hvmemul_do_io_buffer+0x33/0x64
    (XEN)    [<ffff82d0801bc92b>] hvmemul_do_pio_buffer+0x35/0x37
    (XEN)    [<ffff82d0801cc49f>] handle_pio+0x58/0x14c
    (XEN)    [<ffff82d0801eabcb>] vmx_vmexit_handler+0x16b3/0x1bea
    (XEN)    [<ffff82d0801efd21>] vmx_asm_vmexit_handler+0x41/0xc0
    
    In this case, pCPU 7 is not in Pool-0, while the (Dom0's) vCPU being
    woken is. pCPU's 7 pool has a different scheduler than credit, but it
    is, however, right from pCPU 7 that we are waking the Dom0's vCPUs.
    Therefore, the current code tries to access csched_balance_mask for
    pCPU 7, but that is not defined, and hence the Oops.
    
    (Note that, in case the two pools run the same scheduler we see no
    Oops, but things are still conceptually wrong.)
    
    Cure things by making the csched_balance_mask macro accept a
    parameter for fetching a specific pCPU's mask (instead than always
    using smp_processor_id()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: ea5637968a09a81a64fa5fd73ce49b4ea9789e12
    master date: 2015-09-30 14:44:22 +0200
---
 xen/common/sched_credit.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index a1945ac..57967c1 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -171,10 +171,10 @@ struct csched_pcpu {
  * Convenience macro for accessing the per-PCPU cpumask we need for
  * implementing the two steps (soft and hard affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
- * as there is a csched_pcpu for each PCPU and we always hold the
- * runqueue spin-lock when using this.
+ * as there is a csched_pcpu for each PCPU, and we always hold the
+ * runqueue lock for the proper PCPU when using this.
  */
-#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+#define csched_balance_mask(c) (CSCHED_PCPU(c)->balance_mask)
 
 /*
  * Virtual CPU
@@ -412,9 +412,10 @@ __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(csched_balance_mask, csched_balance_mask, &idle_mask);
-            new_idlers_empty = cpumask_empty(csched_balance_mask);
+                                   csched_balance_mask(cpu));
+            cpumask_and(csched_balance_mask(cpu),
+                        csched_balance_mask(cpu), &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask(cpu));
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1491,8 +1492,9 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
                  && !__vcpu_has_soft_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
-            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
-            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask(cpu));
+            if ( __csched_vcpu_is_migrateable(vc, cpu,
+                                              csched_balance_mask(cpu)) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdwx-0006Gk-EI; Wed, 07 Oct 2015 01:55:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdww-0006Gd-Pa
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:22 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	4D/6E-25435-A8B74165; Wed, 07 Oct 2015 01:55:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1444182919!56265244!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 1075 invoked from network); 7 Oct 2015 01:55:20 -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;
	7 Oct 2015 01:55:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwt-00055P-Il
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwt-0004MK-G6
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:19 +0000
Date: Wed, 07 Oct 2015 01:55:19 +0000
Message-Id: <E1Zjdwt-0004MK-G6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/EPT: work around hardware
	erratum setting A bit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9204673fc60f606ec2b280a377e69d7fceedf5d6
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Fri Oct 2 13:53:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:53:27 2015 +0200

    x86/EPT: work around hardware erratum setting A bit
    
    Since commit 191b3f3344ee ("p2m/ept: enable PML in p2m-ept for
    log-dirty"), the A and D bits of EPT paging entries are set
    unconditionally, regardless of whether PML is enabled or not. This
    causes a regression in Xen 4.6 on some processors due to Intel Errata
    AVR41 -- HVM guests get severe memory corruption when the A bit is set
    due to incorrect TLB flushing on mov to cr3. The erratum affects the
    Atom C2000 family (Avoton).
    
    To fix, do not set the A bit on this processor family.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    
    Move feature suppression to feature detection code. Add command line
    override.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 33b55dc10342570aad77bd2fa221189df0ebca4e
    master date: 2015-10-02 13:39:12 +0200
---
 docs/misc/xen-command-line.markdown |   27 ++++++++++++++++++---------
 xen/arch/x86/hvm/vmx/vmcs.c         |   11 +++++++++++
 xen/arch/x86/mm/p2m-ept.c           |   16 ++++++++--------
 xen/include/asm-x86/hvm/vmx/vmx.h   |    1 +
 4 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a2e427c..a565c1b 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -705,19 +705,28 @@ virtualization, to allow the L1 hypervisor to use EPT even if the L0 hypervisor
 does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT.
 
 ### ept (Intel)
-> `= List of ( pml<boolean> )`
+> `= List of ( {no-}pml | {no-}ad )`
+
+Controls EPT related features.
+
+> Sub-options:
+
+> `pml`
 
 > Default: `false`
 
-Controls EPT related features. Currently only Page Modification Logging (PML) is
-the controllable feature as boolean type.
+>> PML is a new hardware feature in Intel's Broadwell Server and further
+>> platforms which reduces hypervisor overhead of log-dirty mechanism by
+>> automatically recording GPAs (guest physical addresses) when guest memory
+>> gets dirty, and therefore significantly reducing number of EPT violation
+>> caused by write protection of guest memory, which is a necessity to
+>> implement log-dirty mechanism before PML.
+
+> `ad`
+
+> Default: Hardware dependent
 
-PML is a new hardware feature in Intel's Broadwell Server and further platforms
-which reduces hypervisor overhead of log-dirty mechanism by automatically
-recording GPAs (guest physical addresses) when guest memory gets dirty, and
-therefore significantly reducing number of EPT violation caused by write
-protection of guest memory, which is a necessity to implement log-dirty
-mechanism before PML.
+>> Have hardware keep accessed/dirty (A/D) bits updated.
 
 ### gdb
 > `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index a0a97e7..62e405f 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -64,12 +64,14 @@ static unsigned int __read_mostly ple_window = 4096;
 integer_param("ple_window", ple_window);
 
 static bool_t __read_mostly opt_pml_enabled = 0;
+static s8 __read_mostly opt_ept_ad = -1;
 
 /*
  * The 'ept' parameter controls functionalities that depend on, or impact the
  * EPT mechanism. Optional comma separated value may contain:
  *
  *  pml                 Enable PML
+ *  ad                  Use A/D bits
  */
 static void __init parse_ept_param(char *s)
 {
@@ -87,6 +89,8 @@ static void __init parse_ept_param(char *s)
 
         if ( !strcmp(s, "pml") )
             opt_pml_enabled = val;
+        else if ( !strcmp(s, "ad") )
+            opt_ept_ad = val;
 
         s = ss + 1;
     } while ( ss );
@@ -268,6 +272,13 @@ static int vmx_init_vmcs_config(void)
     {
         rdmsrl(MSR_IA32_VMX_EPT_VPID_CAP, _vmx_ept_vpid_cap);
 
+        if ( !opt_ept_ad )
+            _vmx_ept_vpid_cap &= ~VMX_EPT_AD_BIT;
+        else if ( /* Work around Erratum AVR41 on Avoton processors. */
+                  boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x4d &&
+                  opt_ept_ad < 0 )
+            _vmx_ept_vpid_cap &= ~VMX_EPT_AD_BIT;
+
         /*
          * Additional sanity checking before using EPT:
          * 1) the CPU we are running on must support EPT WB, as we will set
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 16f4535..9860c6c 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -130,14 +130,14 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
             break;
         case p2m_ram_rw:
             entry->r = entry->w = entry->x = 1;
-            entry->a = entry->d = 1;
+            entry->a = entry->d = !!cpu_has_vmx_ept_ad;
             break;
         case p2m_mmio_direct:
             entry->r = entry->x = 1;
             entry->w = !rangeset_contains_singleton(mmio_ro_ranges,
                                                     entry->mfn);
-            entry->a = 1;
-            entry->d = entry->w;
+            entry->a = !!cpu_has_vmx_ept_ad;
+            entry->d = entry->w && cpu_has_vmx_ept_ad;
             break;
         case p2m_ram_logdirty:
             entry->r = entry->x = 1;
@@ -152,7 +152,7 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
                 entry->w = 1;
             else
                 entry->w = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             /* For both PML or non-PML cases we clear D bit anyway */
             entry->d = 0;
             break;
@@ -160,20 +160,20 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
         case p2m_ram_shared:
             entry->r = entry->x = 1;
             entry->w = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             entry->d = 0;
             break;
         case p2m_grant_map_rw:
         case p2m_map_foreign:
             entry->r = entry->w = 1;
             entry->x = 0;
-            entry->a = entry->d = 1;
+            entry->a = entry->d = !!cpu_has_vmx_ept_ad;
             break;
         case p2m_grant_map_ro:
         case p2m_mmio_write_dm:
             entry->r = 1;
             entry->w = entry->x = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             entry->d = 0;
             break;
     }
@@ -233,7 +233,7 @@ static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry)
 
     ept_entry->r = ept_entry->w = ept_entry->x = 1;
     /* Manually set A bit to avoid overhead of MMU having to write it later. */
-    ept_entry->a = 1;
+    ept_entry->a = !!cpu_has_vmx_ept_ad;
 
     ept_entry->suppress_ve = 1;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 3fbfa44..2ed62f9 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -262,6 +262,7 @@ extern uint8_t posted_intr_vector;
     (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_1GB)
 #define cpu_has_vmx_ept_2mb                     \
     (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_2MB)
+#define cpu_has_vmx_ept_ad (vmx_ept_vpid_cap & VMX_EPT_AD_BIT)
 #define cpu_has_vmx_ept_invept_single_context   \
     (vmx_ept_vpid_cap & VMX_EPT_INVEPT_SINGLE_CONTEXT)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdwx-0006Gk-EI; Wed, 07 Oct 2015 01:55:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdww-0006Gd-Pa
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:22 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	4D/6E-25435-A8B74165; Wed, 07 Oct 2015 01:55:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1444182919!56265244!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 1075 invoked from network); 7 Oct 2015 01:55:20 -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;
	7 Oct 2015 01:55:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwt-00055P-Il
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdwt-0004MK-G6
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:19 +0000
Date: Wed, 07 Oct 2015 01:55:19 +0000
Message-Id: <E1Zjdwt-0004MK-G6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/EPT: work around hardware
	erratum setting A bit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9204673fc60f606ec2b280a377e69d7fceedf5d6
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Fri Oct 2 13:53:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:53:27 2015 +0200

    x86/EPT: work around hardware erratum setting A bit
    
    Since commit 191b3f3344ee ("p2m/ept: enable PML in p2m-ept for
    log-dirty"), the A and D bits of EPT paging entries are set
    unconditionally, regardless of whether PML is enabled or not. This
    causes a regression in Xen 4.6 on some processors due to Intel Errata
    AVR41 -- HVM guests get severe memory corruption when the A bit is set
    due to incorrect TLB flushing on mov to cr3. The erratum affects the
    Atom C2000 family (Avoton).
    
    To fix, do not set the A bit on this processor family.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    
    Move feature suppression to feature detection code. Add command line
    override.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 33b55dc10342570aad77bd2fa221189df0ebca4e
    master date: 2015-10-02 13:39:12 +0200
---
 docs/misc/xen-command-line.markdown |   27 ++++++++++++++++++---------
 xen/arch/x86/hvm/vmx/vmcs.c         |   11 +++++++++++
 xen/arch/x86/mm/p2m-ept.c           |   16 ++++++++--------
 xen/include/asm-x86/hvm/vmx/vmx.h   |    1 +
 4 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a2e427c..a565c1b 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -705,19 +705,28 @@ virtualization, to allow the L1 hypervisor to use EPT even if the L0 hypervisor
 does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT.
 
 ### ept (Intel)
-> `= List of ( pml<boolean> )`
+> `= List of ( {no-}pml | {no-}ad )`
+
+Controls EPT related features.
+
+> Sub-options:
+
+> `pml`
 
 > Default: `false`
 
-Controls EPT related features. Currently only Page Modification Logging (PML) is
-the controllable feature as boolean type.
+>> PML is a new hardware feature in Intel's Broadwell Server and further
+>> platforms which reduces hypervisor overhead of log-dirty mechanism by
+>> automatically recording GPAs (guest physical addresses) when guest memory
+>> gets dirty, and therefore significantly reducing number of EPT violation
+>> caused by write protection of guest memory, which is a necessity to
+>> implement log-dirty mechanism before PML.
+
+> `ad`
+
+> Default: Hardware dependent
 
-PML is a new hardware feature in Intel's Broadwell Server and further platforms
-which reduces hypervisor overhead of log-dirty mechanism by automatically
-recording GPAs (guest physical addresses) when guest memory gets dirty, and
-therefore significantly reducing number of EPT violation caused by write
-protection of guest memory, which is a necessity to implement log-dirty
-mechanism before PML.
+>> Have hardware keep accessed/dirty (A/D) bits updated.
 
 ### gdb
 > `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index a0a97e7..62e405f 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -64,12 +64,14 @@ static unsigned int __read_mostly ple_window = 4096;
 integer_param("ple_window", ple_window);
 
 static bool_t __read_mostly opt_pml_enabled = 0;
+static s8 __read_mostly opt_ept_ad = -1;
 
 /*
  * The 'ept' parameter controls functionalities that depend on, or impact the
  * EPT mechanism. Optional comma separated value may contain:
  *
  *  pml                 Enable PML
+ *  ad                  Use A/D bits
  */
 static void __init parse_ept_param(char *s)
 {
@@ -87,6 +89,8 @@ static void __init parse_ept_param(char *s)
 
         if ( !strcmp(s, "pml") )
             opt_pml_enabled = val;
+        else if ( !strcmp(s, "ad") )
+            opt_ept_ad = val;
 
         s = ss + 1;
     } while ( ss );
@@ -268,6 +272,13 @@ static int vmx_init_vmcs_config(void)
     {
         rdmsrl(MSR_IA32_VMX_EPT_VPID_CAP, _vmx_ept_vpid_cap);
 
+        if ( !opt_ept_ad )
+            _vmx_ept_vpid_cap &= ~VMX_EPT_AD_BIT;
+        else if ( /* Work around Erratum AVR41 on Avoton processors. */
+                  boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x4d &&
+                  opt_ept_ad < 0 )
+            _vmx_ept_vpid_cap &= ~VMX_EPT_AD_BIT;
+
         /*
          * Additional sanity checking before using EPT:
          * 1) the CPU we are running on must support EPT WB, as we will set
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 16f4535..9860c6c 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -130,14 +130,14 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
             break;
         case p2m_ram_rw:
             entry->r = entry->w = entry->x = 1;
-            entry->a = entry->d = 1;
+            entry->a = entry->d = !!cpu_has_vmx_ept_ad;
             break;
         case p2m_mmio_direct:
             entry->r = entry->x = 1;
             entry->w = !rangeset_contains_singleton(mmio_ro_ranges,
                                                     entry->mfn);
-            entry->a = 1;
-            entry->d = entry->w;
+            entry->a = !!cpu_has_vmx_ept_ad;
+            entry->d = entry->w && cpu_has_vmx_ept_ad;
             break;
         case p2m_ram_logdirty:
             entry->r = entry->x = 1;
@@ -152,7 +152,7 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
                 entry->w = 1;
             else
                 entry->w = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             /* For both PML or non-PML cases we clear D bit anyway */
             entry->d = 0;
             break;
@@ -160,20 +160,20 @@ static void ept_p2m_type_to_flags(struct p2m_domain *p2m, ept_entry_t *entry,
         case p2m_ram_shared:
             entry->r = entry->x = 1;
             entry->w = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             entry->d = 0;
             break;
         case p2m_grant_map_rw:
         case p2m_map_foreign:
             entry->r = entry->w = 1;
             entry->x = 0;
-            entry->a = entry->d = 1;
+            entry->a = entry->d = !!cpu_has_vmx_ept_ad;
             break;
         case p2m_grant_map_ro:
         case p2m_mmio_write_dm:
             entry->r = 1;
             entry->w = entry->x = 0;
-            entry->a = 1;
+            entry->a = !!cpu_has_vmx_ept_ad;
             entry->d = 0;
             break;
     }
@@ -233,7 +233,7 @@ static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry)
 
     ept_entry->r = ept_entry->w = ept_entry->x = 1;
     /* Manually set A bit to avoid overhead of MMU having to write it later. */
-    ept_entry->a = 1;
+    ept_entry->a = !!cpu_has_vmx_ept_ad;
 
     ept_entry->suppress_ve = 1;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 3fbfa44..2ed62f9 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -262,6 +262,7 @@ extern uint8_t posted_intr_vector;
     (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_1GB)
 #define cpu_has_vmx_ept_2mb                     \
     (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_2MB)
+#define cpu_has_vmx_ept_ad (vmx_ept_vpid_cap & VMX_EPT_AD_BIT)
 #define cpu_has_vmx_ept_invept_single_context   \
     (vmx_ept_vpid_cap & VMX_EPT_INVEPT_SINGLE_CONTEXT)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdx7-0006IL-L9; Wed, 07 Oct 2015 01:55: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 1Zjdx6-0006IC-LH
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:32 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	1D/47-00475-49B74165; Wed, 07 Oct 2015 01:55:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1444182930!20328810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1514 invoked from network); 7 Oct 2015 01:55:30 -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;
	7 Oct 2015 01:55:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdx3-00055a-UF
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdx3-0004My-PQ
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:29 +0000
Date: Wed, 07 Oct 2015 01:55:29 +0000
Message-Id: <E1Zjdx3-0004My-PQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/p2m-pt: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 10a5d79bf631874927c08c9c74335d7edec69ff4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:54:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:54:08 2015 +0200

    x86/p2m-pt: tighten conditions of IOMMU mapping updates
    
    Whether the MFN changes does not depend on the new entry being valid
    (but solely on the old one), and the need to update or TLB-flush also
    depends on permission changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 660fd65d5578a95ec5eac522128bba23325179eb
    master date: 2015-10-02 13:40:36 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   71 +++++++++++++++++++++++++++++----------------
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 4645581..9a03d35 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -494,7 +494,18 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     l3_pgentry_t l3e_content;
     int rc;
     unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
-    unsigned long old_mfn = 0;
+    /*
+     * old_mfn and iommu_old_flags control possible flush/update needs on the
+     * IOMMU: We need to flush when MFN or flags (i.e. permissions) change.
+     * iommu_old_flags being initialized to zero covers the case of the entry
+     * getting replaced being a non-present (leaf or intermediate) one. For
+     * present leaf entries the real value will get calculated below, while
+     * for present intermediate entries ~0 (guaranteed != iommu_pte_flags)
+     * will be used (to cover all cases of what the leaf entries underneath
+     * the intermediate one might be).
+     */
+    unsigned int flags, iommu_old_flags = 0;
+    unsigned long old_mfn = INVALID_MFN;
 
     ASSERT(sve != 0);
 
@@ -543,12 +554,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -559,10 +578,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l3e_content.l3;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -587,7 +603,10 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
+        iommu_old_flags =
+            p2m_get_iommu_flags(p2m_flags_to_type(l1e_get_flags(*p2m_entry)));
+        old_mfn = l1e_get_pfn(*p2m_entry);
+
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
                             || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
@@ -596,10 +615,8 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             entry_content = l1e_empty();
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
+
         /* level 1 entry */
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 1);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -610,14 +627,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
-        /* FIXME: Deal with 4k replaced by 2meg pages */
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -631,10 +654,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l2e_content.l2;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -645,11 +665,12 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
-    if ( iommu_enabled && need_iommu(p2m->domain) )
+    if ( iommu_enabled && need_iommu(p2m->domain) &&
+         (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
     {
         if ( iommu_use_hap_pt(p2m->domain) )
         {
-            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
+            if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
         else
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdx7-0006IL-L9; Wed, 07 Oct 2015 01:55: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 1Zjdx6-0006IC-LH
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:32 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	1D/47-00475-49B74165; Wed, 07 Oct 2015 01:55:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1444182930!20328810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1514 invoked from network); 7 Oct 2015 01:55:30 -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;
	7 Oct 2015 01:55:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdx3-00055a-UF
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdx3-0004My-PQ
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:29 +0000
Date: Wed, 07 Oct 2015 01:55:29 +0000
Message-Id: <E1Zjdx3-0004My-PQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/p2m-pt: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 10a5d79bf631874927c08c9c74335d7edec69ff4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:54:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:54:08 2015 +0200

    x86/p2m-pt: tighten conditions of IOMMU mapping updates
    
    Whether the MFN changes does not depend on the new entry being valid
    (but solely on the old one), and the need to update or TLB-flush also
    depends on permission changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: 660fd65d5578a95ec5eac522128bba23325179eb
    master date: 2015-10-02 13:40:36 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   71 +++++++++++++++++++++++++++++----------------
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 4645581..9a03d35 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -494,7 +494,18 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     l3_pgentry_t l3e_content;
     int rc;
     unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
-    unsigned long old_mfn = 0;
+    /*
+     * old_mfn and iommu_old_flags control possible flush/update needs on the
+     * IOMMU: We need to flush when MFN or flags (i.e. permissions) change.
+     * iommu_old_flags being initialized to zero covers the case of the entry
+     * getting replaced being a non-present (leaf or intermediate) one. For
+     * present leaf entries the real value will get calculated below, while
+     * for present intermediate entries ~0 (guaranteed != iommu_pte_flags)
+     * will be used (to cover all cases of what the leaf entries underneath
+     * the intermediate one might be).
+     */
+    unsigned int flags, iommu_old_flags = 0;
+    unsigned long old_mfn = INVALID_MFN;
 
     ASSERT(sve != 0);
 
@@ -543,12 +554,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -559,10 +578,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l3e_content.l3;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -587,7 +603,10 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
+        iommu_old_flags =
+            p2m_get_iommu_flags(p2m_flags_to_type(l1e_get_flags(*p2m_entry)));
+        old_mfn = l1e_get_pfn(*p2m_entry);
+
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
                             || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
@@ -596,10 +615,8 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             entry_content = l1e_empty();
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
+
         /* level 1 entry */
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 1);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -610,14 +627,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
-        /* FIXME: Deal with 4k replaced by 2meg pages */
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -631,10 +654,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l2e_content.l2;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -645,11 +665,12 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
-    if ( iommu_enabled && need_iommu(p2m->domain) )
+    if ( iommu_enabled && need_iommu(p2m->domain) &&
+         (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
     {
         if ( iommu_use_hap_pt(p2m->domain) )
         {
-            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
+            if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
         else
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55: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 1ZjdxI-0006K1-Nk; Wed, 07 Oct 2015 01:55: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 1ZjdxH-0006Jg-7j
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:43 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	48/A8-22089-E9B74165; Wed, 07 Oct 2015 01:55:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1444182941!16943136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29682 invoked from network); 7 Oct 2015 01:55:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Oct 2015 01:55:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjdxF-00055i-5B
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjdxE-0004NQ-7Z
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:40 +0000
Date: Wed, 07 Oct 2015 01:55:40 +0000
Message-Id: <E1ZjdxE-0004NQ-7Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/p2m-pt: use pre-calculated
	IOMMU flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a5cadbf4ff82ce7cc9e08714953982273f3b617
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:55:21 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:55:21 2015 +0200

    x86/p2m-pt: use pre-calculated IOMMU flags
    
    ... instead of recalculating them.
    
    At once clean up formatting of the touched code and drop a stray loop
    local variable shadowing a function scope one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: edb9531263e1698343ef3f8743d23b8044979341
    master date: 2015-10-02 13:41:24 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 9a03d35..709920a 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -673,17 +673,13 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
+        else if ( iommu_pte_flags )
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_map_page(p2m->domain, gfn + i, mfn_x(mfn) + i,
+                               iommu_pte_flags);
         else
-        {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
-                for ( i = 0; i < (1UL << page_order); i++ )
-                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
-            else
-                for ( int i = 0; i < (1UL << page_order); i++ )
-                    iommu_unmap_page(p2m->domain, gfn+i);
-        }
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_unmap_page(p2m->domain, gfn + i);
     }
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55: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 1ZjdxI-0006K1-Nk; Wed, 07 Oct 2015 01:55: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 1ZjdxH-0006Jg-7j
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:43 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	48/A8-22089-E9B74165; Wed, 07 Oct 2015 01:55:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1444182941!16943136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29682 invoked from network); 7 Oct 2015 01:55:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Oct 2015 01:55:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjdxF-00055i-5B
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjdxE-0004NQ-7Z
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:40 +0000
Date: Wed, 07 Oct 2015 01:55:40 +0000
Message-Id: <E1ZjdxE-0004NQ-7Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/p2m-pt: use pre-calculated
	IOMMU flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a5cadbf4ff82ce7cc9e08714953982273f3b617
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 13:55:21 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 13:55:21 2015 +0200

    x86/p2m-pt: use pre-calculated IOMMU flags
    
    ... instead of recalculating them.
    
    At once clean up formatting of the touched code and drop a stray loop
    local variable shadowing a function scope one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Release-acked-by: Wei Liu <wei.liu2@citrix.com>
    master commit: edb9531263e1698343ef3f8743d23b8044979341
    master date: 2015-10-02 13:41:24 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 9a03d35..709920a 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -673,17 +673,13 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
+        else if ( iommu_pte_flags )
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_map_page(p2m->domain, gfn + i, mfn_x(mfn) + i,
+                               iommu_pte_flags);
         else
-        {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
-                for ( i = 0; i < (1UL << page_order); i++ )
-                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
-            else
-                for ( int i = 0; i < (1UL << page_order); i++ )
-                    iommu_unmap_page(p2m->domain, gfn+i);
-        }
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_unmap_page(p2m->domain, gfn + i);
     }
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjdxT-0006Lo-Ql; Wed, 07 Oct 2015 01:55: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 1ZjdxT-0006Lf-2s
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:55 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	71/0B-28791-AAB74165; Wed, 07 Oct 2015 01:55:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1444182952!23985026!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5238 invoked from network); 7 Oct 2015 01:55:53 -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;
	7 Oct 2015 01:55:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjdxQ-00055q-9n
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjdxP-0004Nv-BN
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:51 +0000
Date: Wed, 07 Oct 2015 01:55:51 +0000
Message-Id: <E1ZjdxP-0004Nv-BN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Update QEMU_*_REVISION to final
	4.6.0 tags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b30720fcef40fe88cbfe73dc76eb526d92e7a1c5
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Oct 5 15:22:44 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 5 15:22:44 2015 +0100

    Update QEMU_*_REVISION to final 4.6.0 tags
    
    No effective change: these tags refer to the commits whose ids are
    being removed.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 5a3774e..4a0f95a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -254,7 +254,7 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
-QEMU_UPSTREAM_REVISION ?= cc31b41210ed66b07822a8c534053273d249dbe6
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0
 MINIOS_UPSTREAM_REVISION ?= b36bcb370d611ad7f41e8c21d061e6291e088c58
 # Fri Jun 26 11:58:40 2015 +0100
 # Correct printf formatting for tpm_tis message.
@@ -266,7 +266,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 1c8d43cbdf0fc01a8f05acfbf55b805a83da34bb
+QEMU_TRADITIONAL_REVISION ?= xen-4.6.0
 # Tue Sep 8 15:41:20 2015 +0100
 # Fix build after "ui/vnc: limit client_cut_text msg payload size"
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:55:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:55:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZjdxT-0006Lo-Ql; Wed, 07 Oct 2015 01:55: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 1ZjdxT-0006Lf-2s
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:55 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	71/0B-28791-AAB74165; Wed, 07 Oct 2015 01:55:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1444182952!23985026!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5238 invoked from network); 7 Oct 2015 01:55:53 -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;
	7 Oct 2015 01:55:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjdxQ-00055q-9n
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZjdxP-0004Nv-BN
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:55:51 +0000
Date: Wed, 07 Oct 2015 01:55:51 +0000
Message-Id: <E1ZjdxP-0004Nv-BN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Update QEMU_*_REVISION to final
	4.6.0 tags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b30720fcef40fe88cbfe73dc76eb526d92e7a1c5
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Oct 5 15:22:44 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 5 15:22:44 2015 +0100

    Update QEMU_*_REVISION to final 4.6.0 tags
    
    No effective change: these tags refer to the commits whose ids are
    being removed.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 5a3774e..4a0f95a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -254,7 +254,7 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
-QEMU_UPSTREAM_REVISION ?= cc31b41210ed66b07822a8c534053273d249dbe6
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0
 MINIOS_UPSTREAM_REVISION ?= b36bcb370d611ad7f41e8c21d061e6291e088c58
 # Fri Jun 26 11:58:40 2015 +0100
 # Correct printf formatting for tpm_tis message.
@@ -266,7 +266,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 1c8d43cbdf0fc01a8f05acfbf55b805a83da34bb
+QEMU_TRADITIONAL_REVISION ?= xen-4.6.0
 # Tue Sep 8 15:41:20 2015 +0100
 # Fix build after "ui/vnc: limit client_cut_text msg payload size"
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:56:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:56:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdxg-0006NZ-UP; Wed, 07 Oct 2015 01:56: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 1Zjdxf-0006NP-Qn
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:07 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	89/A3-29649-7BB74165; Wed, 07 Oct 2015 01:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1444182965!19719595!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20602 invoked from network); 7 Oct 2015 01:56:06 -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;
	7 Oct 2015 01:56:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdxa-00056R-Ko
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdxa-0004PW-GS
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:02 +0000
Date: Wed, 07 Oct 2015 01:56:02 +0000
Message-Id: <E1Zjdxa-0004PW-GS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Update MINIOS_UPSTREAM_REVISION to
	final 4.6.0 tag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 605542411f07ccd4402602f67383c31d85c09e89
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Oct 5 15:28:48 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 5 15:28:48 2015 +0100

    Update MINIOS_UPSTREAM_REVISION to final 4.6.0 tag
    
    No effective change: this tag refers to the commit whose id is being
    removed.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 4a0f95a..54fbb9d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,7 +255,7 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0
-MINIOS_UPSTREAM_REVISION ?= b36bcb370d611ad7f41e8c21d061e6291e088c58
+MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.6.0
 # Fri Jun 26 11:58:40 2015 +0100
 # Correct printf formatting for tpm_tis message.
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:56:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:56:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdxg-0006NZ-UP; Wed, 07 Oct 2015 01:56: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 1Zjdxf-0006NP-Qn
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:07 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	89/A3-29649-7BB74165; Wed, 07 Oct 2015 01:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1444182965!19719595!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20602 invoked from network); 7 Oct 2015 01:56:06 -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;
	7 Oct 2015 01:56:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdxa-00056R-Ko
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdxa-0004PW-GS
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:02 +0000
Date: Wed, 07 Oct 2015 01:56:02 +0000
Message-Id: <E1Zjdxa-0004PW-GS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Update MINIOS_UPSTREAM_REVISION to
	final 4.6.0 tag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 605542411f07ccd4402602f67383c31d85c09e89
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Oct 5 15:28:48 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 5 15:28:48 2015 +0100

    Update MINIOS_UPSTREAM_REVISION to final 4.6.0 tag
    
    No effective change: this tag refers to the commit whose id is being
    removed.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 4a0f95a..54fbb9d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,7 +255,7 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0
-MINIOS_UPSTREAM_REVISION ?= b36bcb370d611ad7f41e8c21d061e6291e088c58
+MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.6.0
 # Fri Jun 26 11:58:40 2015 +0100
 # Correct printf formatting for tpm_tis message.
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:56:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:56:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdxr-0006Ow-0w; Wed, 07 Oct 2015 01:56: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 1Zjdxq-0006Of-2E
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:18 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	77/1A-26043-1CB74165; Wed, 07 Oct 2015 01:56:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1444182975!53686218!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16387 invoked from network); 7 Oct 2015 01:56:16 -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;
	7 Oct 2015 01:56:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdxn-00056Z-LR
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdxn-0004Q3-Ho
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:15 +0000
Date: Wed, 07 Oct 2015 01:56:15 +0000
Message-Id: <E1Zjdxn-0004Q3-Ho@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Update versions to 4.6.0 (without
	rc) for release
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b24ad7ba911a9f0688ab179736476e44c52144f1
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Oct 5 15:33:39 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 5 15:33:39 2015 +0100

    Update versions to 4.6.0 (without rc) for release
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 README       |   10 +++++-----
 xen/Makefile |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README b/README
index 522f1a2..5664a93 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
 #################################
-__  __            _  _    __
-\ \/ /___ _ __   | || |  / /_        _ __ ___
- \  // _ \ '_ \  | || |_| '_ \ _____| '__/ __|
- /  \  __/ | | | |__   _| (_) |_____| | | (__
-/_/\_\___|_| |_|    |_|(_)___/      |_|  \___|
+__  __            _  _    __    ___
+\ \/ /___ _ __   | || |  / /_  / _ \
+ \  // _ \ '_ \  | || |_| '_ \| | | |
+ /  \  __/ | | | |__   _| (_) | |_| |
+/_/\_\___|_| |_|    |_|(_)___(_)___/
 
 #################################
 
diff --git a/xen/Makefile b/xen/Makefile
index 6088c9d..4c54e9b 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    = 6
-export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0$(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.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 07 01:56:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2015 01:56:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zjdxr-0006Ow-0w; Wed, 07 Oct 2015 01:56: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 1Zjdxq-0006Of-2E
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:18 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	77/1A-26043-1CB74165; Wed, 07 Oct 2015 01:56:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1444182975!53686218!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16387 invoked from network); 7 Oct 2015 01:56:16 -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;
	7 Oct 2015 01:56:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdxn-00056Z-LR
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zjdxn-0004Q3-Ho
	for xen-changelog@lists.xensource.com; Wed, 07 Oct 2015 01:56:15 +0000
Date: Wed, 07 Oct 2015 01:56:15 +0000
Message-Id: <E1Zjdxn-0004Q3-Ho@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Update versions to 4.6.0 (without
	rc) for release
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b24ad7ba911a9f0688ab179736476e44c52144f1
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Oct 5 15:33:39 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 5 15:33:39 2015 +0100

    Update versions to 4.6.0 (without rc) for release
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 README       |   10 +++++-----
 xen/Makefile |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README b/README
index 522f1a2..5664a93 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
 #################################
-__  __            _  _    __
-\ \/ /___ _ __   | || |  / /_        _ __ ___
- \  // _ \ '_ \  | || |_| '_ \ _____| '__/ __|
- /  \  __/ | | | |__   _| (_) |_____| | | (__
-/_/\_\___|_| |_|    |_|(_)___/      |_|  \___|
+__  __            _  _    __    ___
+\ \/ /___ _ __   | || |  / /_  / _ \
+ \  // _ \ '_ \  | || |_| '_ \| | | |
+ /  \  __/ | | | |__   _| (_) | |_| |
+/_/\_\___|_| |_|    |_|(_)___(_)___/
 
 #################################
 
diff --git a/xen/Makefile b/xen/Makefile
index 6088c9d..4c54e9b 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    = 6
-export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0$(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.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 08 22:22:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22: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 1ZkJZg-0008GS-SX; Thu, 08 Oct 2015 22:22:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZf-0008GN-7Q
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:07 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	8D/91-00536-E8CE6165; Thu, 08 Oct 2015 22:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1444342925!49244449!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30520 invoked from network); 8 Oct 2015 22:22:06 -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;
	8 Oct 2015 22:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZc-0007Xr-Tq
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZb-0004Da-QQ
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:03 +0000
Date: Thu, 08 Oct 2015 22:22:03 +0000
Message-Id: <E1ZkJZb-0004Da-QQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] paging: Fix compile error when
	DEBUG_TRACE_DUMP is enabled.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 34f10e25d4522adf9d9a064d4ab0d1f4a3ca93f2
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Sat Oct 3 05:41:23 2015 -0400
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CommitDate: Mon Oct 5 11:13:46 2015 -0400

    paging: Fix compile error when DEBUG_TRACE_DUMP is enabled.
    
    And also remove the extra space. 'gmfn' does not exist in this
    function anymore.
    
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/mm/paging.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 5becee8..ba1d528 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -331,9 +331,9 @@ void paging_mark_gfn_dirty(struct domain *d, unsigned long pfn)
     unmap_domain_page(l1);
     if ( changed )
     {
-        PAGING_DEBUG(LOGDIRTY, 
+        PAGING_DEBUG(LOGDIRTY,
                      "marked mfn %" PRI_mfn " (pfn=%lx), dom %d\n",
-                     mfn_x(gmfn), pfn, d->domain_id);
+                     mfn_x(mfn), pfn, d->domain_id);
         d->arch.paging.log_dirty.dirty_count++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:22:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22: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 1ZkJZg-0008GS-SX; Thu, 08 Oct 2015 22:22:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZf-0008GN-7Q
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:07 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	8D/91-00536-E8CE6165; Thu, 08 Oct 2015 22:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1444342925!49244449!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30520 invoked from network); 8 Oct 2015 22:22:06 -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;
	8 Oct 2015 22:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZc-0007Xr-Tq
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZb-0004Da-QQ
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:03 +0000
Date: Thu, 08 Oct 2015 22:22:03 +0000
Message-Id: <E1ZkJZb-0004Da-QQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] paging: Fix compile error when
	DEBUG_TRACE_DUMP is enabled.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 34f10e25d4522adf9d9a064d4ab0d1f4a3ca93f2
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Sat Oct 3 05:41:23 2015 -0400
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CommitDate: Mon Oct 5 11:13:46 2015 -0400

    paging: Fix compile error when DEBUG_TRACE_DUMP is enabled.
    
    And also remove the extra space. 'gmfn' does not exist in this
    function anymore.
    
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/mm/paging.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 5becee8..ba1d528 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -331,9 +331,9 @@ void paging_mark_gfn_dirty(struct domain *d, unsigned long pfn)
     unmap_domain_page(l1);
     if ( changed )
     {
-        PAGING_DEBUG(LOGDIRTY, 
+        PAGING_DEBUG(LOGDIRTY,
                      "marked mfn %" PRI_mfn " (pfn=%lx), dom %d\n",
-                     mfn_x(gmfn), pfn, d->domain_id);
+                     mfn_x(mfn), pfn, d->domain_id);
         d->arch.paging.log_dirty.dirty_count++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJZr-0008H7-1Q; Thu, 08 Oct 2015 22:22:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZp-0008H1-VH
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:18 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	81/5A-10422-99CE6165; Thu, 08 Oct 2015 22:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1444342935!41003329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23489 invoked from network); 8 Oct 2015 22:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZn-0007Xv-JF
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZn-0004Es-58
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:15 +0000
Date: Thu, 08 Oct 2015 22:22:15 +0000
Message-Id: <E1ZkJZn-0004Es-58@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for CSFLAG bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8abdea48a3f5c880e7a18cfac7bad5be621cae5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 5 17:16:38 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 17:16:38 2015 +0200

    use masking operation instead of test_bit for CSFLAG bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit2.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index bf1fe6f..912e1a2 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -418,7 +418,7 @@ __runq_insert(struct list_head *runq, struct csched2_vcpu *svc)
     /* Idle vcpus not allowed on the runqueue anymore */
     BUG_ON(is_idle_vcpu(svc->vcpu));
     BUG_ON(svc->vcpu->is_running);
-    BUG_ON(test_bit(__CSFLAG_scheduled, &svc->flags));
+    BUG_ON(svc->flags & CSFLAG_scheduled);
 
     list_for_each( iter, runq )
     {
@@ -844,7 +844,7 @@ static void
 __runq_deassign(struct csched2_vcpu *svc)
 {
     BUG_ON(__vcpu_on_runq(svc));
-    BUG_ON(test_bit(__CSFLAG_scheduled, &svc->flags));
+    BUG_ON(svc->flags & CSFLAG_scheduled);
 
     list_del_init(&svc->rqd_elem);
     update_max_weight(svc->rqd, 0, svc->weight);
@@ -952,7 +952,7 @@ csched2_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
         update_load(ops, svc->rqd, svc, -1, NOW());
         __runq_remove(svc);
     }
-    else if ( test_bit(__CSFLAG_delayed_runq_add, &svc->flags) )
+    else if ( svc->flags & CSFLAG_delayed_runq_add )
         clear_bit(__CSFLAG_delayed_runq_add, &svc->flags);
 }
 
@@ -988,7 +988,7 @@ csched2_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
     /* If the context hasn't been saved for this vcpu yet, we can't put it on
      * another runqueue.  Instead, we set a flag so that it will be put on the runqueue
      * after the context has been saved. */
-    if ( unlikely (test_bit(__CSFLAG_scheduled, &svc->flags) ) )
+    if ( unlikely(svc->flags & CSFLAG_scheduled) )
     {
         set_bit(__CSFLAG_delayed_runq_add, &svc->flags);
         goto out;
@@ -1204,7 +1204,7 @@ static void migrate(const struct scheduler *ops,
                     struct csched2_runqueue_data *trqd, 
                     s_time_t now)
 {
-    if ( test_bit(__CSFLAG_scheduled, &svc->flags) )
+    if ( svc->flags & CSFLAG_scheduled )
     {
         d2printk("%pv %d-%d a\n", svc->vcpu, svc->rqd->id, trqd->id);
         /* It's running; mark it to migrate. */
@@ -1348,7 +1348,7 @@ retry:
         __update_svc_load(ops, push_svc, 0, now);
 
         /* Skip this one if it's already been flagged to migrate */
-        if ( test_bit(__CSFLAG_runq_migrate_request, &push_svc->flags) )
+        if ( push_svc->flags & CSFLAG_runq_migrate_request )
             continue;
 
         list_for_each( pull_iter, &st.orqd->svc )
@@ -1361,7 +1361,7 @@ retry:
             }
         
             /* Skip this one if it's already been flagged to migrate */
-            if ( test_bit(__CSFLAG_runq_migrate_request, &pull_svc->flags) )
+            if ( pull_svc->flags & CSFLAG_runq_migrate_request )
                 continue;
 
             consider(&st, push_svc, pull_svc);
@@ -1378,7 +1378,7 @@ retry:
         struct csched2_vcpu * pull_svc = list_entry(pull_iter, struct csched2_vcpu, rqd_elem);
         
         /* Skip this one if it's already been flagged to migrate */
-        if ( test_bit(__CSFLAG_runq_migrate_request, &pull_svc->flags) )
+        if ( pull_svc->flags & CSFLAG_runq_migrate_request )
             continue;
 
         /* Consider pull only */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJZr-0008H7-1Q; Thu, 08 Oct 2015 22:22:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZp-0008H1-VH
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:18 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	81/5A-10422-99CE6165; Thu, 08 Oct 2015 22:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1444342935!41003329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23489 invoked from network); 8 Oct 2015 22:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZn-0007Xv-JF
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZn-0004Es-58
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:15 +0000
Date: Thu, 08 Oct 2015 22:22:15 +0000
Message-Id: <E1ZkJZn-0004Es-58@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use masking operation instead of
	test_bit for CSFLAG bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8abdea48a3f5c880e7a18cfac7bad5be621cae5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 5 17:16:38 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 17:16:38 2015 +0200

    use masking operation instead of test_bit for CSFLAG bits
    
    Use a bit mask for testing of a set bit instead of test_bit in case no
    atomic operation is needed, as this will lead to smaller and more
    effective code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit2.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index bf1fe6f..912e1a2 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -418,7 +418,7 @@ __runq_insert(struct list_head *runq, struct csched2_vcpu *svc)
     /* Idle vcpus not allowed on the runqueue anymore */
     BUG_ON(is_idle_vcpu(svc->vcpu));
     BUG_ON(svc->vcpu->is_running);
-    BUG_ON(test_bit(__CSFLAG_scheduled, &svc->flags));
+    BUG_ON(svc->flags & CSFLAG_scheduled);
 
     list_for_each( iter, runq )
     {
@@ -844,7 +844,7 @@ static void
 __runq_deassign(struct csched2_vcpu *svc)
 {
     BUG_ON(__vcpu_on_runq(svc));
-    BUG_ON(test_bit(__CSFLAG_scheduled, &svc->flags));
+    BUG_ON(svc->flags & CSFLAG_scheduled);
 
     list_del_init(&svc->rqd_elem);
     update_max_weight(svc->rqd, 0, svc->weight);
@@ -952,7 +952,7 @@ csched2_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
         update_load(ops, svc->rqd, svc, -1, NOW());
         __runq_remove(svc);
     }
-    else if ( test_bit(__CSFLAG_delayed_runq_add, &svc->flags) )
+    else if ( svc->flags & CSFLAG_delayed_runq_add )
         clear_bit(__CSFLAG_delayed_runq_add, &svc->flags);
 }
 
@@ -988,7 +988,7 @@ csched2_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
     /* If the context hasn't been saved for this vcpu yet, we can't put it on
      * another runqueue.  Instead, we set a flag so that it will be put on the runqueue
      * after the context has been saved. */
-    if ( unlikely (test_bit(__CSFLAG_scheduled, &svc->flags) ) )
+    if ( unlikely(svc->flags & CSFLAG_scheduled) )
     {
         set_bit(__CSFLAG_delayed_runq_add, &svc->flags);
         goto out;
@@ -1204,7 +1204,7 @@ static void migrate(const struct scheduler *ops,
                     struct csched2_runqueue_data *trqd, 
                     s_time_t now)
 {
-    if ( test_bit(__CSFLAG_scheduled, &svc->flags) )
+    if ( svc->flags & CSFLAG_scheduled )
     {
         d2printk("%pv %d-%d a\n", svc->vcpu, svc->rqd->id, trqd->id);
         /* It's running; mark it to migrate. */
@@ -1348,7 +1348,7 @@ retry:
         __update_svc_load(ops, push_svc, 0, now);
 
         /* Skip this one if it's already been flagged to migrate */
-        if ( test_bit(__CSFLAG_runq_migrate_request, &push_svc->flags) )
+        if ( push_svc->flags & CSFLAG_runq_migrate_request )
             continue;
 
         list_for_each( pull_iter, &st.orqd->svc )
@@ -1361,7 +1361,7 @@ retry:
             }
         
             /* Skip this one if it's already been flagged to migrate */
-            if ( test_bit(__CSFLAG_runq_migrate_request, &pull_svc->flags) )
+            if ( pull_svc->flags & CSFLAG_runq_migrate_request )
                 continue;
 
             consider(&st, push_svc, pull_svc);
@@ -1378,7 +1378,7 @@ retry:
         struct csched2_vcpu * pull_svc = list_entry(pull_iter, struct csched2_vcpu, rqd_elem);
         
         /* Skip this one if it's already been flagged to migrate */
-        if ( test_bit(__CSFLAG_runq_migrate_request, &pull_svc->flags) )
+        if ( pull_svc->flags & CSFLAG_runq_migrate_request )
             continue;
 
         /* Consider pull only */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:22:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22: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 1ZkJa2-0008IS-4X; Thu, 08 Oct 2015 22:22: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 1ZkJa0-0008IJ-AB
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:28 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E7/11-29649-3ACE6165; Thu, 08 Oct 2015 22:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1444342946!51722869!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13335 invoked from network); 8 Oct 2015 22:22:27 -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;
	8 Oct 2015 22:22:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZx-0007Y7-TK
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZx-0004FL-QZ
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:25 +0000
Date: Thu, 08 Oct 2015 22:22:25 +0000
Message-Id: <E1ZkJZx-0004FL-QZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: adding myself as
	co-maintainer of cpupools
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d83ec321dc4735b25736856eb2f93e4629ab8bdd
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 5 17:18:10 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 17:18:10 2015 +0200

    MAINTAINERS: adding myself as co-maintainer of cpupools
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f008a8c..cad8cd6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -145,6 +145,7 @@ F:	xen/arch/arm/gic-hip04.c
 
 CPU POOLS
 M:	Juergen Gross <jgross@suse.com>
+M:	Dario Faggioli <dario.faggioli@citrix.com>
 S:	Supported
 F:	xen/common/cpupool.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 Oct 08 22:22:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22: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 1ZkJa2-0008IS-4X; Thu, 08 Oct 2015 22:22: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 1ZkJa0-0008IJ-AB
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:28 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E7/11-29649-3ACE6165; Thu, 08 Oct 2015 22:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1444342946!51722869!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13335 invoked from network); 8 Oct 2015 22:22:27 -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;
	8 Oct 2015 22:22:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZx-0007Y7-TK
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJZx-0004FL-QZ
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:25 +0000
Date: Thu, 08 Oct 2015 22:22:25 +0000
Message-Id: <E1ZkJZx-0004FL-QZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: adding myself as
	co-maintainer of cpupools
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d83ec321dc4735b25736856eb2f93e4629ab8bdd
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 5 17:18:10 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 17:18:10 2015 +0200

    MAINTAINERS: adding myself as co-maintainer of cpupools
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f008a8c..cad8cd6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -145,6 +145,7 @@ F:	xen/arch/arm/gic-hip04.c
 
 CPU POOLS
 M:	Juergen Gross <jgross@suse.com>
+M:	Dario Faggioli <dario.faggioli@citrix.com>
 S:	Supported
 F:	xen/common/cpupool.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 Oct 08 22:22:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22: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 1ZkJaC-0008Jx-Cu; Thu, 08 Oct 2015 22:22: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 1ZkJaA-0008Ji-RO
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:39 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	7C/B1-18886-EACE6165; Thu, 08 Oct 2015 22:22:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1444342956!54347242!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23092 invoked from network); 8 Oct 2015 22:22:37 -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;
	8 Oct 2015 22:22:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJa8-0007YF-6O
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJa8-0004Fn-4K
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:36 +0000
Date: Thu, 08 Oct 2015 22:22:36 +0000
Message-Id: <E1ZkJa8-0004Fn-4K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: adding myself as
	co-maintainer of scheduling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9d16b8dc29e6d0395c95ce6eea70e90d030bf387
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 5 17:18:33 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 17:18:33 2015 +0200

    MAINTAINERS: adding myself as co-maintainer of scheduling
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index cad8cd6..902a28a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -288,6 +288,7 @@ F:	xen/common/sched_rt.c
 
 SCHEDULING
 M:	George Dunlap <george.dunlap@eu.citrix.com>
+M:	Dario Faggioli <dario.faggioli@citrix.com>
 S:	Supported
 F:	xen/common/sched*
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:22:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22: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 1ZkJaC-0008Jx-Cu; Thu, 08 Oct 2015 22:22: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 1ZkJaA-0008Ji-RO
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:39 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	7C/B1-18886-EACE6165; Thu, 08 Oct 2015 22:22:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1444342956!54347242!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23092 invoked from network); 8 Oct 2015 22:22:37 -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;
	8 Oct 2015 22:22:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJa8-0007YF-6O
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJa8-0004Fn-4K
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:36 +0000
Date: Thu, 08 Oct 2015 22:22:36 +0000
Message-Id: <E1ZkJa8-0004Fn-4K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: adding myself as
	co-maintainer of scheduling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9d16b8dc29e6d0395c95ce6eea70e90d030bf387
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 5 17:18:33 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 17:18:33 2015 +0200

    MAINTAINERS: adding myself as co-maintainer of scheduling
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index cad8cd6..902a28a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -288,6 +288,7 @@ F:	xen/common/sched_rt.c
 
 SCHEDULING
 M:	George Dunlap <george.dunlap@eu.citrix.com>
+M:	Dario Faggioli <dario.faggioli@citrix.com>
 S:	Supported
 F:	xen/common/sched*
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:22:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJaL-0008LU-IS; Thu, 08 Oct 2015 22:22: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 1ZkJaK-0008LJ-M5
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:48 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	E9/66-18744-7BCE6165; Thu, 08 Oct 2015 22:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444342966!56988627!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26082 invoked from network); 8 Oct 2015 22:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:22:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaI-0007YN-ET
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaI-0004GK-By
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:46 +0000
Date: Thu, 08 Oct 2015 22:22:46 +0000
Message-Id: <E1ZkJaI-0004GK-By@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public: fix typo in memory.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 773e6912909808fc4f9e3f02d1e6602cbfc8133c
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 5 17:18:48 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 17:18:48 2015 +0200

    public: fix typo in memory.h
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
 xen/include/public/memory.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 320de91..4df38d6 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -520,7 +520,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
 /*
  * XENMEM_claim_pages flags - the are no flags at this time.
- * The zero value is appropiate.
+ * The zero value is appropriate.
  */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:22:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:22:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJaL-0008LU-IS; Thu, 08 Oct 2015 22:22: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 1ZkJaK-0008LJ-M5
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:48 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	E9/66-18744-7BCE6165; Thu, 08 Oct 2015 22:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444342966!56988627!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26082 invoked from network); 8 Oct 2015 22:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:22:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaI-0007YN-ET
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaI-0004GK-By
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:46 +0000
Date: Thu, 08 Oct 2015 22:22:46 +0000
Message-Id: <E1ZkJaI-0004GK-By@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public: fix typo in memory.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 773e6912909808fc4f9e3f02d1e6602cbfc8133c
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 5 17:18:48 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 17:18:48 2015 +0200

    public: fix typo in memory.h
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
 xen/include/public/memory.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 320de91..4df38d6 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -520,7 +520,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
 /*
  * XENMEM_claim_pages flags - the are no flags at this time.
- * The zero value is appropiate.
+ * The zero value is appropriate.
  */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:23:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJaW-0008NK-LR; Thu, 08 Oct 2015 22:23: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 1ZkJaV-0008N9-EX
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:59 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	CA/A8-05427-2CCE6165; Thu, 08 Oct 2015 22:22:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1444342976!18120671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25488 invoked from network); 8 Oct 2015 22:22:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:22:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaS-0007YV-OC
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaS-0004Gq-Lg
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:56 +0000
Date: Thu, 08 Oct 2015 22:22:56 +0000
Message-Id: <E1ZkJaS-0004Gq-Lg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: APERF/MPERF feature detect
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8db8887de6f53212e494e08c905d1d672081a01d
Author:     Wei Wang <wei.w.wang@intel.com>
AuthorDate: Mon Oct 5 18:16:39 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 18:16:39 2015 +0200

    x86: APERF/MPERF feature detect
    
    Add support to detect the APERF/MPERF feature. Also, remove the identical
    code in cpufreq.c and powernow.c.
    
    Signed-off-by: Wei Wang <wei.w.wang@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Cosmetics.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c  |    7 +++----
 xen/arch/x86/acpi/cpufreq/powernow.c |    7 +++----
 xen/arch/x86/cpu/common.c            |    4 ++++
 xen/include/asm-x86/cpufeature.h     |    5 +++++
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index ef79f77..a2ba0db 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -50,7 +50,6 @@ enum {
 };
 
 #define INTEL_MSR_RANGE         (0xffffull)
-#define CPUID_6_ECX_APERFMPERF_CAPABILITY       (0x1)
 
 struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
 
@@ -351,10 +350,10 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
 static void feature_detect(void *info)
 {
     struct cpufreq_policy *policy = info;
-    unsigned int eax, ecx;
+    unsigned int eax;
 
-    ecx = cpuid_ecx(6);
-    if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY) {
+    if ( cpu_has_aperfmperf )
+    {
         policy->aperf_mperf = 1;
         acpi_cpufreq_driver.getavg = get_measured_perf;
     }
diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index 4de6f8d..8f1ac74 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -37,7 +37,6 @@
 #include <acpi/acpi.h>
 #include <acpi/cpufreq/cpufreq.h>
 
-#define CPUID_6_ECX_APERFMPERF_CAPABILITY       (0x1)
 #define CPUID_FREQ_VOLT_CAPABILITIES    0x80000007
 #define CPB_CAPABLE             0x00000200
 #define USE_HW_PSTATE           0x00000080
@@ -211,10 +210,10 @@ static int powernow_cpufreq_verify(struct cpufreq_policy *policy)
 static void feature_detect(void *info)
 {
     struct cpufreq_policy *policy = info;
-    unsigned int ecx, edx;
+    unsigned int edx;
 
-    ecx = cpuid_ecx(6);
-    if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY) {
+    if ( cpu_has_aperfmperf )
+    {
         policy->aperf_mperf = 1;
         powernow_cpufreq_driver.getavg = get_measured_perf;
     }
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 0be0656..6da1471 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -239,6 +239,10 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	if ( cpu_has(c, X86_FEATURE_CLFLSH) )
 		c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
 
+	if ( (c->cpuid_level > CPUID_PM_LEAF) &&
+	     (cpuid_ecx(CPUID_PM_LEAF) & CPUID6_ECX_APERFMPERF_CAPABILITY) )
+		set_bit(X86_FEATURE_APERFMPERF, c->x86_capability);
+
 	/* AMD-defined flags: level 0x80000001 */
 	c->extended_cpuid_level = cpuid_eax(0x80000000);
 	if ( (c->extended_cpuid_level & 0xffff0000) == 0x80000000 ) {
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 6a94724..c88a6ab 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -73,6 +73,7 @@
 #define X86_FEATURE_XTOPOLOGY    (3*32+13) /* cpu topology enum extensions */
 #define X86_FEATURE_CPUID_FAULTING (3*32+14) /* cpuid faulting */
 #define X86_FEATURE_CLFLUSH_MONITOR (3*32+15) /* clflush reqd with monitor */
+#define X86_FEATURE_APERFMPERF   (3*32+16) /* APERFMPERF */
 
 /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
 #define X86_FEATURE_XMM3	(4*32+ 0) /* Streaming SIMD Extensions-3 */
@@ -169,6 +170,9 @@
 #define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
 #define CPUID5_ECX_INTERRUPT_BREAK      0x2
 
+#define CPUID_PM_LEAF                    6
+#define CPUID6_ECX_APERFMPERF_CAPABILITY 0x1
+
 #define cpu_has_vme		0
 #define cpu_has_de		1
 #define cpu_has_pse		1
@@ -194,6 +198,7 @@
 #define cpu_has_page1gb		boot_cpu_has(X86_FEATURE_PAGE1GB)
 #define cpu_has_efer		1
 #define cpu_has_fsgsbase	boot_cpu_has(X86_FEATURE_FSGSBASE)
+#define cpu_has_aperfmperf	boot_cpu_has(X86_FEATURE_APERFMPERF)
 
 #define cpu_has_smep            boot_cpu_has(X86_FEATURE_SMEP)
 #define cpu_has_smap            boot_cpu_has(X86_FEATURE_SMAP)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:23:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJaW-0008NK-LR; Thu, 08 Oct 2015 22:23: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 1ZkJaV-0008N9-EX
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:59 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	CA/A8-05427-2CCE6165; Thu, 08 Oct 2015 22:22:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1444342976!18120671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25488 invoked from network); 8 Oct 2015 22:22:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:22:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaS-0007YV-OC
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaS-0004Gq-Lg
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:22:56 +0000
Date: Thu, 08 Oct 2015 22:22:56 +0000
Message-Id: <E1ZkJaS-0004Gq-Lg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: APERF/MPERF feature detect
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8db8887de6f53212e494e08c905d1d672081a01d
Author:     Wei Wang <wei.w.wang@intel.com>
AuthorDate: Mon Oct 5 18:16:39 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 5 18:16:39 2015 +0200

    x86: APERF/MPERF feature detect
    
    Add support to detect the APERF/MPERF feature. Also, remove the identical
    code in cpufreq.c and powernow.c.
    
    Signed-off-by: Wei Wang <wei.w.wang@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Cosmetics.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c  |    7 +++----
 xen/arch/x86/acpi/cpufreq/powernow.c |    7 +++----
 xen/arch/x86/cpu/common.c            |    4 ++++
 xen/include/asm-x86/cpufeature.h     |    5 +++++
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index ef79f77..a2ba0db 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -50,7 +50,6 @@ enum {
 };
 
 #define INTEL_MSR_RANGE         (0xffffull)
-#define CPUID_6_ECX_APERFMPERF_CAPABILITY       (0x1)
 
 struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
 
@@ -351,10 +350,10 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
 static void feature_detect(void *info)
 {
     struct cpufreq_policy *policy = info;
-    unsigned int eax, ecx;
+    unsigned int eax;
 
-    ecx = cpuid_ecx(6);
-    if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY) {
+    if ( cpu_has_aperfmperf )
+    {
         policy->aperf_mperf = 1;
         acpi_cpufreq_driver.getavg = get_measured_perf;
     }
diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index 4de6f8d..8f1ac74 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -37,7 +37,6 @@
 #include <acpi/acpi.h>
 #include <acpi/cpufreq/cpufreq.h>
 
-#define CPUID_6_ECX_APERFMPERF_CAPABILITY       (0x1)
 #define CPUID_FREQ_VOLT_CAPABILITIES    0x80000007
 #define CPB_CAPABLE             0x00000200
 #define USE_HW_PSTATE           0x00000080
@@ -211,10 +210,10 @@ static int powernow_cpufreq_verify(struct cpufreq_policy *policy)
 static void feature_detect(void *info)
 {
     struct cpufreq_policy *policy = info;
-    unsigned int ecx, edx;
+    unsigned int edx;
 
-    ecx = cpuid_ecx(6);
-    if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY) {
+    if ( cpu_has_aperfmperf )
+    {
         policy->aperf_mperf = 1;
         powernow_cpufreq_driver.getavg = get_measured_perf;
     }
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 0be0656..6da1471 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -239,6 +239,10 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	if ( cpu_has(c, X86_FEATURE_CLFLSH) )
 		c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
 
+	if ( (c->cpuid_level > CPUID_PM_LEAF) &&
+	     (cpuid_ecx(CPUID_PM_LEAF) & CPUID6_ECX_APERFMPERF_CAPABILITY) )
+		set_bit(X86_FEATURE_APERFMPERF, c->x86_capability);
+
 	/* AMD-defined flags: level 0x80000001 */
 	c->extended_cpuid_level = cpuid_eax(0x80000000);
 	if ( (c->extended_cpuid_level & 0xffff0000) == 0x80000000 ) {
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 6a94724..c88a6ab 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -73,6 +73,7 @@
 #define X86_FEATURE_XTOPOLOGY    (3*32+13) /* cpu topology enum extensions */
 #define X86_FEATURE_CPUID_FAULTING (3*32+14) /* cpuid faulting */
 #define X86_FEATURE_CLFLUSH_MONITOR (3*32+15) /* clflush reqd with monitor */
+#define X86_FEATURE_APERFMPERF   (3*32+16) /* APERFMPERF */
 
 /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
 #define X86_FEATURE_XMM3	(4*32+ 0) /* Streaming SIMD Extensions-3 */
@@ -169,6 +170,9 @@
 #define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
 #define CPUID5_ECX_INTERRUPT_BREAK      0x2
 
+#define CPUID_PM_LEAF                    6
+#define CPUID6_ECX_APERFMPERF_CAPABILITY 0x1
+
 #define cpu_has_vme		0
 #define cpu_has_de		1
 #define cpu_has_pse		1
@@ -194,6 +198,7 @@
 #define cpu_has_page1gb		boot_cpu_has(X86_FEATURE_PAGE1GB)
 #define cpu_has_efer		1
 #define cpu_has_fsgsbase	boot_cpu_has(X86_FEATURE_FSGSBASE)
+#define cpu_has_aperfmperf	boot_cpu_has(X86_FEATURE_APERFMPERF)
 
 #define cpu_has_smep            boot_cpu_has(X86_FEATURE_SMEP)
 #define cpu_has_smap            boot_cpu_has(X86_FEATURE_SMAP)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:23:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJag-0008Oi-Qv; Thu, 08 Oct 2015 22:23: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 1ZkJaf-0008OV-Kw
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:09 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	1B/6C-01753-CCCE6165; Thu, 08 Oct 2015 22:23:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1444342987!17038453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23716 invoked from network); 8 Oct 2015 22:23:08 -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;
	8 Oct 2015 22:23:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJad-0007Z6-1i
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJac-0004HX-Vv
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:06 +0000
Date: Thu, 08 Oct 2015 22:23:06 +0000
Message-Id: <E1ZkJac-0004HX-Vv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/cpufreq: add a new driver
	interface, setpolicy()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b82467fe7d2a2c8a7d1280414ff2c996160a3fb
Author:     Wei Wang <wei.w.wang@intel.com>
AuthorDate: Tue Oct 6 17:37:48 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 6 17:37:48 2015 +0200

    x86/cpufreq: add a new driver interface, setpolicy()
    
    In order to better support future Intel processors, intel_pstate
    changes to use percentage values to tune P-states. The setpolicy
    driver interface is used to configure the intel_pstate internal
    policy. The __cpufreq_set_policy needs to be intercepted to use
    the setpolicy driver if it exists.
    
    Signed-off-by: Wei Wang <wei.w.wang@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/cpufreq/utility.c      |    3 +++
 xen/include/acpi/cpufreq/cpufreq.h |   14 ++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index 519f862..53879fe 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -456,6 +456,9 @@ int __cpufreq_set_policy(struct cpufreq_policy *data,
 
     data->min = policy->min;
     data->max = policy->max;
+    data->limits = policy->limits;
+    if (cpufreq_driver->setpolicy)
+        return cpufreq_driver->setpolicy(data);
 
     if (policy->governor != data->governor) {
         /* save old, working values */
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index f96c3e4..1ec04ca 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -41,6 +41,18 @@ struct cpufreq_cpuinfo {
     unsigned int        transition_latency; /* in 10^(-9) s = nanoseconds */
 };
 
+struct perf_limits {
+    bool_t no_turbo;
+    bool_t turbo_disabled;
+    uint32_t turbo_pct;
+    uint32_t max_perf_pct; /* max performance in percentage */
+    uint32_t min_perf_pct; /* min performance in percentage */
+    uint32_t max_perf;
+    uint32_t min_perf;
+    uint32_t max_policy_pct;
+    uint32_t min_policy_pct;
+};
+
 struct cpufreq_policy {
     cpumask_var_t       cpus;          /* affected CPUs */
     unsigned int        shared_type;   /* ANY or ALL affected CPUs
@@ -52,6 +64,7 @@ struct cpufreq_policy {
     unsigned int        max;    /* in kHz */
     unsigned int        cur;    /* in kHz, only needed if cpufreq
                                  * governors are used */
+    struct perf_limits  limits;
     struct cpufreq_governor     *governor;
 
     bool_t              resume; /* flag for cpufreq 1st run
@@ -145,6 +158,7 @@ struct cpufreq_driver {
     char   name[CPUFREQ_NAME_LEN];
     int    (*init)(struct cpufreq_policy *policy);
     int    (*verify)(struct cpufreq_policy *policy);
+    int    (*setpolicy)(struct cpufreq_policy *policy);
     int    (*update)(int cpuid, struct cpufreq_policy *policy);
     int    (*target)(struct cpufreq_policy *policy,
                      unsigned int target_freq,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:23:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJag-0008Oi-Qv; Thu, 08 Oct 2015 22:23: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 1ZkJaf-0008OV-Kw
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:09 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	1B/6C-01753-CCCE6165; Thu, 08 Oct 2015 22:23:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1444342987!17038453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23716 invoked from network); 8 Oct 2015 22:23:08 -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;
	8 Oct 2015 22:23:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJad-0007Z6-1i
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJac-0004HX-Vv
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:06 +0000
Date: Thu, 08 Oct 2015 22:23:06 +0000
Message-Id: <E1ZkJac-0004HX-Vv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/cpufreq: add a new driver
	interface, setpolicy()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b82467fe7d2a2c8a7d1280414ff2c996160a3fb
Author:     Wei Wang <wei.w.wang@intel.com>
AuthorDate: Tue Oct 6 17:37:48 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 6 17:37:48 2015 +0200

    x86/cpufreq: add a new driver interface, setpolicy()
    
    In order to better support future Intel processors, intel_pstate
    changes to use percentage values to tune P-states. The setpolicy
    driver interface is used to configure the intel_pstate internal
    policy. The __cpufreq_set_policy needs to be intercepted to use
    the setpolicy driver if it exists.
    
    Signed-off-by: Wei Wang <wei.w.wang@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/cpufreq/utility.c      |    3 +++
 xen/include/acpi/cpufreq/cpufreq.h |   14 ++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index 519f862..53879fe 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -456,6 +456,9 @@ int __cpufreq_set_policy(struct cpufreq_policy *data,
 
     data->min = policy->min;
     data->max = policy->max;
+    data->limits = policy->limits;
+    if (cpufreq_driver->setpolicy)
+        return cpufreq_driver->setpolicy(data);
 
     if (policy->governor != data->governor) {
         /* save old, working values */
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index f96c3e4..1ec04ca 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -41,6 +41,18 @@ struct cpufreq_cpuinfo {
     unsigned int        transition_latency; /* in 10^(-9) s = nanoseconds */
 };
 
+struct perf_limits {
+    bool_t no_turbo;
+    bool_t turbo_disabled;
+    uint32_t turbo_pct;
+    uint32_t max_perf_pct; /* max performance in percentage */
+    uint32_t min_perf_pct; /* min performance in percentage */
+    uint32_t max_perf;
+    uint32_t min_perf;
+    uint32_t max_policy_pct;
+    uint32_t min_policy_pct;
+};
+
 struct cpufreq_policy {
     cpumask_var_t       cpus;          /* affected CPUs */
     unsigned int        shared_type;   /* ANY or ALL affected CPUs
@@ -52,6 +64,7 @@ struct cpufreq_policy {
     unsigned int        max;    /* in kHz */
     unsigned int        cur;    /* in kHz, only needed if cpufreq
                                  * governors are used */
+    struct perf_limits  limits;
     struct cpufreq_governor     *governor;
 
     bool_t              resume; /* flag for cpufreq 1st run
@@ -145,6 +158,7 @@ struct cpufreq_driver {
     char   name[CPUFREQ_NAME_LEN];
     int    (*init)(struct cpufreq_policy *policy);
     int    (*verify)(struct cpufreq_policy *policy);
+    int    (*setpolicy)(struct cpufreq_policy *policy);
     int    (*update)(int cpuid, struct cpufreq_policy *policy);
     int    (*target)(struct cpufreq_policy *policy,
                      unsigned int target_freq,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:23:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJar-0008QX-0M; Thu, 08 Oct 2015 22:23: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 1ZkJaq-0008QE-0R
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:20 +0000
Content-Length: 2491
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	66/31-22142-7DCE6165; Thu, 08 Oct 2015 22:23:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1444342997!41000098!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6014 invoked from network); 8 Oct 2015 22:23:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:23:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJan-0007ZE-Df
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJan-0004IY-9o
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:17 +0000
Date: Thu, 08 Oct 2015 22:23:17 +0000
Message-Id: <E1ZkJan-0004IY-9o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vcpu: add missing dummy_vcpu_info to
	compat VCPUOP_initialise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1487084770497372418=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1487084770497372418==
Content-Length: 2099
Content-Transfer-Encoding: quoted-printable

commit 388d2a75c32196b8b9062413e1d52ce516f025a5
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Oct 6 17:38:41 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 6 17:38:41 2015 +0200

    vcpu: add missing dummy_vcpu_info to compat VCPUOP_initialise
    
    This check is missing from the compat version when compared to the
    non-compat version.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 xen/common/compat/domain.c |    3 +++
 xen/common/domain.c        |    2 +-
 xen/include/xen/shared.h   |    2 ++
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 3ca4ef7..157570a 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -38,6 +38,9 @@ int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) ar
     {
         struct compat_vcpu_guest_context *cmp_ctxt;
 
+        if ( v->vcpu_info =3D=3D &dummy_vcpu_info )
+            return -EINVAL;
+
         if ( (cmp_ctxt =3D xmalloc(struct compat_vcpu_guest_context)) =3D=3D NULL )
         {
             rc =3D -ENOMEM;
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 7c362eb..b0378aa 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -70,7 +70,7 @@ integer_param("hardware_dom", hardware_domid);
 
 struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
 
-static vcpu_info_t dummy_vcpu_info;
+vcpu_info_t dummy_vcpu_info;
 
 static void __domain_finalise_shutdown(struct domain *d)
 {
diff --git a/xen/include/xen/shared.h b/xen/include/xen/shared.h
index 3f5b283..a411a8a 100644
--- a/xen/include/xen/shared.h
+++ b/xen/include/xen/shared.h
@@ -41,6 +41,8 @@ typedef struct vcpu_info vcpu_info_t;
 
 #endif
 
+extern vcpu_info_t dummy_vcpu_info;
+
 #define shared_info(d, field)      __shared_info(d, (d)->shared_info, field)
 #define vcpu_info(v, field)        __vcpu_info(v, (v)->vcpu_info, field)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Oct 08 22:23:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZkJar-0008QX-0M; Thu, 08 Oct 2015 22:23: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 1ZkJaq-0008QE-0R
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:20 +0000
Content-Length: 2491
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	66/31-22142-7DCE6165; Thu, 08 Oct 2015 22:23:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1444342997!41000098!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6014 invoked from network); 8 Oct 2015 22:23:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:23:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJan-0007ZE-Df
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJan-0004IY-9o
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:17 +0000
Date: Thu, 08 Oct 2015 22:23:17 +0000
Message-Id: <E1ZkJan-0004IY-9o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vcpu: add missing dummy_vcpu_info to
	compat VCPUOP_initialise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1487084770497372418=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1487084770497372418==
Content-Length: 2099
Content-Transfer-Encoding: quoted-printable

commit 388d2a75c32196b8b9062413e1d52ce516f025a5
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Oct 6 17:38:41 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 6 17:38:41 2015 +0200

    vcpu: add missing dummy_vcpu_info to compat VCPUOP_initialise
    
    This check is missing from the compat version when compared to the
    non-compat version.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 xen/common/compat/domain.c |    3 +++
 xen/common/domain.c        |    2 +-
 xen/include/xen/shared.h   |    2 ++
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 3ca4ef7..157570a 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -38,6 +38,9 @@ int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) ar
     {
         struct compat_vcpu_guest_context *cmp_ctxt;
 
+        if ( v->vcpu_info =3D=3D &dummy_vcpu_info )
+            return -EINVAL;
+
         if ( (cmp_ctxt =3D xmalloc(struct compat_vcpu_guest_context)) =3D=3D NULL )
         {
             rc =3D -ENOMEM;
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 7c362eb..b0378aa 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -70,7 +70,7 @@ integer_param("hardware_dom", hardware_domid);
 
 struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
 
-static vcpu_info_t dummy_vcpu_info;
+vcpu_info_t dummy_vcpu_info;
 
 static void __domain_finalise_shutdown(struct domain *d)
 {
diff --git a/xen/include/xen/shared.h b/xen/include/xen/shared.h
index 3f5b283..a411a8a 100644
--- a/xen/include/xen/shared.h
+++ b/xen/include/xen/shared.h
@@ -41,6 +41,8 @@ typedef struct vcpu_info vcpu_info_t;
 
 #endif
 
+extern vcpu_info_t dummy_vcpu_info;
+
 #define shared_info(d, field)      __shared_info(d, (d)->shared_info, field)
 #define vcpu_info(v, field)        __vcpu_info(v, (v)->vcpu_info, field)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Oct 08 22:23:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23: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 1ZkJb1-0008Rs-3u; Thu, 08 Oct 2015 22:23:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaz-0008Rk-WE
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:30 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	C7/82-00536-1ECE6165; Thu, 08 Oct 2015 22:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1444343007!19697518!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9247 invoked from network); 8 Oct 2015 22:23:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:23:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJax-0007ZM-NA
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJax-0004J7-Jr
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:27 +0000
Date: Thu, 08 Oct 2015 22:23:27 +0000
Message-Id: <E1ZkJax-0004J7-Jr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: drop unused config variable
	CONFIG_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 375a410b24d9fb7058fc7a3fe101189fe737c08b
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Oct 6 17:39:33 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 6 17:39:33 2015 +0200

    build: drop unused config variable CONFIG_HVM
    
    CONFIG_HVM is not used anywhere in the build process so drop it.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 config/x86_32.mk |    1 -
 config/x86_64.mk |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/config/x86_32.mk b/config/x86_32.mk
index c2d785e..ed69447 100644
--- a/config/x86_32.mk
+++ b/config/x86_32.mk
@@ -2,7 +2,6 @@ CONFIG_X86 := y
 CONFIG_X86_32 := y
 CONFIG_X86_$(XEN_OS) := y
 
-CONFIG_HVM := y
 CONFIG_MIGRATE := y
 CONFIG_XCUTILS := y
 
diff --git a/config/x86_64.mk b/config/x86_64.mk
index bf104c2..f74611f 100644
--- a/config/x86_64.mk
+++ b/config/x86_64.mk
@@ -3,7 +3,6 @@ CONFIG_X86_64 := y
 CONFIG_X86_$(XEN_OS) := y
 
 CONFIG_COMPAT := y
-CONFIG_HVM := y
 CONFIG_MIGRATE := y
 CONFIG_XCUTILS := y
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 08 22:23:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23: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 1ZkJb1-0008Rs-3u; Thu, 08 Oct 2015 22:23:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJaz-0008Rk-WE
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:30 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	C7/82-00536-1ECE6165; Thu, 08 Oct 2015 22:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1444343007!19697518!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9247 invoked from network); 8 Oct 2015 22:23:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2015 22:23:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJax-0007ZM-NA
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJax-0004J7-Jr
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:27 +0000
Date: Thu, 08 Oct 2015 22:23:27 +0000
Message-Id: <E1ZkJax-0004J7-Jr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: drop unused config variable
	CONFIG_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 375a410b24d9fb7058fc7a3fe101189fe737c08b
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Oct 6 17:39:33 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 6 17:39:33 2015 +0200

    build: drop unused config variable CONFIG_HVM
    
    CONFIG_HVM is not used anywhere in the build process so drop it.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 config/x86_32.mk |    1 -
 config/x86_64.mk |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/config/x86_32.mk b/config/x86_32.mk
index c2d785e..ed69447 100644
--- a/config/x86_32.mk
+++ b/config/x86_32.mk
@@ -2,7 +2,6 @@ CONFIG_X86 := y
 CONFIG_X86_32 := y
 CONFIG_X86_$(XEN_OS) := y
 
-CONFIG_HVM := y
 CONFIG_MIGRATE := y
 CONFIG_XCUTILS := y
 
diff --git a/config/x86_64.mk b/config/x86_64.mk
index bf104c2..f74611f 100644
--- a/config/x86_64.mk
+++ b/config/x86_64.mk
@@ -3,7 +3,6 @@ CONFIG_X86_64 := y
 CONFIG_X86_$(XEN_OS) := y
 
 CONFIG_COMPAT := y
-CONFIG_HVM := y
 CONFIG_MIGRATE := y
 CONFIG_XCUTILS := y
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 08 22:23:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23: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 1ZkJbB-0008TB-6S; Thu, 08 Oct 2015 22:23:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJbA-0008T2-8m
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:40 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	8B/96-22089-BECE6165; Thu, 08 Oct 2015 22:23:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1444343018!41004584!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25481 invoked from network); 8 Oct 2015 22:23: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;
	8 Oct 2015 22:23:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJb8-0007ZU-0J
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJb7-0004Jj-UA
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:37 +0000
Date: Thu, 08 Oct 2015 22:23:37 +0000
Message-Id: <E1ZkJb7-0004Jj-UA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] flask: Allow initial domain to use
	XENPF_get_symbol
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a23ce429779011de127e8ff6c9bf3486d87154d5
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Sat Oct 3 15:22:29 2015 -0400
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CommitDate: Tue Oct 6 14:23:36 2015 -0400

    flask: Allow initial domain to use XENPF_get_symbol
    
    It looks to be missing in the policy file for the initial
    domain. Eventually we may want to extend this access to
    non-dom0 domains but for now it certainly dom0-only.
    
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/flask/policy/policy/modules/xen/xen.te |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 5e94ee3..d35ae22 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -71,6 +71,7 @@ allow dom0_t xen_t:xen2 {
 };
 allow dom0_t xen_t:xen2 {
     pmu_ctrl
+    get_symbol
 };
 allow dom0_t xen_t:mmu memorymap;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 22:23:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2015 22:23: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 1ZkJbB-0008TB-6S; Thu, 08 Oct 2015 22:23:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJbA-0008T2-8m
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:40 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	8B/96-22089-BECE6165; Thu, 08 Oct 2015 22:23:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1444343018!41004584!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25481 invoked from network); 8 Oct 2015 22:23: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;
	8 Oct 2015 22:23:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJb8-0007ZU-0J
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZkJb7-0004Jj-UA
	for xen-changelog@lists.xensource.com; Thu, 08 Oct 2015 22:23:37 +0000
Date: Thu, 08 Oct 2015 22:23:37 +0000
Message-Id: <E1ZkJb7-0004Jj-UA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] flask: Allow initial domain to use
	XENPF_get_symbol
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a23ce429779011de127e8ff6c9bf3486d87154d5
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Sat Oct 3 15:22:29 2015 -0400
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CommitDate: Tue Oct 6 14:23:36 2015 -0400

    flask: Allow initial domain to use XENPF_get_symbol
    
    It looks to be missing in the policy file for the initial
    domain. Eventually we may want to extend this access to
    non-dom0 domains but for now it certainly dom0-only.
    
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/flask/policy/policy/modules/xen/xen.te |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 5e94ee3..d35ae22 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -71,6 +71,7 @@ allow dom0_t xen_t:xen2 {
 };
 allow dom0_t xen_t:xen2 {
     pmu_ctrl
+    get_symbol
 };
 allow dom0_t xen_t:mmu memorymap;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Oct 11 21:00:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00: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 1ZlNj4-0000Xs-EP; Sun, 11 Oct 2015 21:00: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 1ZlNj2-0000Xk-Bq
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:12 +0000
Content-Length: 5143
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	03/8D-32641-BDDCA165; Sun, 11 Oct 2015 21:00:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1444597209!21067004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25917 invoked from network); 11 Oct 2015 21:00:10 -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;
	11 Oct 2015 21:00:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNiw-0005dt-6k
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNiv-0002E4-4i
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:05 +0000
Date: Sun, 11 Oct 2015 21:00:05 +0000
Message-Id: <E1ZlNiv-0002E4-4i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/xsm: Make p->policyvers be a
	local variable (ver) to shut up GCC 5.1.1 warnings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7064572185321178126=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7064572185321178126==
Content-Length: 4813
Content-Transfer-Encoding: quoted-printable

commit d3d476f505a124cd3d6ac7f5b2aedfe6c21fea86
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu Oct 8 11:33:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:33:28 2015 +0200

    xen/xsm: Make p->policyvers be a local variable (ver) to shut up GCC 5.1.1 warnings.
    
    policydb.c: In function =E2=80=98user_read=E2=80=99:
    policydb.c:1443:26: error: =E2=80=98buf[2]=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized]
             usrdatum->bounds =3D le32_to_cpu(buf[2]);
                              ^
    cc1: all warnings being treated as errors
    
    Which (as Andrew mentioned) is because GCC cannot assume
    that 'p->policyvers' has the same value between checks.
    
    We make it local, optimize the name to 'ver' and the warnings go away.
    We also update another call site with this modification to
    make it more inline with the rest of the functions.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 6a2f81459e1455d65a9a6f78dd2a0d0278619680
    master date: 2015-09-22 12:09:03 -0400
---
 xen/xsm/flask/ss/policydb.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 50b2c78..f4384eb 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1219,6 +1219,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     role =3D xzalloc(struct role_datum);
     if ( !role )
@@ -1227,7 +1228,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
         goto out;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1237,7 +1238,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     role->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         role->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1289,6 +1290,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[4];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     typdatum =3D xzalloc(struct type_datum);
     if ( !typdatum )
@@ -1297,7 +1299,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
         return rc;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
@@ -1307,7 +1309,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     typdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
     {
         u32 prop =3D le32_to_cpu(buf[2]);
 
@@ -1382,6 +1384,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     usrdatum =3D xzalloc(struct user_datum);
     if ( !usrdatum )
@@ -1390,7 +1393,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
         goto out;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1400,7 +1403,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     usrdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         usrdatum->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1418,7 +1421,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( rc )
         goto bad;
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_MLS )
+    if ( ver >=3D POLICYDB_VERSION_MLS )
     {
         rc =3D mls_read_range_helper(&usrdatum->range, fp);
         if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5


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

From xen-changelog-bounces@lists.xen.org Sun Oct 11 21:00:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00: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 1ZlNj4-0000Xs-EP; Sun, 11 Oct 2015 21:00: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 1ZlNj2-0000Xk-Bq
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:12 +0000
Content-Length: 5143
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	03/8D-32641-BDDCA165; Sun, 11 Oct 2015 21:00:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1444597209!21067004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25917 invoked from network); 11 Oct 2015 21:00:10 -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;
	11 Oct 2015 21:00:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNiw-0005dt-6k
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNiv-0002E4-4i
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:05 +0000
Date: Sun, 11 Oct 2015 21:00:05 +0000
Message-Id: <E1ZlNiv-0002E4-4i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xen/xsm: Make p->policyvers be a
	local variable (ver) to shut up GCC 5.1.1 warnings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7064572185321178126=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7064572185321178126==
Content-Length: 4813
Content-Transfer-Encoding: quoted-printable

commit d3d476f505a124cd3d6ac7f5b2aedfe6c21fea86
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu Oct 8 11:33:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:33:28 2015 +0200

    xen/xsm: Make p->policyvers be a local variable (ver) to shut up GCC 5.1.1 warnings.
    
    policydb.c: In function =E2=80=98user_read=E2=80=99:
    policydb.c:1443:26: error: =E2=80=98buf[2]=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized]
             usrdatum->bounds =3D le32_to_cpu(buf[2]);
                              ^
    cc1: all warnings being treated as errors
    
    Which (as Andrew mentioned) is because GCC cannot assume
    that 'p->policyvers' has the same value between checks.
    
    We make it local, optimize the name to 'ver' and the warnings go away.
    We also update another call site with this modification to
    make it more inline with the rest of the functions.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 6a2f81459e1455d65a9a6f78dd2a0d0278619680
    master date: 2015-09-22 12:09:03 -0400
---
 xen/xsm/flask/ss/policydb.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 50b2c78..f4384eb 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1219,6 +1219,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     role =3D xzalloc(struct role_datum);
     if ( !role )
@@ -1227,7 +1228,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
         goto out;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1237,7 +1238,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     role->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         role->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1289,6 +1290,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[4];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     typdatum =3D xzalloc(struct type_datum);
     if ( !typdatum )
@@ -1297,7 +1299,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
         return rc;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
@@ -1307,7 +1309,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     typdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
     {
         u32 prop =3D le32_to_cpu(buf[2]);
 
@@ -1382,6 +1384,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     usrdatum =3D xzalloc(struct user_datum);
     if ( !usrdatum )
@@ -1390,7 +1393,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
         goto out;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1400,7 +1403,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     usrdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         usrdatum->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1418,7 +1421,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( rc )
         goto bad;
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_MLS )
+    if ( ver >=3D POLICYDB_VERSION_MLS )
     {
         rc =3D mls_read_range_helper(&usrdatum->range, fp);
         if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5


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

From xen-changelog-bounces@lists.xen.org Sun Oct 11 21:00:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00: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 1ZlNjD-0000Yn-Gy; Sun, 11 Oct 2015 21:00: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 1ZlNjD-0000Yf-3v
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:23 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	F7/54-01421-6EDCA165; Sun, 11 Oct 2015 21:00:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1444597220!52124157!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7730 invoked from network); 11 Oct 2015 21:00:21 -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;
	11 Oct 2015 21:00:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjA-0005e1-BA
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNj9-0002ER-Fs
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:19 +0000
Date: Sun, 11 Oct 2015 21:00:19 +0000
Message-Id: <E1ZlNj9-0002ER-Fs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] vt-d: fix IM bit mask and unmask
	of Fault Event Control Register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b6e40c9d8853f9e555b4a18fa73c810852f723ba
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Oct 8 11:34:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:34:56 2015 +0200

    vt-d: fix IM bit mask and unmask of Fault Event Control Register
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    
    vt-d: fix IM bit unmask of Fault Event Control Register in init_vtd_hw()
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    master commit: 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9
    master date: 2015-09-25 09:08:22 +0200
    master commit: 26b300bd727ef00a8f60329212a83c3b027a48f7
    master date: 2015-09-25 18:03:04 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 5a946d4..c2e22a6 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -991,10 +991,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
     unsigned long flags;
+    u32 sts;
 
     /* unmask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts &= ~DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.masked = 0;
 }
@@ -1003,10 +1006,13 @@ static void dma_msi_mask(struct irq_desc *desc)
 {
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
+    u32 sts;
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts |= DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.masked = 1;
 }
@@ -2002,6 +2008,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2015,7 +2022,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
--
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 Sun Oct 11 21:00:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00: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 1ZlNjD-0000Yn-Gy; Sun, 11 Oct 2015 21:00: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 1ZlNjD-0000Yf-3v
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:23 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	F7/54-01421-6EDCA165; Sun, 11 Oct 2015 21:00:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1444597220!52124157!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7730 invoked from network); 11 Oct 2015 21:00:21 -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;
	11 Oct 2015 21:00:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjA-0005e1-BA
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNj9-0002ER-Fs
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:19 +0000
Date: Sun, 11 Oct 2015 21:00:19 +0000
Message-Id: <E1ZlNj9-0002ER-Fs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] vt-d: fix IM bit mask and unmask
	of Fault Event Control Register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b6e40c9d8853f9e555b4a18fa73c810852f723ba
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Oct 8 11:34:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:34:56 2015 +0200

    vt-d: fix IM bit mask and unmask of Fault Event Control Register
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    
    vt-d: fix IM bit unmask of Fault Event Control Register in init_vtd_hw()
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    master commit: 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9
    master date: 2015-09-25 09:08:22 +0200
    master commit: 26b300bd727ef00a8f60329212a83c3b027a48f7
    master date: 2015-09-25 18:03:04 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 5a946d4..c2e22a6 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -991,10 +991,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
     unsigned long flags;
+    u32 sts;
 
     /* unmask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts &= ~DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.masked = 0;
 }
@@ -1003,10 +1006,13 @@ static void dma_msi_mask(struct irq_desc *desc)
 {
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
+    u32 sts;
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts |= DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.masked = 1;
 }
@@ -2002,6 +2008,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2015,7 +2022,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
--
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 Sun Oct 11 21:00:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00: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 1ZlNjN-0000aP-Jb; Sun, 11 Oct 2015 21:00:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjN-0000aG-70
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:33 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	66/95-14422-0FDCA165; Sun, 11 Oct 2015 21:00:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1444597230!41479970!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14306 invoked from network); 11 Oct 2015 21:00:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2015 21:00:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjK-0005e9-Ni
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjK-0002Eo-JA
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:30 +0000
Date: Sun, 11 Oct 2015 21:00:30 +0000
Message-Id: <E1ZlNjK-0002Eo-JA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/EPT: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dde24142b34c64a03316fdaceb9a81db417c0ea5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 11:35:55 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:35:55 2015 +0200

    x86/EPT: tighten conditions of IOMMU mapping updates
    
    Permission changes should also result in updates or TLB flushes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 6c0e4ad60850032c9bbd5d18b8446421c97e08e4
    master date: 2015-09-29 10:25:29 +0200
---
 xen/arch/x86/mm/p2m-ept.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 06969eb..5e6ab3f 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -619,6 +619,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     uint8_t ipat = 0;
     int need_modify_vtd_table = 1;
     int vtd_pte_present = 0;
+    unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
     enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
@@ -749,8 +750,9 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         new_entry.mfn = mfn_x(mfn);
 
         /* Safe to read-then-write because we hold the p2m lock */
-        if ( ept_entry->mfn == new_entry.mfn )
-             need_modify_vtd_table = 0;
+        if ( ept_entry->mfn == new_entry.mfn &&
+             p2m_get_iommu_flags(ept_entry->sa_p2mt) == iommu_flags )
+            need_modify_vtd_table = 0;
 
         ept_p2m_type_to_flags(&new_entry, p2mt, p2ma);
     }
@@ -775,11 +777,9 @@ out:
             iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present);
         else
         {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
+            if ( iommu_flags )
                 for ( i = 0; i < (1 << order); i++ )
-                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, flags);
+                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, iommu_flags);
             else
                 for ( i = 0; i < (1 << order); i++ )
                     iommu_unmap_page(d, gfn + i);
--
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 Sun Oct 11 21:00:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00: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 1ZlNjN-0000aP-Jb; Sun, 11 Oct 2015 21:00:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjN-0000aG-70
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:33 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	66/95-14422-0FDCA165; Sun, 11 Oct 2015 21:00:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1444597230!41479970!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14306 invoked from network); 11 Oct 2015 21:00:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2015 21:00:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjK-0005e9-Ni
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjK-0002Eo-JA
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:30 +0000
Date: Sun, 11 Oct 2015 21:00:30 +0000
Message-Id: <E1ZlNjK-0002Eo-JA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/EPT: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dde24142b34c64a03316fdaceb9a81db417c0ea5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 11:35:55 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:35:55 2015 +0200

    x86/EPT: tighten conditions of IOMMU mapping updates
    
    Permission changes should also result in updates or TLB flushes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 6c0e4ad60850032c9bbd5d18b8446421c97e08e4
    master date: 2015-09-29 10:25:29 +0200
---
 xen/arch/x86/mm/p2m-ept.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 06969eb..5e6ab3f 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -619,6 +619,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     uint8_t ipat = 0;
     int need_modify_vtd_table = 1;
     int vtd_pte_present = 0;
+    unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
     enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
@@ -749,8 +750,9 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         new_entry.mfn = mfn_x(mfn);
 
         /* Safe to read-then-write because we hold the p2m lock */
-        if ( ept_entry->mfn == new_entry.mfn )
-             need_modify_vtd_table = 0;
+        if ( ept_entry->mfn == new_entry.mfn &&
+             p2m_get_iommu_flags(ept_entry->sa_p2mt) == iommu_flags )
+            need_modify_vtd_table = 0;
 
         ept_p2m_type_to_flags(&new_entry, p2mt, p2ma);
     }
@@ -775,11 +777,9 @@ out:
             iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present);
         else
         {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
-            if ( flags != 0 )
+            if ( iommu_flags )
                 for ( i = 0; i < (1 << order); i++ )
-                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, flags);
+                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, iommu_flags);
             else
                 for ( i = 0; i < (1 << order); i++ )
                     iommu_unmap_page(d, gfn + i);
--
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 Sun Oct 11 21:00:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00: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 1ZlNjY-0000cc-MD; Sun, 11 Oct 2015 21:00:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjX-0000cM-PA
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:43 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	E3/B5-01748-BFDCA165; Sun, 11 Oct 2015 21:00:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1444597241!52124202!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9225 invoked from network); 11 Oct 2015 21:00:42 -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;
	11 Oct 2015 21:00:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjV-0005eH-0c
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjU-0002FK-V3
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:40 +0000
Date: Sun, 11 Oct 2015 21:00:40 +0000
Message-Id: <E1ZlNjU-0002FK-V3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m-pt: delay freeing of
	intermediate page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4e18ecf958364c4fa3392355b7a67dff91704e8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 11:36:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:36:52 2015 +0200

    x86/p2m-pt: delay freeing of intermediate page tables
    
    Old intermediate page tables must be freed only after IOMMU side
    updates/flushes have got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 960265fbd878cdc9841473b755e4ccc9eb1942d2
    master date: 2015-09-29 13:55:34 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index e48b63a..45a2752 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -486,8 +486,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     /* XXX -- this might be able to be faster iff current->domain == d */
     void *table;
     unsigned long i, gfn_remainder = gfn;
-    l1_pgentry_t *p2m_entry;
-    l1_pgentry_t entry_content;
+    l1_pgentry_t *p2m_entry, entry_content;
+    /* Intermediate table to free if we're replacing it with a superpage. */
+    l1_pgentry_t intermediate_entry = l1e_empty();
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rc;
@@ -535,7 +536,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
      */
     if ( page_order == PAGE_ORDER_1G )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
@@ -545,7 +545,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -563,10 +563,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
     else 
     {
@@ -607,7 +603,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     }
     else if ( page_order == PAGE_ORDER_2M )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
@@ -619,7 +614,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -640,10 +635,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
@@ -671,6 +662,14 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
     }
 
+    /*
+     * Free old intermediate tables if necessary.  This has to be the
+     * last thing we do, after removal from the IOMMU tables, so as to
+     * avoid a potential use-after-free.
+     */
+    if ( l1e_get_flags(intermediate_entry) & _PAGE_PRESENT )
+        p2m_free_entry(p2m, &intermediate_entry, page_order);
+
  out:
     unmap_domain_page(table);
     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 Sun Oct 11 21:00:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00: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 1ZlNjY-0000cc-MD; Sun, 11 Oct 2015 21:00:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjX-0000cM-PA
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:43 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	E3/B5-01748-BFDCA165; Sun, 11 Oct 2015 21:00:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1444597241!52124202!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9225 invoked from network); 11 Oct 2015 21:00:42 -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;
	11 Oct 2015 21:00:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjV-0005eH-0c
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjU-0002FK-V3
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:40 +0000
Date: Sun, 11 Oct 2015 21:00:40 +0000
Message-Id: <E1ZlNjU-0002FK-V3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m-pt: delay freeing of
	intermediate page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4e18ecf958364c4fa3392355b7a67dff91704e8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 11:36:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:36:52 2015 +0200

    x86/p2m-pt: delay freeing of intermediate page tables
    
    Old intermediate page tables must be freed only after IOMMU side
    updates/flushes have got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 960265fbd878cdc9841473b755e4ccc9eb1942d2
    master date: 2015-09-29 13:55:34 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index e48b63a..45a2752 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -486,8 +486,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     /* XXX -- this might be able to be faster iff current->domain == d */
     void *table;
     unsigned long i, gfn_remainder = gfn;
-    l1_pgentry_t *p2m_entry;
-    l1_pgentry_t entry_content;
+    l1_pgentry_t *p2m_entry, entry_content;
+    /* Intermediate table to free if we're replacing it with a superpage. */
+    l1_pgentry_t intermediate_entry = l1e_empty();
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rc;
@@ -535,7 +536,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
      */
     if ( page_order == PAGE_ORDER_1G )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
@@ -545,7 +545,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -563,10 +563,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
     else 
     {
@@ -607,7 +603,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     }
     else if ( page_order == PAGE_ORDER_2M )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
@@ -619,7 +614,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -640,10 +635,6 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
@@ -671,6 +662,14 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
     }
 
+    /*
+     * Free old intermediate tables if necessary.  This has to be the
+     * last thing we do, after removal from the IOMMU tables, so as to
+     * avoid a potential use-after-free.
+     */
+    if ( l1e_get_flags(intermediate_entry) & _PAGE_PRESENT )
+        p2m_free_entry(p2m, &intermediate_entry, page_order);
+
  out:
     unmap_domain_page(table);
     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 Sun Oct 11 21:00:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlNji-0000eb-QY; Sun, 11 Oct 2015 21:00:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjh-0000eN-IN
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:53 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	13/02-16965-40ECA165; Sun, 11 Oct 2015 21:00:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1444597251!21067097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28708 invoked from network); 11 Oct 2015 21:00:52 -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;
	11 Oct 2015 21:00:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjf-0005eP-Cd
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjf-0002GF-7O
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:51 +0000
Date: Sun, 11 Oct 2015 21:00:51 +0000
Message-Id: <E1ZlNjf-0002GF-7O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m-pt: ignore pt-share flag
	for shadow mode guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 887da2bb47573ea8784f6b2be5a8d9af14846aac
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 11:37:19 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:37:19 2015 +0200

    x86/p2m-pt: ignore pt-share flag for shadow mode guests
    
    There is no page table sharing in shadow mode.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: c0a85795d864dd64c116af661bf676d66ddfd5fc
    master date: 2015-09-29 13:56:03 +0200
---
 xen/arch/x86/mm/p2m-pt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 45a2752..1b71a7d 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -644,7 +644,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
     if ( iommu_enabled && need_iommu(p2m->domain) )
     {
-        if ( iommu_hap_pt_share )
+        if ( iommu_use_hap_pt(p2m->domain) )
         {
             if ( old_mfn && (old_mfn != mfn_x(mfn)) )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
--
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 Sun Oct 11 21:00:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:00:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlNji-0000eb-QY; Sun, 11 Oct 2015 21:00:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjh-0000eN-IN
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:53 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	13/02-16965-40ECA165; Sun, 11 Oct 2015 21:00:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1444597251!21067097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28708 invoked from network); 11 Oct 2015 21:00:52 -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;
	11 Oct 2015 21:00:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjf-0005eP-Cd
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjf-0002GF-7O
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:00:51 +0000
Date: Sun, 11 Oct 2015 21:00:51 +0000
Message-Id: <E1ZlNjf-0002GF-7O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m-pt: ignore pt-share flag
	for shadow mode guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 887da2bb47573ea8784f6b2be5a8d9af14846aac
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 11:37:19 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:37:19 2015 +0200

    x86/p2m-pt: ignore pt-share flag for shadow mode guests
    
    There is no page table sharing in shadow mode.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: c0a85795d864dd64c116af661bf676d66ddfd5fc
    master date: 2015-09-29 13:56:03 +0200
---
 xen/arch/x86/mm/p2m-pt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 45a2752..1b71a7d 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -644,7 +644,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
     if ( iommu_enabled && need_iommu(p2m->domain) )
     {
-        if ( iommu_hap_pt_share )
+        if ( iommu_use_hap_pt(p2m->domain) )
         {
             if ( old_mfn && (old_mfn != mfn_x(mfn)) )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
--
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 Sun Oct 11 21:01:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:01: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 1ZlNju-0000gV-Dx; Sun, 11 Oct 2015 21:01: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 1ZlNjs-0000gC-Ju
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:04 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	41/C5-00475-F0ECA165; Sun, 11 Oct 2015 21:01:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1444597262!21536850!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23180 invoked from network); 11 Oct 2015 21:01:02 -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;
	11 Oct 2015 21:01:02 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjp-0005f0-Qp
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjp-0002Gn-LE
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:01 +0000
Date: Sun, 11 Oct 2015 21:01:01 +0000
Message-Id: <E1ZlNjp-0002Gn-LE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] credit1: fix tickling when it
	happens from a remote pCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b58d7b1bd95c8b7d7197f15b271c8bac8c41bca
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 8 11:38:05 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:38:05 2015 +0200

    credit1: fix tickling when it happens from a remote pCPU
    
    especially if that is also from a different cpupool than the
    processor of the vCPU that triggered the tickling.
    
    In fact, it is possible that we get as far as calling vcpu_unblock()-->
    vcpu_wake()-->csched_vcpu_wake()-->__runq_tickle() for the vCPU 'vc',
    but all while running on a pCPU that is different from 'vc->processor'.
    
    For instance, this can happen when an HVM domain runs in a cpupool,
    with a different scheduler than the default one, and issues IOREQs
    to Dom0, running in Pool-0 with the default scheduler.
    In fact, right in this case, the following crash can be observed:
    
    (XEN) ----[ Xen-4.7-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    7
    (XEN) RIP:    e008:[<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN) RFLAGS: 0000000000010086   CONTEXT: hypervisor (d1v0)
    (XEN) rax: 0000000000000001   rbx: ffff8303184fee00   rcx: 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen stack trace from rsp=ffff83031fa57a08:
    (XEN)    ffff82d0801fe664 ffff82d08033c820 0000000100000002 0000000a00000001
    (XEN)    0000000000006831 0000000000000000 0000000000000000 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN)    [<ffff82d08012348a>] csched_vcpu_wake+0x10b/0x110
    (XEN)    [<ffff82d08012b421>] vcpu_wake+0x20a/0x3ce
    (XEN)    [<ffff82d08012b91c>] vcpu_unblock+0x4b/0x4e
    (XEN)    [<ffff82d080167bd0>] vcpu_kick+0x17/0x61
    (XEN)    [<ffff82d080167c46>] vcpu_mark_events_pending+0x2c/0x2f
    (XEN)    [<ffff82d08010ac35>] evtchn_fifo_set_pending+0x381/0x3f6
    (XEN)    [<ffff82d08010a0f6>] notify_via_xen_event_channel+0xc9/0xd6
    (XEN)    [<ffff82d0801c29ed>] hvm_send_ioreq+0x3e9/0x441
    (XEN)    [<ffff82d0801bba7d>] hvmemul_do_io+0x23f/0x2d2
    (XEN)    [<ffff82d0801bbb43>] hvmemul_do_io_buffer+0x33/0x64
    (XEN)    [<ffff82d0801bc92b>] hvmemul_do_pio_buffer+0x35/0x37
    (XEN)    [<ffff82d0801cc49f>] handle_pio+0x58/0x14c
    (XEN)    [<ffff82d0801eabcb>] vmx_vmexit_handler+0x16b3/0x1bea
    (XEN)    [<ffff82d0801efd21>] vmx_asm_vmexit_handler+0x41/0xc0
    
    In this case, pCPU 7 is not in Pool-0, while the (Dom0's) vCPU being
    woken is. pCPU's 7 pool has a different scheduler than credit, but it
    is, however, right from pCPU 7 that we are waking the Dom0's vCPUs.
    Therefore, the current code tries to access csched_balance_mask for
    pCPU 7, but that is not defined, and hence the Oops.
    
    (Note that, in case the two pools run the same scheduler we see no
    Oops, but things are still conceptually wrong.)
    
    Cure things by making the csched_balance_mask macro accept a
    parameter for fetching a specific pCPU's mask (instead than always
    using smp_processor_id()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: ea5637968a09a81a64fa5fd73ce49b4ea9789e12
    master date: 2015-09-30 14:44:22 +0200
---
 xen/common/sched_credit.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index d7ec1db..7af910d 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -154,10 +154,10 @@ struct csched_pcpu {
  * Convenience macro for accessing the per-PCPU cpumask we need for
  * implementing the two steps (soft and hard affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
- * as there is a csched_pcpu for each PCPU and we always hold the
- * runqueue spin-lock when using this.
+ * as there is a csched_pcpu for each PCPU, and we always hold the
+ * runqueue lock for the proper PCPU when using this.
  */
-#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+#define csched_balance_mask(c) (CSCHED_PCPU(c)->balance_mask)
 
 /*
  * Virtual CPU
@@ -396,9 +396,10 @@ __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(csched_balance_mask, csched_balance_mask, &idle_mask);
-            new_idlers_empty = cpumask_empty(csched_balance_mask);
+                                   csched_balance_mask(cpu));
+            cpumask_and(csched_balance_mask(cpu),
+                        csched_balance_mask(cpu), &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask(cpu));
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1475,8 +1476,9 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
                  && !__vcpu_has_soft_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
-            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
-            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask(cpu));
+            if ( __csched_vcpu_is_migrateable(vc, cpu,
+                                              csched_balance_mask(cpu)) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
--
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 Sun Oct 11 21:01:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:01: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 1ZlNju-0000gV-Dx; Sun, 11 Oct 2015 21:01: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 1ZlNjs-0000gC-Ju
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:04 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	41/C5-00475-F0ECA165; Sun, 11 Oct 2015 21:01:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1444597262!21536850!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23180 invoked from network); 11 Oct 2015 21:01:02 -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;
	11 Oct 2015 21:01:02 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjp-0005f0-Qp
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNjp-0002Gn-LE
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:01 +0000
Date: Sun, 11 Oct 2015 21:01:01 +0000
Message-Id: <E1ZlNjp-0002Gn-LE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] credit1: fix tickling when it
	happens from a remote pCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b58d7b1bd95c8b7d7197f15b271c8bac8c41bca
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 8 11:38:05 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:38:05 2015 +0200

    credit1: fix tickling when it happens from a remote pCPU
    
    especially if that is also from a different cpupool than the
    processor of the vCPU that triggered the tickling.
    
    In fact, it is possible that we get as far as calling vcpu_unblock()-->
    vcpu_wake()-->csched_vcpu_wake()-->__runq_tickle() for the vCPU 'vc',
    but all while running on a pCPU that is different from 'vc->processor'.
    
    For instance, this can happen when an HVM domain runs in a cpupool,
    with a different scheduler than the default one, and issues IOREQs
    to Dom0, running in Pool-0 with the default scheduler.
    In fact, right in this case, the following crash can be observed:
    
    (XEN) ----[ Xen-4.7-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    7
    (XEN) RIP:    e008:[<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN) RFLAGS: 0000000000010086   CONTEXT: hypervisor (d1v0)
    (XEN) rax: 0000000000000001   rbx: ffff8303184fee00   rcx: 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen stack trace from rsp=ffff83031fa57a08:
    (XEN)    ffff82d0801fe664 ffff82d08033c820 0000000100000002 0000000a00000001
    (XEN)    0000000000006831 0000000000000000 0000000000000000 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN)    [<ffff82d08012348a>] csched_vcpu_wake+0x10b/0x110
    (XEN)    [<ffff82d08012b421>] vcpu_wake+0x20a/0x3ce
    (XEN)    [<ffff82d08012b91c>] vcpu_unblock+0x4b/0x4e
    (XEN)    [<ffff82d080167bd0>] vcpu_kick+0x17/0x61
    (XEN)    [<ffff82d080167c46>] vcpu_mark_events_pending+0x2c/0x2f
    (XEN)    [<ffff82d08010ac35>] evtchn_fifo_set_pending+0x381/0x3f6
    (XEN)    [<ffff82d08010a0f6>] notify_via_xen_event_channel+0xc9/0xd6
    (XEN)    [<ffff82d0801c29ed>] hvm_send_ioreq+0x3e9/0x441
    (XEN)    [<ffff82d0801bba7d>] hvmemul_do_io+0x23f/0x2d2
    (XEN)    [<ffff82d0801bbb43>] hvmemul_do_io_buffer+0x33/0x64
    (XEN)    [<ffff82d0801bc92b>] hvmemul_do_pio_buffer+0x35/0x37
    (XEN)    [<ffff82d0801cc49f>] handle_pio+0x58/0x14c
    (XEN)    [<ffff82d0801eabcb>] vmx_vmexit_handler+0x16b3/0x1bea
    (XEN)    [<ffff82d0801efd21>] vmx_asm_vmexit_handler+0x41/0xc0
    
    In this case, pCPU 7 is not in Pool-0, while the (Dom0's) vCPU being
    woken is. pCPU's 7 pool has a different scheduler than credit, but it
    is, however, right from pCPU 7 that we are waking the Dom0's vCPUs.
    Therefore, the current code tries to access csched_balance_mask for
    pCPU 7, but that is not defined, and hence the Oops.
    
    (Note that, in case the two pools run the same scheduler we see no
    Oops, but things are still conceptually wrong.)
    
    Cure things by making the csched_balance_mask macro accept a
    parameter for fetching a specific pCPU's mask (instead than always
    using smp_processor_id()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: ea5637968a09a81a64fa5fd73ce49b4ea9789e12
    master date: 2015-09-30 14:44:22 +0200
---
 xen/common/sched_credit.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index d7ec1db..7af910d 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -154,10 +154,10 @@ struct csched_pcpu {
  * Convenience macro for accessing the per-PCPU cpumask we need for
  * implementing the two steps (soft and hard affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
- * as there is a csched_pcpu for each PCPU and we always hold the
- * runqueue spin-lock when using this.
+ * as there is a csched_pcpu for each PCPU, and we always hold the
+ * runqueue lock for the proper PCPU when using this.
  */
-#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+#define csched_balance_mask(c) (CSCHED_PCPU(c)->balance_mask)
 
 /*
  * Virtual CPU
@@ -396,9 +396,10 @@ __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(csched_balance_mask, csched_balance_mask, &idle_mask);
-            new_idlers_empty = cpumask_empty(csched_balance_mask);
+                                   csched_balance_mask(cpu));
+            cpumask_and(csched_balance_mask(cpu),
+                        csched_balance_mask(cpu), &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask(cpu));
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1475,8 +1476,9 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
                  && !__vcpu_has_soft_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
-            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
-            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask(cpu));
+            if ( __csched_vcpu_is_migrateable(vc, cpu,
+                                              csched_balance_mask(cpu)) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
--
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 Sun Oct 11 21:01:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:01: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 1ZlNk4-0000if-It; Sun, 11 Oct 2015 21:01:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNk3-0000iJ-07
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:15 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	FA/8F-18744-A1ECA165; Sun, 11 Oct 2015 21:01:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1444597272!54897587!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 577 invoked from network); 11 Oct 2015 21:01:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2015 21:01:13 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNk0-0005f8-5L
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNk0-0002H9-1O
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:12 +0000
Date: Sun, 11 Oct 2015 21:01:12 +0000
Message-Id: <E1ZlNk0-0002H9-1O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m-pt: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db0f474646878b0e91fd14f53eec6adcacc4b5ba
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 11:38:44 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:38:44 2015 +0200

    x86/p2m-pt: tighten conditions of IOMMU mapping updates
    
    Whether the MFN changes does not depend on the new entry being valid
    (but solely on the old one), and the need to update or TLB-flush also
    depends on permission changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 660fd65d5578a95ec5eac522128bba23325179eb
    master date: 2015-10-02 13:40:36 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   74 +++++++++++++++++++++++++++++-----------------
 1 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 1b71a7d..78512e6 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -493,7 +493,18 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     l3_pgentry_t l3e_content;
     int rc;
     unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
-    unsigned long old_mfn = 0;
+    /*
+     * old_mfn and iommu_old_flags control possible flush/update needs on the
+     * IOMMU: We need to flush when MFN or flags (i.e. permissions) change.
+     * iommu_old_flags being initialized to zero covers the case of the entry
+     * getting replaced being a non-present (leaf or intermediate) one. For
+     * present leaf entries the real value will get calculated below, while
+     * for present intermediate entries ~0 (guaranteed != iommu_pte_flags)
+     * will be used (to cover all cases of what the leaf entries underneath
+     * the intermediate one might be).
+     */
+    unsigned int flags, iommu_old_flags = 0;
+    unsigned long old_mfn = INVALID_MFN;
 
     if ( tb_init_done )
     {
@@ -540,12 +551,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -556,10 +575,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l3e_content.l3;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -584,7 +600,10 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
+        iommu_old_flags =
+            p2m_get_iommu_flags(p2m_flags_to_type(l1e_get_flags(*p2m_entry)));
+        old_mfn = l1e_get_pfn(*p2m_entry);
+
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
                             || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
@@ -593,10 +612,8 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             entry_content = l1e_empty();
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
+
         /* level 1 entry */
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 1);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -607,14 +624,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
-        /* FIXME: Deal with 4k replaced by 2meg pages */
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -628,10 +651,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l2e_content.l2;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -642,17 +662,17 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
-    if ( iommu_enabled && need_iommu(p2m->domain) )
+    if ( iommu_enabled && need_iommu(p2m->domain) &&
+         (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
     {
         if ( iommu_use_hap_pt(p2m->domain) )
         {
-            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
+            if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
         else
         {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
+            flags = p2m_get_iommu_flags(p2mt);
             if ( flags != 0 )
                 for ( i = 0; i < (1UL << page_order); i++ )
                     iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
--
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 Sun Oct 11 21:01:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2015 21:01: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 1ZlNk4-0000if-It; Sun, 11 Oct 2015 21:01:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNk3-0000iJ-07
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:15 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	FA/8F-18744-A1ECA165; Sun, 11 Oct 2015 21:01:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1444597272!54897587!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 577 invoked from network); 11 Oct 2015 21:01:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2015 21:01:13 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNk0-0005f8-5L
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlNk0-0002H9-1O
	for xen-changelog@lists.xensource.com; Sun, 11 Oct 2015 21:01:12 +0000
Date: Sun, 11 Oct 2015 21:01:12 +0000
Message-Id: <E1ZlNk0-0002H9-1O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/p2m-pt: tighten conditions of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db0f474646878b0e91fd14f53eec6adcacc4b5ba
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 11:38:44 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:38:44 2015 +0200

    x86/p2m-pt: tighten conditions of IOMMU mapping updates
    
    Whether the MFN changes does not depend on the new entry being valid
    (but solely on the old one), and the need to update or TLB-flush also
    depends on permission changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 660fd65d5578a95ec5eac522128bba23325179eb
    master date: 2015-10-02 13:40:36 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   74 +++++++++++++++++++++++++++++-----------------
 1 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 1b71a7d..78512e6 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -493,7 +493,18 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     l3_pgentry_t l3e_content;
     int rc;
     unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
-    unsigned long old_mfn = 0;
+    /*
+     * old_mfn and iommu_old_flags control possible flush/update needs on the
+     * IOMMU: We need to flush when MFN or flags (i.e. permissions) change.
+     * iommu_old_flags being initialized to zero covers the case of the entry
+     * getting replaced being a non-present (leaf or intermediate) one. For
+     * present leaf entries the real value will get calculated below, while
+     * for present intermediate entries ~0 (guaranteed != iommu_pte_flags)
+     * will be used (to cover all cases of what the leaf entries underneath
+     * the intermediate one might be).
+     */
+    unsigned int flags, iommu_old_flags = 0;
+    unsigned long old_mfn = INVALID_MFN;
 
     if ( tb_init_done )
     {
@@ -540,12 +551,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -556,10 +575,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l3e_content.l3;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -584,7 +600,10 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
+        iommu_old_flags =
+            p2m_get_iommu_flags(p2m_flags_to_type(l1e_get_flags(*p2m_entry)));
+        old_mfn = l1e_get_pfn(*p2m_entry);
+
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
                             || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
@@ -593,10 +612,8 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             entry_content = l1e_empty();
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
+
         /* level 1 entry */
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 1);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -607,14 +624,20 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
-        /* FIXME: Deal with 4k replaced by 2meg pages */
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+            {
+                iommu_old_flags =
+                    p2m_get_iommu_flags(p2m_flags_to_type(flags));
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            }
+            else
+            {
+                iommu_old_flags = ~0;
+                intermediate_entry = *p2m_entry;
+            }
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -628,10 +651,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l2e_content.l2;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -642,17 +662,17 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
-    if ( iommu_enabled && need_iommu(p2m->domain) )
+    if ( iommu_enabled && need_iommu(p2m->domain) &&
+         (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
     {
         if ( iommu_use_hap_pt(p2m->domain) )
         {
-            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
+            if ( iommu_old_flags )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
         else
         {
-            unsigned int flags = p2m_get_iommu_flags(p2mt);
-
+            flags = p2m_get_iommu_flags(p2mt);
             if ( flags != 0 )
                 for ( i = 0; i < (1UL << page_order); i++ )
                     iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Mon Oct 12 01:44:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlS9o-0003RI-6S; Mon, 12 Oct 2015 01:44:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlS9n-0003R8-48
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:07 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	9A/C9-04752-6601B165; Mon, 12 Oct 2015 01:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444614244!57565154!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10923 invoked from network); 12 Oct 2015 01:44:05 -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;
	12 Oct 2015 01:44:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlS9k-0006fY-Pp
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlS9k-0005bE-Bz
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:04 +0000
Date: Mon, 12 Oct 2015 01:44:04 +0000
Message-Id: <E1ZlS9k-0005bE-Bz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/hvm: fix saved pmtimer and
	hpet values
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fbb3881ace18434b9490b74c067fd67bd9d681a5
Author:     Kouya Shimura <kouya@jp.fujitsu.com>
AuthorDate: Thu Oct 8 12:41:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:41:22 2015 +0200

    x86/hvm: fix saved pmtimer and hpet values
    
    The ACPI PM timer is sometimes broken on live migration.
    Since vcpu->arch.hvm_vcpu.guest_time is always zero in other than
    "delay for missed ticks mode". Even in "delay for missed ticks mode",
    vcpu's guest_time field is not valid (i.e. zero) when
    the state of vcpu is "blocked". (see pt_save_timer function)
    
    The original author (Tim Deegan) of pmtimer_save() must have intended
    that it saves the last scheduled time of the vcpu. Unfortunately it was
    already implied this bug. FYI, there is no other timer mode than
    "delay for missed ticks mode" then.
    
    For consistency with HPET, pmtimer_save() should refer hvm_get_guest_time()
    to update the counter as well as hpet_save() does.
    
    Without this patch, the clock of windows server 2012R2 without HPET
    might leap forward several minutes on live migration.
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    
    Retain use of ->arch.hvm_vcpu.guest_time when non-zero. Do the inverse
    adjustment for vHPET.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Kouya Shimura <kouya@jp.fujitsu.com>
    master commit: 244582a01dcb49fa30083725964a066937cc94f2
    master date: 2015-09-11 16:24:56 +0200
---
 xen/arch/x86/hvm/hpet.c    |    5 ++++-
 xen/arch/x86/hvm/pmtimer.c |   10 ++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 4324b52..97db87d 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -471,12 +471,15 @@ const struct hvm_mmio_handler hpet_mmio_handler = {
 static int hpet_save(struct domain *d, hvm_domain_context_t *h)
 {
     HPETState *hp = domain_vhpet(d);
+    struct vcpu *v = pt_global_vcpu_target(d);
     int rc;
 
     spin_lock(&hp->lock);
 
     /* Write the proper value into the main counter */
-    hp->hpet.mc64 = hp->mc_offset + guest_time_hpet(hp);
+    hp->hpet.mc64 = hp->mc_offset +
+                    (v->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(v)) /
+                    STIME_PER_HPET_TICK;
 
     /* Save the HPET registers */
     rc = _hvm_init_entry(h, HVM_SAVE_CODE(HPET), 0, HVM_SAVE_LENGTH(HPET));
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 6ad2797..0f79e84 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -250,10 +250,12 @@ static int pmtimer_save(struct domain *d, hvm_domain_context_t *h)
 
     spin_lock(&s->lock);
 
-    /* Update the counter to the guest's current time.  We always save
-     * with the domain paused, so the saved time should be after the
-     * last_gtime, but just in case, make sure we only go forwards */
-    x = ((s->vcpu->arch.hvm_vcpu.guest_time - s->last_gtime) * s->scale) >> 32;
+    /*
+     * Update the counter to the guest's current time.  Make sure it only
+     * goes forwards.
+     */
+    x = (((s->vcpu->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(s->vcpu)) -
+          s->last_gtime) * s->scale) >> 32;
     if ( x < 1UL<<31 )
         s->pm.tmr_val += x;
     if ( (s->pm.tmr_val & TMR_VAL_MSB) != msb )
--
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 Oct 12 01:44:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlS9o-0003RI-6S; Mon, 12 Oct 2015 01:44:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlS9n-0003R8-48
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:07 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	9A/C9-04752-6601B165; Mon, 12 Oct 2015 01:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444614244!57565154!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10923 invoked from network); 12 Oct 2015 01:44:05 -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;
	12 Oct 2015 01:44:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlS9k-0006fY-Pp
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlS9k-0005bE-Bz
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:04 +0000
Date: Mon, 12 Oct 2015 01:44:04 +0000
Message-Id: <E1ZlS9k-0005bE-Bz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/hvm: fix saved pmtimer and
	hpet values
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fbb3881ace18434b9490b74c067fd67bd9d681a5
Author:     Kouya Shimura <kouya@jp.fujitsu.com>
AuthorDate: Thu Oct 8 12:41:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:41:22 2015 +0200

    x86/hvm: fix saved pmtimer and hpet values
    
    The ACPI PM timer is sometimes broken on live migration.
    Since vcpu->arch.hvm_vcpu.guest_time is always zero in other than
    "delay for missed ticks mode". Even in "delay for missed ticks mode",
    vcpu's guest_time field is not valid (i.e. zero) when
    the state of vcpu is "blocked". (see pt_save_timer function)
    
    The original author (Tim Deegan) of pmtimer_save() must have intended
    that it saves the last scheduled time of the vcpu. Unfortunately it was
    already implied this bug. FYI, there is no other timer mode than
    "delay for missed ticks mode" then.
    
    For consistency with HPET, pmtimer_save() should refer hvm_get_guest_time()
    to update the counter as well as hpet_save() does.
    
    Without this patch, the clock of windows server 2012R2 without HPET
    might leap forward several minutes on live migration.
    
    Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
    
    Retain use of ->arch.hvm_vcpu.guest_time when non-zero. Do the inverse
    adjustment for vHPET.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Kouya Shimura <kouya@jp.fujitsu.com>
    master commit: 244582a01dcb49fa30083725964a066937cc94f2
    master date: 2015-09-11 16:24:56 +0200
---
 xen/arch/x86/hvm/hpet.c    |    5 ++++-
 xen/arch/x86/hvm/pmtimer.c |   10 ++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 4324b52..97db87d 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -471,12 +471,15 @@ const struct hvm_mmio_handler hpet_mmio_handler = {
 static int hpet_save(struct domain *d, hvm_domain_context_t *h)
 {
     HPETState *hp = domain_vhpet(d);
+    struct vcpu *v = pt_global_vcpu_target(d);
     int rc;
 
     spin_lock(&hp->lock);
 
     /* Write the proper value into the main counter */
-    hp->hpet.mc64 = hp->mc_offset + guest_time_hpet(hp);
+    hp->hpet.mc64 = hp->mc_offset +
+                    (v->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(v)) /
+                    STIME_PER_HPET_TICK;
 
     /* Save the HPET registers */
     rc = _hvm_init_entry(h, HVM_SAVE_CODE(HPET), 0, HVM_SAVE_LENGTH(HPET));
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 6ad2797..0f79e84 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -250,10 +250,12 @@ static int pmtimer_save(struct domain *d, hvm_domain_context_t *h)
 
     spin_lock(&s->lock);
 
-    /* Update the counter to the guest's current time.  We always save
-     * with the domain paused, so the saved time should be after the
-     * last_gtime, but just in case, make sure we only go forwards */
-    x = ((s->vcpu->arch.hvm_vcpu.guest_time - s->last_gtime) * s->scale) >> 32;
+    /*
+     * Update the counter to the guest's current time.  Make sure it only
+     * goes forwards.
+     */
+    x = (((s->vcpu->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(s->vcpu)) -
+          s->last_gtime) * s->scale) >> 32;
     if ( x < 1UL<<31 )
         s->pm.tmr_val += x;
     if ( (s->pm.tmr_val & TMR_VAL_MSB) != msb )
--
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 Oct 12 01:44:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01: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 1ZlSA4-0003TT-9R; Mon, 12 Oct 2015 01:44:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSA3-0003T5-90
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:23 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	E1/2E-22089-6701B165; Mon, 12 Oct 2015 01:44:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1444614261!41504961!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20173 invoked from network); 12 Oct 2015 01:44:22 -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;
	12 Oct 2015 01:44:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSA0-0006fd-5U
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlS9v-0005bd-0o
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:15 +0000
Date: Mon, 12 Oct 2015 01:44:15 +0000
Message-Id: <E1ZlS9v-0005bd-0o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m: fix mismatched unlock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4af95f46cefcb7a10cdaf72e0222bab2f290ae7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:42:16 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:42:16 2015 +0200

    x86/p2m: fix mismatched unlock
    
    Luckily, due to gfn_unlock() currently mapping to p2m_unlock(), this is
    only a cosmetic issue right now.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 1f180822ad3fe83fe293393ec175f14ded98f082
    master date: 2015-09-14 13:39:19 +0200
---
 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 26dd79a..4b4d856 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -774,7 +774,7 @@ set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
     omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
     if ( p2m_is_grant(ot) )
     {
-        p2m_unlock(p2m);
+        gfn_unlock(p2m, gfn, 0);
         domain_crash(d);
         return 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 Mon Oct 12 01:44:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01: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 1ZlSA4-0003TT-9R; Mon, 12 Oct 2015 01:44:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSA3-0003T5-90
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:23 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	E1/2E-22089-6701B165; Mon, 12 Oct 2015 01:44:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1444614261!41504961!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20173 invoked from network); 12 Oct 2015 01:44:22 -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;
	12 Oct 2015 01:44:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSA0-0006fd-5U
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlS9v-0005bd-0o
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:15 +0000
Date: Mon, 12 Oct 2015 01:44:15 +0000
Message-Id: <E1ZlS9v-0005bd-0o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m: fix mismatched unlock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4af95f46cefcb7a10cdaf72e0222bab2f290ae7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:42:16 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:42:16 2015 +0200

    x86/p2m: fix mismatched unlock
    
    Luckily, due to gfn_unlock() currently mapping to p2m_unlock(), this is
    only a cosmetic issue right now.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 1f180822ad3fe83fe293393ec175f14ded98f082
    master date: 2015-09-14 13:39:19 +0200
---
 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 26dd79a..4b4d856 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -774,7 +774,7 @@ set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
     omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
     if ( p2m_is_grant(ot) )
     {
-        p2m_unlock(p2m);
+        gfn_unlock(p2m, gfn, 0);
         domain_crash(d);
         return 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 Mon Oct 12 01:44:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlSAE-0003V6-Bu; Mon, 12 Oct 2015 01:44:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAD-0003Uw-EW
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:33 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	93/EE-01143-0801B165; Mon, 12 Oct 2015 01:44:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444614270!57565195!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12286 invoked from network); 12 Oct 2015 01:44:31 -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;
	12 Oct 2015 01:44:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAA-0006fo-D2
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAA-0005cr-Aw
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:30 +0000
Date: Mon, 12 Oct 2015 01:44:30 +0000
Message-Id: <E1ZlSAA-0005cr-Aw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/MSI: fail if no hardware
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 55d626318e9047cd38e1252906e1fbca123a5068
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:42:50 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:42:50 2015 +0200

    x86/MSI: fail if no hardware support
    
    This is to guard against buggy callers (luckily Dom0 only) invoking
    the respective hypercall for a device not being MSI-capable.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c7d5d5d8ea1ecbd6ef8b47dace4dec825f0f6e48
    master date: 2015-09-16 11:20:27 +0200
---
 xen/arch/x86/msi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 32a2594..13a17bf 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -566,6 +566,8 @@ static int msi_capability_init(struct pci_dev *dev,
 
     ASSERT(spin_is_locked(&pcidevs_lock));
     pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
+    if ( !pos )
+        return -ENODEV;
     control = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
     maxvec = multi_msi_capable(control);
     if ( nvec > maxvec )
--
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 Oct 12 01:44:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlSAE-0003V6-Bu; Mon, 12 Oct 2015 01:44:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAD-0003Uw-EW
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:33 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	93/EE-01143-0801B165; Mon, 12 Oct 2015 01:44:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444614270!57565195!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12286 invoked from network); 12 Oct 2015 01:44:31 -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;
	12 Oct 2015 01:44:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAA-0006fo-D2
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAA-0005cr-Aw
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:30 +0000
Date: Mon, 12 Oct 2015 01:44:30 +0000
Message-Id: <E1ZlSAA-0005cr-Aw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/MSI: fail if no hardware
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 55d626318e9047cd38e1252906e1fbca123a5068
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:42:50 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:42:50 2015 +0200

    x86/MSI: fail if no hardware support
    
    This is to guard against buggy callers (luckily Dom0 only) invoking
    the respective hypercall for a device not being MSI-capable.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c7d5d5d8ea1ecbd6ef8b47dace4dec825f0f6e48
    master date: 2015-09-16 11:20:27 +0200
---
 xen/arch/x86/msi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 32a2594..13a17bf 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -566,6 +566,8 @@ static int msi_capability_init(struct pci_dev *dev,
 
     ASSERT(spin_is_locked(&pcidevs_lock));
     pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
+    if ( !pos )
+        return -ENODEV;
     control = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
     maxvec = multi_msi_capable(control);
     if ( nvec > maxvec )
--
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 Oct 12 01:44:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01: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 1ZlSAR-0003Wz-ET; Mon, 12 Oct 2015 01:44:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAP-0003Wj-Tx
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:46 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	AC/44-22142-D801B165; Mon, 12 Oct 2015 01:44:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1444614280!36233795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22773 invoked from network); 12 Oct 2015 01:44:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2015 01:44:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAK-0006fw-Ka
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAK-0005dN-JL
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:40 +0000
Date: Mon, 12 Oct 2015 01:44:40 +0000
Message-Id: <E1ZlSAK-0005dN-JL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/sysctl: don't clobber memory
	if NCAPINTS > ARRAY_SIZE(pi->hw_cap)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef632a2d4c2e8d011ba747cef3722d9361739680
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 8 12:43:18 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:43:18 2015 +0200

    x86/sysctl: don't clobber memory if NCAPINTS > ARRAY_SIZE(pi->hw_cap)
    
    There is no current problem, as both NCAPINTS and pi->hw_cap are 8 entries,
    but the limit should be calculated appropriately so as to avoid hypervisor
    stack corruption if the two do get out of sync.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c373b912e74659f0e0898ae93e89513694cfd94e
    master date: 2015-09-16 11:22:00 +0200
---
 xen/arch/x86/sysctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 15d4b91..ee3b419 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -59,7 +59,8 @@ long cpu_down_helper(void *data)
 
 void arch_do_physinfo(xen_sysctl_physinfo_t *pi)
 {
-    memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4);
+    memcpy(pi->hw_cap, boot_cpu_data.x86_capability,
+           min(sizeof(pi->hw_cap), sizeof(boot_cpu_data.x86_capability)));
     if ( hvm_enabled )
         pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm;
     if ( iommu_enabled )
--
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 Oct 12 01:44:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01: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 1ZlSAR-0003Wz-ET; Mon, 12 Oct 2015 01:44:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAP-0003Wj-Tx
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:46 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	AC/44-22142-D801B165; Mon, 12 Oct 2015 01:44:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1444614280!36233795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22773 invoked from network); 12 Oct 2015 01:44:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2015 01:44:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAK-0006fw-Ka
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAK-0005dN-JL
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:40 +0000
Date: Mon, 12 Oct 2015 01:44:40 +0000
Message-Id: <E1ZlSAK-0005dN-JL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/sysctl: don't clobber memory
	if NCAPINTS > ARRAY_SIZE(pi->hw_cap)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef632a2d4c2e8d011ba747cef3722d9361739680
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 8 12:43:18 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:43:18 2015 +0200

    x86/sysctl: don't clobber memory if NCAPINTS > ARRAY_SIZE(pi->hw_cap)
    
    There is no current problem, as both NCAPINTS and pi->hw_cap are 8 entries,
    but the limit should be calculated appropriately so as to avoid hypervisor
    stack corruption if the two do get out of sync.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c373b912e74659f0e0898ae93e89513694cfd94e
    master date: 2015-09-16 11:22:00 +0200
---
 xen/arch/x86/sysctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 15d4b91..ee3b419 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -59,7 +59,8 @@ long cpu_down_helper(void *data)
 
 void arch_do_physinfo(xen_sysctl_physinfo_t *pi)
 {
-    memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4);
+    memcpy(pi->hw_cap, boot_cpu_data.x86_capability,
+           min(sizeof(pi->hw_cap), sizeof(boot_cpu_data.x86_capability)));
     if ( hvm_enabled )
         pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm;
     if ( iommu_enabled )
--
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 Oct 12 01:44:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:44:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlSAZ-0003YW-H9; Mon, 12 Oct 2015 01:44: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 1ZlSAX-0003Y0-Rh
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:54 +0000
Content-Length: 5212
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	1E/CD-05427-5901B165; Mon, 12 Oct 2015 01:44:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1444614290!54921620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3422 invoked from network); 12 Oct 2015 01:44:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2015 01:44:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAU-0006g4-QU
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAU-0005dq-PO
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:50 +0000
Date: Mon, 12 Oct 2015 01:44:50 +0000
Message-Id: <E1ZlSAU-0005dq-PO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/xsm: Make p->policyvers be a
	local variable (ver) to shut up GCC 5.1.1 warnings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5144563110354204149=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5144563110354204149==
Content-Length: 4882
Content-Transfer-Encoding: quoted-printable

commit 964150bf9deb592b972b0a28741cbd5e88469c3d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu Oct 8 12:43:53 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:43:53 2015 +0200

    xen/xsm: Make p->policyvers be a local variable (ver) to shut up GCC 5.1.1 warnings.
    
    policydb.c: In function =E2=80=98user_read=E2=80=99:
    policydb.c:1443:26: error: =E2=80=98buf[2]=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized]
             usrdatum->bounds =3D le32_to_cpu(buf[2]);
                              ^
    cc1: all warnings being treated as errors
    
    Which (as Andrew mentioned) is because GCC cannot assume
    that 'p->policyvers' has the same value between checks.
    
    We make it local, optimize the name to 'ver' and the warnings go away.
    We also update another call site with this modification to
    make it more inline with the rest of the functions.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 6a2f81459e1455d65a9a6f78dd2a0d0278619680
    master date: 2015-09-22 12:09:03 -0400
---
 xen/xsm/flask/ss/policydb.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index bdec4ac..32ea1c3 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1225,6 +1225,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     role =3D xmalloc(struct role_datum);
     if ( !role )
@@ -1234,7 +1235,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
     }
     memset(role, 0, sizeof(*role));
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1244,7 +1245,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     role->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         role->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1296,6 +1297,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[4];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     typdatum =3D xmalloc(struct type_datum);
     if ( !typdatum )
@@ -1305,7 +1307,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
     }
     memset(typdatum, 0, sizeof(*typdatum));
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
@@ -1315,7 +1317,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     typdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
     {
         u32 prop =3D le32_to_cpu(buf[2]);
 
@@ -1390,6 +1392,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     usrdatum =3D xmalloc(struct user_datum);
     if ( !usrdatum )
@@ -1399,7 +1402,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     }
     memset(usrdatum, 0, sizeof(*usrdatum));
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1409,7 +1412,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     usrdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         usrdatum->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1427,7 +1430,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( rc )
         goto bad;
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_MLS )
+    if ( ver >=3D POLICYDB_VERSION_MLS )
     {
         rc =3D mls_read_range_helper(&usrdatum->range, fp);
         if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4


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

From xen-changelog-bounces@lists.xen.org Mon Oct 12 01:44:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:44:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlSAZ-0003YW-H9; Mon, 12 Oct 2015 01:44: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 1ZlSAX-0003Y0-Rh
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:54 +0000
Content-Length: 5212
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	1E/CD-05427-5901B165; Mon, 12 Oct 2015 01:44:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1444614290!54921620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3422 invoked from network); 12 Oct 2015 01:44:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2015 01:44:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAU-0006g4-QU
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAU-0005dq-PO
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:44:50 +0000
Date: Mon, 12 Oct 2015 01:44:50 +0000
Message-Id: <E1ZlSAU-0005dq-PO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/xsm: Make p->policyvers be a
	local variable (ver) to shut up GCC 5.1.1 warnings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5144563110354204149=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5144563110354204149==
Content-Length: 4882
Content-Transfer-Encoding: quoted-printable

commit 964150bf9deb592b972b0a28741cbd5e88469c3d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu Oct 8 12:43:53 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:43:53 2015 +0200

    xen/xsm: Make p->policyvers be a local variable (ver) to shut up GCC 5.1.1 warnings.
    
    policydb.c: In function =E2=80=98user_read=E2=80=99:
    policydb.c:1443:26: error: =E2=80=98buf[2]=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized]
             usrdatum->bounds =3D le32_to_cpu(buf[2]);
                              ^
    cc1: all warnings being treated as errors
    
    Which (as Andrew mentioned) is because GCC cannot assume
    that 'p->policyvers' has the same value between checks.
    
    We make it local, optimize the name to 'ver' and the warnings go away.
    We also update another call site with this modification to
    make it more inline with the rest of the functions.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 6a2f81459e1455d65a9a6f78dd2a0d0278619680
    master date: 2015-09-22 12:09:03 -0400
---
 xen/xsm/flask/ss/policydb.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index bdec4ac..32ea1c3 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1225,6 +1225,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     role =3D xmalloc(struct role_datum);
     if ( !role )
@@ -1234,7 +1235,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
     }
     memset(role, 0, sizeof(*role));
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1244,7 +1245,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     role->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         role->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1296,6 +1297,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[4];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     typdatum =3D xmalloc(struct type_datum);
     if ( !typdatum )
@@ -1305,7 +1307,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
     }
     memset(typdatum, 0, sizeof(*typdatum));
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
@@ -1315,7 +1317,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     typdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
     {
         u32 prop =3D le32_to_cpu(buf[2]);
 
@@ -1390,6 +1392,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     usrdatum =3D xmalloc(struct user_datum);
     if ( !usrdatum )
@@ -1399,7 +1402,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     }
     memset(usrdatum, 0, sizeof(*usrdatum));
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1409,7 +1412,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     usrdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         usrdatum->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1427,7 +1430,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( rc )
         goto bad;
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_MLS )
+    if ( ver >=3D POLICYDB_VERSION_MLS )
     {
         rc =3D mls_read_range_helper(&usrdatum->range, fp);
         if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4


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

From xen-changelog-bounces@lists.xen.org Mon Oct 12 01:45:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:45:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlSAn-0003b0-Lz; Mon, 12 Oct 2015 01:45:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAm-0003ap-I1
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:08 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	7E/BA-19110-3A01B165; Mon, 12 Oct 2015 01:45:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1444614302!57538541!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29534 invoked from network); 12 Oct 2015 01:45: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;
	12 Oct 2015 01:45:03 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAg-0006h7-8s
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAf-0005eL-3t
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:01 +0000
Date: Mon, 12 Oct 2015 01:45:01 +0000
Message-Id: <E1ZlSAf-0005eL-3t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] vt-d: fix IM bit mask and unmask
	of Fault Event Control Register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2327dadbebf757b0aa6f45145fa0d8f4e065ed7c
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Oct 8 12:44:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:44:27 2015 +0200

    vt-d: fix IM bit mask and unmask of Fault Event Control Register
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    
    vt-d: fix IM bit unmask of Fault Event Control Register in init_vtd_hw()
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    master commit: 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9
    master date: 2015-09-25 09:08:22 +0200
    master commit: 26b300bd727ef00a8f60329212a83c3b027a48f7
    master date: 2015-09-25 18:03:04 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 3ba7cea..18324ac 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -992,10 +992,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
     unsigned long flags;
+    u32 sts;
 
     /* unmask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts &= ~DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.masked = 0;
 }
@@ -1004,10 +1007,13 @@ static void dma_msi_mask(struct irq_desc *desc)
 {
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
+    u32 sts;
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts |= DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.masked = 1;
 }
@@ -2055,6 +2061,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2068,7 +2075,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
--
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 Oct 12 01:45:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:45:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZlSAn-0003b0-Lz; Mon, 12 Oct 2015 01:45:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAm-0003ap-I1
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:08 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	7E/BA-19110-3A01B165; Mon, 12 Oct 2015 01:45:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1444614302!57538541!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29534 invoked from network); 12 Oct 2015 01:45: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;
	12 Oct 2015 01:45:03 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAg-0006h7-8s
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAf-0005eL-3t
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:01 +0000
Date: Mon, 12 Oct 2015 01:45:01 +0000
Message-Id: <E1ZlSAf-0005eL-3t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] vt-d: fix IM bit mask and unmask
	of Fault Event Control Register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2327dadbebf757b0aa6f45145fa0d8f4e065ed7c
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Thu Oct 8 12:44:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:44:27 2015 +0200

    vt-d: fix IM bit mask and unmask of Fault Event Control Register
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    
    vt-d: fix IM bit unmask of Fault Event Control Register in init_vtd_hw()
    
    Bit 0:29 in Fault Event Control Register are 'Reserved and Preserved',
    software cannot write 0 to it unconditionally. Software must preserve
    the value read for writes.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    master commit: 86f3ff9fc4cc3cb69b96c1de74bcc51f738fe2b9
    master date: 2015-09-25 09:08:22 +0200
    master commit: 26b300bd727ef00a8f60329212a83c3b027a48f7
    master date: 2015-09-25 18:03:04 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 3ba7cea..18324ac 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -992,10 +992,13 @@ static void dma_msi_unmask(struct irq_desc *desc)
 {
     struct iommu *iommu = desc->action->dev_id;
     unsigned long flags;
+    u32 sts;
 
     /* unmask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts &= ~DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.masked = 0;
 }
@@ -1004,10 +1007,13 @@ static void dma_msi_mask(struct irq_desc *desc)
 {
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
+    u32 sts;
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
-    dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
+    sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+    sts |= DMA_FECTL_IM;
+    dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     iommu->msi.msi_attrib.masked = 1;
 }
@@ -2055,6 +2061,7 @@ static int init_vtd_hw(void)
     struct iommu_flush *flush = NULL;
     int ret;
     unsigned long flags;
+    u32 sts;
 
     /*
      * Basic VT-d HW init: set VT-d interrupt, clear VT-d faults.  
@@ -2068,7 +2075,9 @@ static int init_vtd_hw(void)
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
-        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
+        sts = dmar_readl(iommu->reg, DMAR_FECTL_REG);
+        sts &= ~DMA_FECTL_IM;
+        dmar_writel(iommu->reg, DMAR_FECTL_REG, sts);
         spin_unlock_irqrestore(&iommu->register_lock, flags);
     }
 
--
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 Oct 12 01:45:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:45: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 1ZlSAu-0003cF-OH; Mon, 12 Oct 2015 01:45:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAt-0003bv-6X
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:15 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	E2/74-22142-AA01B165; Mon, 12 Oct 2015 01:45:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1444614313!11628644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16417 invoked from network); 12 Oct 2015 01:45:13 -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;
	12 Oct 2015 01:45:13 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAq-0006hF-SC
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAq-0005ez-QG
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:12 +0000
Date: Mon, 12 Oct 2015 01:45:12 +0000
Message-Id: <E1ZlSAq-0005ez-QG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m-pt: delay freeing of
	intermediate page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d17ce9b0a99cdb74fbbe9ac33aa0ce6e503aba1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:45:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:45:08 2015 +0200

    x86/p2m-pt: delay freeing of intermediate page tables
    
    Old intermediate page tables must be freed only after IOMMU side
    updates/flushes have got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 960265fbd878cdc9841473b755e4ccc9eb1942d2
    master date: 2015-09-29 13:55:34 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index a1d5650..3fe432f 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -284,8 +284,9 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     mfn_t table_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
     void *table =map_domain_page(mfn_x(table_mfn));
     unsigned long i, gfn_remainder = gfn;
-    l1_pgentry_t *p2m_entry;
-    l1_pgentry_t entry_content;
+    l1_pgentry_t *p2m_entry, entry_content;
+    /* Intermediate table to free if we're replacing it with a superpage. */
+    l1_pgentry_t intermediate_entry = l1e_empty();
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rv=0;
@@ -321,7 +322,6 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
      */
     if ( page_order == PAGE_ORDER_1G )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
@@ -331,7 +331,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -349,10 +349,6 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
     else if ( !p2m_next_level(p2m, &table_mfn, &table, &gfn_remainder, gfn,
                               L3_PAGETABLE_SHIFT - PAGE_SHIFT,
@@ -389,7 +385,6 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     }
     else if ( page_order == PAGE_ORDER_2M )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
@@ -401,7 +396,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -422,10 +417,6 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
@@ -452,6 +443,14 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
     }
 
+    /*
+     * Free old intermediate tables if necessary.  This has to be the
+     * last thing we do, after removal from the IOMMU tables, so as to
+     * avoid a potential use-after-free.
+     */
+    if ( l1e_get_flags(intermediate_entry) & _PAGE_PRESENT )
+        p2m_free_entry(p2m, &intermediate_entry, page_order);
+
     /* Success */
     rv = 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 Mon Oct 12 01:45:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:45: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 1ZlSAu-0003cF-OH; Mon, 12 Oct 2015 01:45:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAt-0003bv-6X
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:15 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	E2/74-22142-AA01B165; Mon, 12 Oct 2015 01:45:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1444614313!11628644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16417 invoked from network); 12 Oct 2015 01:45:13 -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;
	12 Oct 2015 01:45:13 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAq-0006hF-SC
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSAq-0005ez-QG
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:12 +0000
Date: Mon, 12 Oct 2015 01:45:12 +0000
Message-Id: <E1ZlSAq-0005ez-QG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m-pt: delay freeing of
	intermediate page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d17ce9b0a99cdb74fbbe9ac33aa0ce6e503aba1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:45:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:45:08 2015 +0200

    x86/p2m-pt: delay freeing of intermediate page tables
    
    Old intermediate page tables must be freed only after IOMMU side
    updates/flushes have got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 960265fbd878cdc9841473b755e4ccc9eb1942d2
    master date: 2015-09-29 13:55:34 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index a1d5650..3fe432f 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -284,8 +284,9 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     mfn_t table_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
     void *table =map_domain_page(mfn_x(table_mfn));
     unsigned long i, gfn_remainder = gfn;
-    l1_pgentry_t *p2m_entry;
-    l1_pgentry_t entry_content;
+    l1_pgentry_t *p2m_entry, entry_content;
+    /* Intermediate table to free if we're replacing it with a superpage. */
+    l1_pgentry_t intermediate_entry = l1e_empty();
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rv=0;
@@ -321,7 +322,6 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
      */
     if ( page_order == PAGE_ORDER_1G )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
@@ -331,7 +331,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -349,10 +349,6 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
     else if ( !p2m_next_level(p2m, &table_mfn, &table, &gfn_remainder, gfn,
                               L3_PAGETABLE_SHIFT - PAGE_SHIFT,
@@ -389,7 +385,6 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     }
     else if ( page_order == PAGE_ORDER_2M )
     {
-        l1_pgentry_t old_entry = l1e_empty();
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
@@ -401,7 +396,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         {
             /* We're replacing a non-SP page with a superpage.  Make sure to
              * handle freeing the table properly. */
-            old_entry = *p2m_entry;
+            intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -422,10 +417,6 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
-
-        /* Free old intermediate tables if necessary */
-        if ( l1e_get_flags(old_entry) & _PAGE_PRESENT )
-            p2m_free_entry(p2m, &old_entry, page_order);
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
@@ -452,6 +443,14 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
     }
 
+    /*
+     * Free old intermediate tables if necessary.  This has to be the
+     * last thing we do, after removal from the IOMMU tables, so as to
+     * avoid a potential use-after-free.
+     */
+    if ( l1e_get_flags(intermediate_entry) & _PAGE_PRESENT )
+        p2m_free_entry(p2m, &intermediate_entry, page_order);
+
     /* Success */
     rv = 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 Mon Oct 12 01:45:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01: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 1ZlSB4-0003du-Qi; Mon, 12 Oct 2015 01:45:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSB3-0003dh-Jy
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:25 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	58/31-25435-5B01B165; Mon, 12 Oct 2015 01:45:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444614323!57565289!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14606 invoked from network); 12 Oct 2015 01:45:24 -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;
	12 Oct 2015 01:45:24 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSB1-0006hN-3W
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSB1-0005fZ-1j
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:23 +0000
Date: Mon, 12 Oct 2015 01:45:23 +0000
Message-Id: <E1ZlSB1-0005fZ-1j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m-pt: ignore pt-share flag
	for shadow mode guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 03f29a83fbee2b8f9e9c0c0c63da836a4411f1c9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:45:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:45:34 2015 +0200

    x86/p2m-pt: ignore pt-share flag for shadow mode guests
    
    There is no page table sharing in shadow mode.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: c0a85795d864dd64c116af661bf676d66ddfd5fc
    master date: 2015-09-29 13:56:03 +0200
---
 xen/arch/x86/mm/p2m-pt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 3fe432f..cd40a21 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -426,7 +426,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
     if ( iommu_enabled && need_iommu(p2m->domain) )
     {
-        if ( iommu_hap_pt_share )
+        if ( iommu_use_hap_pt(p2m->domain) )
         {
             if ( old_mfn && (old_mfn != mfn_x(mfn)) )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
--
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 Oct 12 01:45:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01: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 1ZlSB4-0003du-Qi; Mon, 12 Oct 2015 01:45:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSB3-0003dh-Jy
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:25 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	58/31-25435-5B01B165; Mon, 12 Oct 2015 01:45:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1444614323!57565289!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14606 invoked from network); 12 Oct 2015 01:45:24 -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;
	12 Oct 2015 01:45:24 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSB1-0006hN-3W
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSB1-0005fZ-1j
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:23 +0000
Date: Mon, 12 Oct 2015 01:45:23 +0000
Message-Id: <E1ZlSB1-0005fZ-1j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m-pt: ignore pt-share flag
	for shadow mode guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 03f29a83fbee2b8f9e9c0c0c63da836a4411f1c9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:45:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:45:34 2015 +0200

    x86/p2m-pt: ignore pt-share flag for shadow mode guests
    
    There is no page table sharing in shadow mode.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: c0a85795d864dd64c116af661bf676d66ddfd5fc
    master date: 2015-09-29 13:56:03 +0200
---
 xen/arch/x86/mm/p2m-pt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 3fe432f..cd40a21 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -426,7 +426,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
     if ( iommu_enabled && need_iommu(p2m->domain) )
     {
-        if ( iommu_hap_pt_share )
+        if ( iommu_use_hap_pt(p2m->domain) )
         {
             if ( old_mfn && (old_mfn != mfn_x(mfn)) )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
--
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 Oct 12 01:45:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01: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 1ZlSBF-0003fs-TB; Mon, 12 Oct 2015 01:45:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBE-0003fc-B0
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:36 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	B3/C0-01753-FB01B165; Mon, 12 Oct 2015 01:45:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1444614333!21091010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32635 invoked from network); 12 Oct 2015 01:45:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2015 01:45:34 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBB-0006hV-FA
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBB-0005gV-Bp
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:33 +0000
Date: Mon, 12 Oct 2015 01:45:33 +0000
Message-Id: <E1ZlSBB-0005gV-Bp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] credit1: fix tickling when it
	happens from a remote pCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59670732ca1a90977b8a3636e1bd2ef23486e57e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 8 12:46:06 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:46:06 2015 +0200

    credit1: fix tickling when it happens from a remote pCPU
    
    especially if that is also from a different cpupool than the
    processor of the vCPU that triggered the tickling.
    
    In fact, it is possible that we get as far as calling vcpu_unblock()-->
    vcpu_wake()-->csched_vcpu_wake()-->__runq_tickle() for the vCPU 'vc',
    but all while running on a pCPU that is different from 'vc->processor'.
    
    For instance, this can happen when an HVM domain runs in a cpupool,
    with a different scheduler than the default one, and issues IOREQs
    to Dom0, running in Pool-0 with the default scheduler.
    In fact, right in this case, the following crash can be observed:
    
    (XEN) ----[ Xen-4.7-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    7
    (XEN) RIP:    e008:[<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN) RFLAGS: 0000000000010086   CONTEXT: hypervisor (d1v0)
    (XEN) rax: 0000000000000001   rbx: ffff8303184fee00   rcx: 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen stack trace from rsp=ffff83031fa57a08:
    (XEN)    ffff82d0801fe664 ffff82d08033c820 0000000100000002 0000000a00000001
    (XEN)    0000000000006831 0000000000000000 0000000000000000 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN)    [<ffff82d08012348a>] csched_vcpu_wake+0x10b/0x110
    (XEN)    [<ffff82d08012b421>] vcpu_wake+0x20a/0x3ce
    (XEN)    [<ffff82d08012b91c>] vcpu_unblock+0x4b/0x4e
    (XEN)    [<ffff82d080167bd0>] vcpu_kick+0x17/0x61
    (XEN)    [<ffff82d080167c46>] vcpu_mark_events_pending+0x2c/0x2f
    (XEN)    [<ffff82d08010ac35>] evtchn_fifo_set_pending+0x381/0x3f6
    (XEN)    [<ffff82d08010a0f6>] notify_via_xen_event_channel+0xc9/0xd6
    (XEN)    [<ffff82d0801c29ed>] hvm_send_ioreq+0x3e9/0x441
    (XEN)    [<ffff82d0801bba7d>] hvmemul_do_io+0x23f/0x2d2
    (XEN)    [<ffff82d0801bbb43>] hvmemul_do_io_buffer+0x33/0x64
    (XEN)    [<ffff82d0801bc92b>] hvmemul_do_pio_buffer+0x35/0x37
    (XEN)    [<ffff82d0801cc49f>] handle_pio+0x58/0x14c
    (XEN)    [<ffff82d0801eabcb>] vmx_vmexit_handler+0x16b3/0x1bea
    (XEN)    [<ffff82d0801efd21>] vmx_asm_vmexit_handler+0x41/0xc0
    
    In this case, pCPU 7 is not in Pool-0, while the (Dom0's) vCPU being
    woken is. pCPU's 7 pool has a different scheduler than credit, but it
    is, however, right from pCPU 7 that we are waking the Dom0's vCPUs.
    Therefore, the current code tries to access csched_balance_mask for
    pCPU 7, but that is not defined, and hence the Oops.
    
    (Note that, in case the two pools run the same scheduler we see no
    Oops, but things are still conceptually wrong.)
    
    Cure things by making the csched_balance_mask macro accept a
    parameter for fetching a specific pCPU's mask (instead than always
    using smp_processor_id()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: ea5637968a09a81a64fa5fd73ce49b4ea9789e12
    master date: 2015-09-30 14:44:22 +0200
---
 xen/common/sched_credit.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 1d38adb..81f3510 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -140,10 +140,10 @@ struct csched_pcpu {
  * Convenience macro for accessing the per-PCPU cpumask we need for
  * implementing the two steps (vcpu and node affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
- * as there is a csched_pcpu for each PCPU and we always hold the
- * runqueue spin-lock when using this.
+ * as there is a csched_pcpu for each PCPU, and we always hold the
+ * runqueue lock for the proper PCPU when using this.
  */
-#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+#define csched_balance_mask(c) (CSCHED_PCPU(c)->balance_mask)
 
 /*
  * Virtual CPU
@@ -417,9 +417,10 @@ __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(csched_balance_mask, csched_balance_mask, &idle_mask);
-            new_idlers_empty = cpumask_empty(csched_balance_mask);
+                                   csched_balance_mask(cpu));
+            cpumask_and(csched_balance_mask(cpu),
+                        csched_balance_mask(cpu), &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask(cpu));
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1506,8 +1507,9 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
                  && !__vcpu_has_node_affinity(vc, vc->cpu_affinity) )
                 continue;
 
-            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
-            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask(cpu));
+            if ( __csched_vcpu_is_migrateable(vc, cpu,
+                                              csched_balance_mask(cpu)) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
--
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 Oct 12 01:45:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01: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 1ZlSBF-0003fs-TB; Mon, 12 Oct 2015 01:45:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBE-0003fc-B0
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:36 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	B3/C0-01753-FB01B165; Mon, 12 Oct 2015 01:45:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1444614333!21091010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32635 invoked from network); 12 Oct 2015 01:45:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2015 01:45:34 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBB-0006hV-FA
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBB-0005gV-Bp
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:33 +0000
Date: Mon, 12 Oct 2015 01:45:33 +0000
Message-Id: <E1ZlSBB-0005gV-Bp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] credit1: fix tickling when it
	happens from a remote pCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59670732ca1a90977b8a3636e1bd2ef23486e57e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 8 12:46:06 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:46:06 2015 +0200

    credit1: fix tickling when it happens from a remote pCPU
    
    especially if that is also from a different cpupool than the
    processor of the vCPU that triggered the tickling.
    
    In fact, it is possible that we get as far as calling vcpu_unblock()-->
    vcpu_wake()-->csched_vcpu_wake()-->__runq_tickle() for the vCPU 'vc',
    but all while running on a pCPU that is different from 'vc->processor'.
    
    For instance, this can happen when an HVM domain runs in a cpupool,
    with a different scheduler than the default one, and issues IOREQs
    to Dom0, running in Pool-0 with the default scheduler.
    In fact, right in this case, the following crash can be observed:
    
    (XEN) ----[ Xen-4.7-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    7
    (XEN) RIP:    e008:[<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN) RFLAGS: 0000000000010086   CONTEXT: hypervisor (d1v0)
    (XEN) rax: 0000000000000001   rbx: ffff8303184fee00   rcx: 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen stack trace from rsp=ffff83031fa57a08:
    (XEN)    ffff82d0801fe664 ffff82d08033c820 0000000100000002 0000000a00000001
    (XEN)    0000000000006831 0000000000000000 0000000000000000 0000000000000000
    (XEN) ... ... ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801230de>] __runq_tickle+0x18f/0x430
    (XEN)    [<ffff82d08012348a>] csched_vcpu_wake+0x10b/0x110
    (XEN)    [<ffff82d08012b421>] vcpu_wake+0x20a/0x3ce
    (XEN)    [<ffff82d08012b91c>] vcpu_unblock+0x4b/0x4e
    (XEN)    [<ffff82d080167bd0>] vcpu_kick+0x17/0x61
    (XEN)    [<ffff82d080167c46>] vcpu_mark_events_pending+0x2c/0x2f
    (XEN)    [<ffff82d08010ac35>] evtchn_fifo_set_pending+0x381/0x3f6
    (XEN)    [<ffff82d08010a0f6>] notify_via_xen_event_channel+0xc9/0xd6
    (XEN)    [<ffff82d0801c29ed>] hvm_send_ioreq+0x3e9/0x441
    (XEN)    [<ffff82d0801bba7d>] hvmemul_do_io+0x23f/0x2d2
    (XEN)    [<ffff82d0801bbb43>] hvmemul_do_io_buffer+0x33/0x64
    (XEN)    [<ffff82d0801bc92b>] hvmemul_do_pio_buffer+0x35/0x37
    (XEN)    [<ffff82d0801cc49f>] handle_pio+0x58/0x14c
    (XEN)    [<ffff82d0801eabcb>] vmx_vmexit_handler+0x16b3/0x1bea
    (XEN)    [<ffff82d0801efd21>] vmx_asm_vmexit_handler+0x41/0xc0
    
    In this case, pCPU 7 is not in Pool-0, while the (Dom0's) vCPU being
    woken is. pCPU's 7 pool has a different scheduler than credit, but it
    is, however, right from pCPU 7 that we are waking the Dom0's vCPUs.
    Therefore, the current code tries to access csched_balance_mask for
    pCPU 7, but that is not defined, and hence the Oops.
    
    (Note that, in case the two pools run the same scheduler we see no
    Oops, but things are still conceptually wrong.)
    
    Cure things by making the csched_balance_mask macro accept a
    parameter for fetching a specific pCPU's mask (instead than always
    using smp_processor_id()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: ea5637968a09a81a64fa5fd73ce49b4ea9789e12
    master date: 2015-09-30 14:44:22 +0200
---
 xen/common/sched_credit.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 1d38adb..81f3510 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -140,10 +140,10 @@ struct csched_pcpu {
  * Convenience macro for accessing the per-PCPU cpumask we need for
  * implementing the two steps (vcpu and node affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
- * as there is a csched_pcpu for each PCPU and we always hold the
- * runqueue spin-lock when using this.
+ * as there is a csched_pcpu for each PCPU, and we always hold the
+ * runqueue lock for the proper PCPU when using this.
  */
-#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+#define csched_balance_mask(c) (CSCHED_PCPU(c)->balance_mask)
 
 /*
  * Virtual CPU
@@ -417,9 +417,10 @@ __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(csched_balance_mask, csched_balance_mask, &idle_mask);
-            new_idlers_empty = cpumask_empty(csched_balance_mask);
+                                   csched_balance_mask(cpu));
+            cpumask_and(csched_balance_mask(cpu),
+                        csched_balance_mask(cpu), &idle_mask);
+            new_idlers_empty = cpumask_empty(csched_balance_mask(cpu));
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
@@ -1506,8 +1507,9 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
                  && !__vcpu_has_node_affinity(vc, vc->cpu_affinity) )
                 continue;
 
-            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
-            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask(cpu));
+            if ( __csched_vcpu_is_migrateable(vc, cpu,
+                                              csched_balance_mask(cpu)) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
--
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 Oct 12 01:45:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:45: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 1ZlSBP-0003hY-Vt; Mon, 12 Oct 2015 01:45:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBO-0003hG-A6
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:46 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	0C/1C-30270-9C01B165; Mon, 12 Oct 2015 01:45:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1444614343!25795726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19322 invoked from network); 12 Oct 2015 01:45:44 -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;
	12 Oct 2015 01:45:44 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBL-0006hd-MX
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBL-0005gx-L3
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:43 +0000
Date: Mon, 12 Oct 2015 01:45:43 +0000
Message-Id: <E1ZlSBL-0005gx-L3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m-pt: correct condition of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c94f9630bf735f19df51c61817cfc6a3aebc994
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:46:39 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:46:39 2015 +0200

    x86/p2m-pt: correct condition of IOMMU mapping updates
    
    Whether the MFN changes does not depend on the new entry being valid
    (but solely on the old one).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 660fd65d5578a95ec5eac522128bba23325179eb
    master date: 2015-10-02 13:40:36 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   44 +++++++++++++++++++-------------------------
 1 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index cd40a21..b71bc9d 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -293,7 +293,8 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     unsigned int iommu_pte_flags = (p2mt == p2m_ram_rw) ?
                                    IOMMUF_readable|IOMMUF_writable:
                                    0; 
-    unsigned long old_mfn = 0;
+    unsigned int flags;
+    unsigned long old_mfn = INVALID_MFN;
 
     if ( tb_init_done )
     {
@@ -326,12 +327,13 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            else
+                intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -342,10 +344,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l3e_content.l3;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -366,7 +365,8 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
+        old_mfn = l1e_get_pfn(*p2m_entry);
+
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
                             || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
@@ -375,10 +375,8 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             entry_content = l1e_empty();
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
+
         /* level 1 entry */
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 1);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -389,14 +387,13 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
-        /* FIXME: Deal with 4k replaced by 2meg pages */
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            else
+                intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -410,10 +407,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l2e_content.l2;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -424,11 +418,11 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
-    if ( iommu_enabled && need_iommu(p2m->domain) )
+    if ( iommu_enabled && need_iommu(p2m->domain) && old_mfn != mfn_x(mfn) )
     {
         if ( iommu_use_hap_pt(p2m->domain) )
         {
-            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
+            if ( old_mfn != INVALID_MFN )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
         else
--
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 Oct 12 01:45:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Oct 2015 01:45: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 1ZlSBP-0003hY-Vt; Mon, 12 Oct 2015 01:45:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBO-0003hG-A6
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:46 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	0C/1C-30270-9C01B165; Mon, 12 Oct 2015 01:45:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1444614343!25795726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19322 invoked from network); 12 Oct 2015 01:45:44 -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;
	12 Oct 2015 01:45:44 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBL-0006hd-MX
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZlSBL-0005gx-L3
	for xen-changelog@lists.xensource.com; Mon, 12 Oct 2015 01:45:43 +0000
Date: Mon, 12 Oct 2015 01:45:43 +0000
Message-Id: <E1ZlSBL-0005gx-L3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/p2m-pt: correct condition of
	IOMMU mapping updates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c94f9630bf735f19df51c61817cfc6a3aebc994
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 8 12:46:39 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 12:46:39 2015 +0200

    x86/p2m-pt: correct condition of IOMMU mapping updates
    
    Whether the MFN changes does not depend on the new entry being valid
    (but solely on the old one).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 660fd65d5578a95ec5eac522128bba23325179eb
    master date: 2015-10-02 13:40:36 +0200
---
 xen/arch/x86/mm/p2m-pt.c |   44 +++++++++++++++++++-------------------------
 1 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index cd40a21..b71bc9d 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -293,7 +293,8 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     unsigned int iommu_pte_flags = (p2mt == p2m_ram_rw) ?
                                    IOMMUF_readable|IOMMUF_writable:
                                    0; 
-    unsigned long old_mfn = 0;
+    unsigned int flags;
+    unsigned long old_mfn = INVALID_MFN;
 
     if ( tb_init_done )
     {
@@ -326,12 +327,13 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L3_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L3_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            else
+                intermediate_entry = *p2m_entry;
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -342,10 +344,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l3e_content.l3;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 3);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -366,7 +365,8 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
+        old_mfn = l1e_get_pfn(*p2m_entry);
+
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
                             || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
@@ -375,10 +375,8 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             entry_content = l1e_empty();
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
+
         /* level 1 entry */
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 1);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -389,14 +387,13 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
                                    L2_PAGETABLE_SHIFT - PAGE_SHIFT,
                                    L2_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
-        
-        /* FIXME: Deal with 4k replaced by 2meg pages */
-        if ( (l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) &&
-             !(l1e_get_flags(*p2m_entry) & _PAGE_PSE) )
+        flags = l1e_get_flags(*p2m_entry);
+        if ( flags & _PAGE_PRESENT )
         {
-            /* We're replacing a non-SP page with a superpage.  Make sure to
-             * handle freeing the table properly. */
-            intermediate_entry = *p2m_entry;
+            if ( flags & _PAGE_PSE )
+                old_mfn = l1e_get_pfn(*p2m_entry);
+            else
+                intermediate_entry = *p2m_entry;
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
@@ -410,10 +407,7 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         entry_content.l1 = l2e_content.l2;
 
         if ( entry_content.l1 != 0 )
-        {
             p2m_add_iommu_flags(&entry_content, 0, iommu_pte_flags);
-            old_mfn = l1e_get_pfn(*p2m_entry);
-        }
 
         p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 2);
         /* NB: paging_write_p2m_entry() handles tlb flushes properly */
@@ -424,11 +418,11 @@ p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
          && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
         p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
-    if ( iommu_enabled && need_iommu(p2m->domain) )
+    if ( iommu_enabled && need_iommu(p2m->domain) && old_mfn != mfn_x(mfn) )
     {
         if ( iommu_use_hap_pt(p2m->domain) )
         {
-            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
+            if ( old_mfn != INVALID_MFN )
                 amd_iommu_flush_pages(p2m->domain, gfn, page_order);
         }
         else
--
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 Oct 16 14:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 14:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6PX-0007Ql-Hb; Fri, 16 Oct 2015 14:55:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PW-0007QS-3V
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:10 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	7E/55-12889-DCF01265; Fri, 16 Oct 2015 14:55:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1445007304!47584175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13217 invoked from network); 16 Oct 2015 14:55:05 -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;
	16 Oct 2015 14:55:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PQ-0005mb-H4
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PQ-0004Vv-79
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:04 +0000
Message-Id: <E1Zn6PQ-0004Vv-79@xenbits.xen.org>
Date: Fri, 16 Oct 2015 14:55:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86/evtchn: make use of
	PHYSDEVOP_map_pirq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1445003840 -7200
# Node ID 3f51e783c26a52086fb349313fad1758e4e35297
# Parent  47161cb7bd45c059b8e75c09d59ee1124953ad46
x86/evtchn: make use of PHYSDEVOP_map_pirq

Xen commit 669d4b85c4 ("x86/IO-APIC: don't create pIRQ mapping from
masked RTE") revealed that for any interrupts which get set up masked
(commonly at least level triggered ones), the pIRQ <-> IRQ mapping
never gets established (since the IO-APIC RTE writes now don't have
that effect anymore when the mask bit is set), resulting in subsequent
binding of the pIRQ to fail.

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


diff -r 47161cb7bd45 -r 3f51e783c26a drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c	Mon Sep 28 10:38:54 2015 +0200
+++ b/drivers/xen/core/evtchn.c	Fri Oct 16 15:57:20 2015 +0200
@@ -1113,13 +1113,34 @@ void irq_resume(void)
 #define identity_mapped_irq(irq) (1)
 #endif
 
-void evtchn_register_pirq(int irq)
+int evtchn_register_pirq(int irq)
 {
+	struct physdev_map_pirq map_pirq = {
+		.domid = DOMID_SELF,
+		.type = MAP_PIRQ_TYPE_GSI,
+		.index = irq,
+		.pirq = irq
+	};
+
 	BUG_ON(irq < PIRQ_BASE || irq - PIRQ_BASE >= NR_PIRQS);
-	if (identity_mapped_irq(irq) || type_from_irq(irq) != IRQT_UNBOUND)
-		return;
-	irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0);
-	irq_desc[irq].chip = &pirq_type;
+
+	switch (type_from_irq(irq)) {
+	case IRQT_UNBOUND:
+		break;
+	case IRQT_PIRQ:
+		if (index_from_irq(irq) == irq)
+			return -EEXIST;
+	default:
+		return -EBUSY;
+	}
+
+	if (!identity_mapped_irq(irq)) {
+		irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0);
+		irq_desc[irq].chip = &pirq_type;
+	}
+
+	return is_initial_xendomain()
+	       ? HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_pirq) : 0;
 }
 
 int evtchn_map_pirq(int irq, int xen_pirq)
diff -r 47161cb7bd45 -r 3f51e783c26a include/xen/evtchn.h
--- a/include/xen/evtchn.h	Mon Sep 28 10:38:54 2015 +0200
+++ b/include/xen/evtchn.h	Fri Oct 16 15:57:20 2015 +0200
@@ -102,7 +102,7 @@ asmlinkage void evtchn_do_upcall(struct 
 void evtchn_device_upcall(int port);
 
 /* Mark a PIRQ as unavailable for dynamic allocation. */
-void evtchn_register_pirq(int irq);
+int evtchn_register_pirq(int irq);
 /* Map a Xen-supplied PIRQ to a dynamically allocated one. */
 int evtchn_map_pirq(int irq, int xen_pirq);
 /* Look up a Xen-supplied PIRQ for a dynamically allocated one. */

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 14:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 14:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6PW-0007Qc-FS; Fri, 16 Oct 2015 14:55:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PV-0007QJ-1F
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:09 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	AD/A0-00475-CCF01265; Fri, 16 Oct 2015 14:55:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445007306!20125539!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14592 invoked from network); 16 Oct 2015 14:55:07 -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;
	16 Oct 2015 14:55:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PS-0005mn-9n
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PR-0004WP-EA
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:05 +0000
Message-Id: <E1Zn6PR-0004WP-EA@xenbits.xen.org>
Date: Fri, 16 Oct 2015 14:55:05 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap2: fix build after header
	update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1445006764 -7200
# Node ID 80f9921ed1d4e724e21d6c3778dc13789322a3a4
# Parent  288d236ca763e3e889774fcb8a10fda136723130
blktap2: fix build after header update

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


diff -r 288d236ca763 -r 80f9921ed1d4 drivers/xen/blktap2/ring.c
--- a/drivers/xen/blktap2/ring.c	Fri Oct 16 16:24:14 2015 +0200
+++ b/drivers/xen/blktap2/ring.c	Fri Oct 16 16:46:04 2015 +0200
@@ -360,7 +360,7 @@ blktap_ring_set_message(struct blktap *t
 
 	down_read(&tap->tap_sem);
 	if (ring->ring.sring)
-		ring->ring.sring->private.tapif_user.msg = msg;
+		ring->ring.sring->pvt.tapif_user.msg = msg;
 	up_read(&tap->tap_sem);
 }
 
@@ -470,7 +470,7 @@ static unsigned int blktap_ring_poll(str
 	struct blktap_ring *ring = &tap->ring;
 
 	poll_wait(filp, &ring->poll_wait, wait);
-	if (ring->ring.sring->private.tapif_user.msg ||
+	if (ring->ring.sring->pvt.tapif_user.msg ||
 	    ring->ring.req_prod_pvt != ring->ring.sring->req_prod) {
 		RING_PUSH_REQUESTS(&ring->ring);
 		return POLLIN | POLLRDNORM;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 14:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 14:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6PW-0007Qc-FS; Fri, 16 Oct 2015 14:55:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PV-0007QJ-1F
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:09 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	AD/A0-00475-CCF01265; Fri, 16 Oct 2015 14:55:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445007306!20125539!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14592 invoked from network); 16 Oct 2015 14:55:07 -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;
	16 Oct 2015 14:55:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PS-0005mn-9n
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PR-0004WP-EA
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:05 +0000
Message-Id: <E1Zn6PR-0004WP-EA@xenbits.xen.org>
Date: Fri, 16 Oct 2015 14:55:05 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap2: fix build after header
	update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1445006764 -7200
# Node ID 80f9921ed1d4e724e21d6c3778dc13789322a3a4
# Parent  288d236ca763e3e889774fcb8a10fda136723130
blktap2: fix build after header update

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


diff -r 288d236ca763 -r 80f9921ed1d4 drivers/xen/blktap2/ring.c
--- a/drivers/xen/blktap2/ring.c	Fri Oct 16 16:24:14 2015 +0200
+++ b/drivers/xen/blktap2/ring.c	Fri Oct 16 16:46:04 2015 +0200
@@ -360,7 +360,7 @@ blktap_ring_set_message(struct blktap *t
 
 	down_read(&tap->tap_sem);
 	if (ring->ring.sring)
-		ring->ring.sring->private.tapif_user.msg = msg;
+		ring->ring.sring->pvt.tapif_user.msg = msg;
 	up_read(&tap->tap_sem);
 }
 
@@ -470,7 +470,7 @@ static unsigned int blktap_ring_poll(str
 	struct blktap_ring *ring = &tap->ring;
 
 	poll_wait(filp, &ring->poll_wait, wait);
-	if (ring->ring.sring->private.tapif_user.msg ||
+	if (ring->ring.sring->pvt.tapif_user.msg ||
 	    ring->ring.req_prod_pvt != ring->ring.sring->req_prod) {
 		RING_PUSH_REQUESTS(&ring->ring);
 		return POLLIN | POLLRDNORM;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 14:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 14:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6PW-0007QX-DO; Fri, 16 Oct 2015 14:55:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PU-0007QI-Qf
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:08 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	AE/F7-01421-CCF01265; Fri, 16 Oct 2015 14:55:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-31.messagelabs.com!1445007306!52666641!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 624 invoked from network); 16 Oct 2015 14:55:07 -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;
	16 Oct 2015 14:55:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PS-0005mj-1h
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PR-0004Wd-Uv
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:05 +0000
Message-Id: <E1Zn6PR-0004Wd-Uv@xenbits.xen.org>
Date: Fri, 16 Oct 2015 14:55:05 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] update to latest interface
	version (4.6.0)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1445006966 -7200
# Node ID 9a50d064b249f630e9244f2da835f8ec74295521
# Parent  80f9921ed1d4e724e21d6c3778dc13789322a3a4
update to latest interface version (4.6.0)

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


diff -r 80f9921ed1d4 -r 9a50d064b249 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c	Fri Oct 16 16:46:04 2015 +0200
+++ b/arch/i386/kernel/time-xen.c	Fri Oct 16 16:49:26 2015 +0200
@@ -479,10 +479,10 @@ int do_settimeofday(struct timespec *tv)
 	__normalize_time(&sec, &nsec);
 
 	if (is_initial_xendomain() && !independent_wallclock) {
-		op.cmd = XENPF_settime;
-		op.u.settime.secs        = sec;
-		op.u.settime.nsecs       = nsec;
-		op.u.settime.system_time = shadow->system_timestamp;
+		op.cmd = XENPF_settime32;
+		op.u.settime32.secs        = sec;
+		op.u.settime32.nsecs       = nsec;
+		op.u.settime32.system_time = shadow->system_timestamp;
 		WARN_ON(HYPERVISOR_platform_op(&op));
 		update_wallclock();
 	} else if (independent_wallclock) {
@@ -521,10 +521,10 @@ static void sync_xen_wallclock(unsigned 
 	nsec = xtime.tv_nsec + ((jiffies - wall_jiffies) * (u64)NS_PER_TICK);
 	__normalize_time(&sec, &nsec);
 
-	op.cmd = XENPF_settime;
-	op.u.settime.secs        = sec;
-	op.u.settime.nsecs       = nsec;
-	op.u.settime.system_time = processed_system_time;
+	op.cmd = XENPF_settime32;
+	op.u.settime32.secs        = sec;
+	op.u.settime32.nsecs       = nsec;
+	op.u.settime32.system_time = processed_system_time;
 	WARN_ON(HYPERVISOR_platform_op(&op));
 
 	update_wallclock();
diff -r 80f9921ed1d4 -r 9a50d064b249 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c	Fri Oct 16 16:46:04 2015 +0200
+++ b/arch/powerpc/platforms/xen/hcall.c	Fri Oct 16 16:49:26 2015 +0200
@@ -536,7 +536,7 @@ static int xenppc_privcmd_platform_op(pr
 		return -ENOMEM;
 
 	switch (kern_op.cmd) {
-	case XENPF_settime:
+	case XENPF_settime32:
 	case XENPF_add_memtype:
 	case XENPF_del_memtype:
 	case XENPF_read_memtype:
diff -r 80f9921ed1d4 -r 9a50d064b249 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Fri Oct 16 16:46:04 2015 +0200
+++ b/drivers/xen/Kconfig	Fri Oct 16 16:49:26 2015 +0200
@@ -10,7 +10,7 @@ config XEN
 if XEN
 config XEN_INTERFACE_VERSION
 	hex
-	default 0x00040500
+	default 0x00040600
 
 menu "XEN"
 
@@ -351,6 +351,9 @@ choice
 	config XEN_COMPAT_040500_AND_LATER
 		bool "4.5.0 and later"
 
+	config XEN_COMPAT_040600_AND_LATER
+		bool "4.6.0 and later"
+
 	config XEN_COMPAT_LATEST_ONLY
 		bool "no compatibility code"
 
@@ -359,6 +362,7 @@ endchoice
 config XEN_COMPAT
 	hex
 	default 0xffffff if XEN_COMPAT_LATEST_ONLY
+	default 0x040600 if XEN_COMPAT_040600_AND_LATER
 	default 0x040500 if XEN_COMPAT_040500_AND_LATER
 	default 0x040400 if XEN_COMPAT_040400_AND_LATER
 	default 0x040300 if XEN_COMPAT_040300_AND_LATER
diff -r 80f9921ed1d4 -r 9a50d064b249 include/xen/interface/dom0_ops.h
--- a/include/xen/interface/dom0_ops.h	Fri Oct 16 16:46:04 2015 +0200
+++ b/include/xen/interface/dom0_ops.h	Fri Oct 16 16:49:26 2015 +0200
@@ -37,9 +37,9 @@
 
 #define DOM0_INTERFACE_VERSION XENPF_INTERFACE_VERSION
 
-#define DOM0_SETTIME          XENPF_settime
-#define dom0_settime          xenpf_settime
-#define dom0_settime_t        xenpf_settime_t
+#define DOM0_SETTIME          XENPF_settime32
+#define dom0_settime          xenpf_settime32
+typedef struct dom0_settime dom0_settime_t;
 
 #define DOM0_ADD_MEMTYPE      XENPF_add_memtype
 #define dom0_add_memtype      xenpf_add_memtype
diff -r 80f9921ed1d4 -r 9a50d064b249 mm/tmem.c
--- a/mm/tmem.c	Fri Oct 16 16:46:04 2015 +0200
+++ b/mm/tmem.c	Fri Oct 16 16:49:26 2015 +0200
@@ -16,8 +16,8 @@ int xen_tmem_op(u32 tmem_cmd, u32 tmem_p
 
 	op.cmd = tmem_cmd;
 	op.pool_id = tmem_pool;
-	op.u.gen.oid[0] = object;
-        op.u.gen.oid[1] = op.u.gen.oid[2] = 0;
+	op.u.gen.oid.oid[0] = object;
+	op.u.gen.oid.oid[1] = op.u.gen.oid.oid[2] = 0;
 	op.u.gen.index = index;
 	op.u.gen.tmem_offset = tmem_offset;
 	op.u.gen.pfn_offset = pfn_offset;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 14:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 14:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6PW-0007QX-DO; Fri, 16 Oct 2015 14:55:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PU-0007QI-Qf
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:08 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	AE/F7-01421-CCF01265; Fri, 16 Oct 2015 14:55:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-31.messagelabs.com!1445007306!52666641!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 624 invoked from network); 16 Oct 2015 14:55:07 -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;
	16 Oct 2015 14:55:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PS-0005mj-1h
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PR-0004Wd-Uv
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:05 +0000
Message-Id: <E1Zn6PR-0004Wd-Uv@xenbits.xen.org>
Date: Fri, 16 Oct 2015 14:55:05 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] update to latest interface
	version (4.6.0)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1445006966 -7200
# Node ID 9a50d064b249f630e9244f2da835f8ec74295521
# Parent  80f9921ed1d4e724e21d6c3778dc13789322a3a4
update to latest interface version (4.6.0)

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


diff -r 80f9921ed1d4 -r 9a50d064b249 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c	Fri Oct 16 16:46:04 2015 +0200
+++ b/arch/i386/kernel/time-xen.c	Fri Oct 16 16:49:26 2015 +0200
@@ -479,10 +479,10 @@ int do_settimeofday(struct timespec *tv)
 	__normalize_time(&sec, &nsec);
 
 	if (is_initial_xendomain() && !independent_wallclock) {
-		op.cmd = XENPF_settime;
-		op.u.settime.secs        = sec;
-		op.u.settime.nsecs       = nsec;
-		op.u.settime.system_time = shadow->system_timestamp;
+		op.cmd = XENPF_settime32;
+		op.u.settime32.secs        = sec;
+		op.u.settime32.nsecs       = nsec;
+		op.u.settime32.system_time = shadow->system_timestamp;
 		WARN_ON(HYPERVISOR_platform_op(&op));
 		update_wallclock();
 	} else if (independent_wallclock) {
@@ -521,10 +521,10 @@ static void sync_xen_wallclock(unsigned 
 	nsec = xtime.tv_nsec + ((jiffies - wall_jiffies) * (u64)NS_PER_TICK);
 	__normalize_time(&sec, &nsec);
 
-	op.cmd = XENPF_settime;
-	op.u.settime.secs        = sec;
-	op.u.settime.nsecs       = nsec;
-	op.u.settime.system_time = processed_system_time;
+	op.cmd = XENPF_settime32;
+	op.u.settime32.secs        = sec;
+	op.u.settime32.nsecs       = nsec;
+	op.u.settime32.system_time = processed_system_time;
 	WARN_ON(HYPERVISOR_platform_op(&op));
 
 	update_wallclock();
diff -r 80f9921ed1d4 -r 9a50d064b249 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c	Fri Oct 16 16:46:04 2015 +0200
+++ b/arch/powerpc/platforms/xen/hcall.c	Fri Oct 16 16:49:26 2015 +0200
@@ -536,7 +536,7 @@ static int xenppc_privcmd_platform_op(pr
 		return -ENOMEM;
 
 	switch (kern_op.cmd) {
-	case XENPF_settime:
+	case XENPF_settime32:
 	case XENPF_add_memtype:
 	case XENPF_del_memtype:
 	case XENPF_read_memtype:
diff -r 80f9921ed1d4 -r 9a50d064b249 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Fri Oct 16 16:46:04 2015 +0200
+++ b/drivers/xen/Kconfig	Fri Oct 16 16:49:26 2015 +0200
@@ -10,7 +10,7 @@ config XEN
 if XEN
 config XEN_INTERFACE_VERSION
 	hex
-	default 0x00040500
+	default 0x00040600
 
 menu "XEN"
 
@@ -351,6 +351,9 @@ choice
 	config XEN_COMPAT_040500_AND_LATER
 		bool "4.5.0 and later"
 
+	config XEN_COMPAT_040600_AND_LATER
+		bool "4.6.0 and later"
+
 	config XEN_COMPAT_LATEST_ONLY
 		bool "no compatibility code"
 
@@ -359,6 +362,7 @@ endchoice
 config XEN_COMPAT
 	hex
 	default 0xffffff if XEN_COMPAT_LATEST_ONLY
+	default 0x040600 if XEN_COMPAT_040600_AND_LATER
 	default 0x040500 if XEN_COMPAT_040500_AND_LATER
 	default 0x040400 if XEN_COMPAT_040400_AND_LATER
 	default 0x040300 if XEN_COMPAT_040300_AND_LATER
diff -r 80f9921ed1d4 -r 9a50d064b249 include/xen/interface/dom0_ops.h
--- a/include/xen/interface/dom0_ops.h	Fri Oct 16 16:46:04 2015 +0200
+++ b/include/xen/interface/dom0_ops.h	Fri Oct 16 16:49:26 2015 +0200
@@ -37,9 +37,9 @@
 
 #define DOM0_INTERFACE_VERSION XENPF_INTERFACE_VERSION
 
-#define DOM0_SETTIME          XENPF_settime
-#define dom0_settime          xenpf_settime
-#define dom0_settime_t        xenpf_settime_t
+#define DOM0_SETTIME          XENPF_settime32
+#define dom0_settime          xenpf_settime32
+typedef struct dom0_settime dom0_settime_t;
 
 #define DOM0_ADD_MEMTYPE      XENPF_add_memtype
 #define dom0_add_memtype      xenpf_add_memtype
diff -r 80f9921ed1d4 -r 9a50d064b249 mm/tmem.c
--- a/mm/tmem.c	Fri Oct 16 16:46:04 2015 +0200
+++ b/mm/tmem.c	Fri Oct 16 16:49:26 2015 +0200
@@ -16,8 +16,8 @@ int xen_tmem_op(u32 tmem_cmd, u32 tmem_p
 
 	op.cmd = tmem_cmd;
 	op.pool_id = tmem_pool;
-	op.u.gen.oid[0] = object;
-        op.u.gen.oid[1] = op.u.gen.oid[2] = 0;
+	op.u.gen.oid.oid[0] = object;
+	op.u.gen.oid.oid[1] = op.u.gen.oid.oid[2] = 0;
 	op.u.gen.index = index;
 	op.u.gen.tmem_offset = tmem_offset;
 	op.u.gen.pfn_offset = pfn_offset;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 14:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 14:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6PX-0007Ql-Hb; Fri, 16 Oct 2015 14:55:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PW-0007QS-3V
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:10 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	7E/55-12889-DCF01265; Fri, 16 Oct 2015 14:55:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1445007304!47584175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13217 invoked from network); 16 Oct 2015 14:55:05 -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;
	16 Oct 2015 14:55:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PQ-0005mb-H4
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PQ-0004Vv-79
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:04 +0000
Message-Id: <E1Zn6PQ-0004Vv-79@xenbits.xen.org>
Date: Fri, 16 Oct 2015 14:55:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86/evtchn: make use of
	PHYSDEVOP_map_pirq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1445003840 -7200
# Node ID 3f51e783c26a52086fb349313fad1758e4e35297
# Parent  47161cb7bd45c059b8e75c09d59ee1124953ad46
x86/evtchn: make use of PHYSDEVOP_map_pirq

Xen commit 669d4b85c4 ("x86/IO-APIC: don't create pIRQ mapping from
masked RTE") revealed that for any interrupts which get set up masked
(commonly at least level triggered ones), the pIRQ <-> IRQ mapping
never gets established (since the IO-APIC RTE writes now don't have
that effect anymore when the mask bit is set), resulting in subsequent
binding of the pIRQ to fail.

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


diff -r 47161cb7bd45 -r 3f51e783c26a drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c	Mon Sep 28 10:38:54 2015 +0200
+++ b/drivers/xen/core/evtchn.c	Fri Oct 16 15:57:20 2015 +0200
@@ -1113,13 +1113,34 @@ void irq_resume(void)
 #define identity_mapped_irq(irq) (1)
 #endif
 
-void evtchn_register_pirq(int irq)
+int evtchn_register_pirq(int irq)
 {
+	struct physdev_map_pirq map_pirq = {
+		.domid = DOMID_SELF,
+		.type = MAP_PIRQ_TYPE_GSI,
+		.index = irq,
+		.pirq = irq
+	};
+
 	BUG_ON(irq < PIRQ_BASE || irq - PIRQ_BASE >= NR_PIRQS);
-	if (identity_mapped_irq(irq) || type_from_irq(irq) != IRQT_UNBOUND)
-		return;
-	irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0);
-	irq_desc[irq].chip = &pirq_type;
+
+	switch (type_from_irq(irq)) {
+	case IRQT_UNBOUND:
+		break;
+	case IRQT_PIRQ:
+		if (index_from_irq(irq) == irq)
+			return -EEXIST;
+	default:
+		return -EBUSY;
+	}
+
+	if (!identity_mapped_irq(irq)) {
+		irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0);
+		irq_desc[irq].chip = &pirq_type;
+	}
+
+	return is_initial_xendomain()
+	       ? HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_pirq) : 0;
 }
 
 int evtchn_map_pirq(int irq, int xen_pirq)
diff -r 47161cb7bd45 -r 3f51e783c26a include/xen/evtchn.h
--- a/include/xen/evtchn.h	Mon Sep 28 10:38:54 2015 +0200
+++ b/include/xen/evtchn.h	Fri Oct 16 15:57:20 2015 +0200
@@ -102,7 +102,7 @@ asmlinkage void evtchn_do_upcall(struct 
 void evtchn_device_upcall(int port);
 
 /* Mark a PIRQ as unavailable for dynamic allocation. */
-void evtchn_register_pirq(int irq);
+int evtchn_register_pirq(int irq);
 /* Map a Xen-supplied PIRQ to a dynamically allocated one. */
 int evtchn_map_pirq(int irq, int xen_pirq);
 /* Look up a Xen-supplied PIRQ for a dynamically allocated one. */

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 14:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 14:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6Pa-0007Rb-Kc; Fri, 16 Oct 2015 14:55:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PZ-0007Qu-48
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:13 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	5E/09-00536-0DF01265; Fri, 16 Oct 2015 14:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445007305!53907990!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 16201 invoked from network); 16 Oct 2015 14:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2015 14:55:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PR-0005mf-2Y
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PQ-0004WA-Vb
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:05 +0000
Message-Id: <E1Zn6PQ-0004WA-Vb@xenbits.xen.org>
Date: Fri, 16 Oct 2015 14:55:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] sync Xen public headers to 4.6.0
	level
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1445005454 -7200
# Node ID 288d236ca763e3e889774fcb8a10fda136723130
# Parent  3f51e783c26a52086fb349313fad1758e4e35297
sync Xen public headers to 4.6.0 level
---


diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-arm.h
--- a/include/xen/interface/arch-arm.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-arm.h	Fri Oct 16 16:24:14 2015 +0200
@@ -87,15 +87,10 @@
  * unavailable/unsupported.
  *
  *  HYPERVISOR_memory_op
- *   All generic sub-operations.
- *
- *   In addition the following arch specific sub-ops:
- *    * XENMEM_add_to_physmap
- *    * XENMEM_add_to_physmap_batch
+ *   All generic sub-operations
  *
  *  HYPERVISOR_domctl
  *   All generic sub-operations, with the exception of:
- *    * XEN_DOMCTL_iomem_permission (not yet implemented)
  *    * XEN_DOMCTL_irq_permission (not yet implemented)
  *
  *  HYPERVISOR_sched_op
@@ -170,6 +165,7 @@
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
+#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 
 #ifndef __ASSEMBLY__
@@ -183,8 +179,8 @@
  * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
  * in a struct in memory. On ARM is always 8 bytes sizes and 8 bytes
  * aligned.
- * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
- * hypercall argument. It is 4 bytes on aarch and 8 bytes on aarch64.
+ * XEN_GUEST_HANDLE_PARAM represents a guest pointer, when passed as an
+ * hypercall argument. It is 4 bytes on aarch32 and 8 bytes on aarch64.
  */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
@@ -192,7 +188,6 @@
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
 #define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
-/* this is going to be changed on 64 bit */
 #define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
 #define set_xen_guest_handle_raw(hnd, val)                  \
     do {                                                    \
@@ -303,7 +298,35 @@ struct vcpu_guest_context {
 };
 typedef struct vcpu_guest_context vcpu_guest_context_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
-#endif
+
+/*
+ * struct xen_arch_domainconfig's ABI is covered by
+ * XEN_DOMCTL_INTERFACE_VERSION.
+ */
+#define XEN_DOMCTL_CONFIG_GIC_NATIVE    0
+#define XEN_DOMCTL_CONFIG_GIC_V2        1
+#define XEN_DOMCTL_CONFIG_GIC_V3        2
+struct xen_arch_domainconfig {
+    /* IN/OUT */
+    uint8_t gic_version;
+    /* IN */
+    uint32_t nr_spis;
+    /*
+     * OUT
+     * Based on the property clock-frequency in the DT timer node.
+     * The property may be present when the bootloader/firmware doesn't
+     * set correctly CNTFRQ which hold the timer frequency.
+     *
+     * As it's not possible to trap this register, we have to replicate
+     * the value in the guest DT.
+     *
+     * = 0 => property not present
+     * > 0 => Value of the property
+     *
+     */
+    uint32_t clock_frequency;
+};
+#endif /* __XEN__ || __XEN_TOOLS__ */
 
 struct arch_vcpu_info {
 };
@@ -318,7 +341,7 @@ typedef uint64_t xen_callback_t;
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 
-/* PSR bits (CPSR, SPSR)*/
+/* PSR bits (CPSR, SPSR) */
 
 #define PSR_THUMB       (1<<5)        /* Thumb Mode enable */
 #define PSR_FIQ_MASK    (1<<6)        /* Fast Interrupt mask */
@@ -365,7 +388,8 @@ typedef uint64_t xen_callback_t;
 
 /* Physical Address Space */
 
-/* vGIC mappings: Only one set of mapping is used by the guest.
+/*
+ * vGIC mappings: Only one set of mapping is used by the guest.
  * Therefore they can overlap.
  */
 
@@ -382,10 +406,11 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICV3_RDIST_STRIDE   0x20000ULL
 #define GUEST_GICV3_RDIST_REGIONS  1
 
-#define GUEST_GICV3_GICR0_BASE     0x03020000ULL    /* vCPU0 - vCPU7 */
-#define GUEST_GICV3_GICR0_SIZE     0x00100000ULL
+#define GUEST_GICV3_GICR0_BASE     0x03020000ULL    /* vCPU0 - vCPU127 */
+#define GUEST_GICV3_GICR0_SIZE     0x01000000ULL
 
-/* 16MB == 4096 pages reserved for guest to use as a region to map its
+/*
+ * 16MB == 4096 pages reserved for guest to use as a region to map its
  * grant table in.
  */
 #define GUEST_GNTTAB_BASE 0x38000000ULL
@@ -423,6 +448,11 @@ typedef uint64_t xen_callback_t;
 
 #endif
 
+#ifndef __ASSEMBLY__
+/* Stub definition of PMU structure */
+typedef struct xen_pmu_arch { uint8_t dummy; } xen_pmu_arch_t;
+#endif
+
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
 
 /*
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/cpuid.h
--- a/include/xen/interface/arch-x86/cpuid.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-x86/cpuid.h	Fri Oct 16 16:24:14 2015 +0200
@@ -76,13 +76,14 @@
 /*
  * Leaf 5 (0x40000x04)
  * HVM-specific features
+ * EAX: Features
+ * EBX: vcpu id (iff EAX has XEN_HVM_CPUID_VCPU_ID_PRESENT flag)
  */
-
-/* EAX Features */
 #define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers */
 #define XEN_HVM_CPUID_X2APIC_VIRT      (1u << 1) /* Virtualized x2APIC accesses */
 /* Memory mapped from other domains has valid IOMMU entries */
 #define XEN_HVM_CPUID_IOMMU_MAPPINGS   (1u << 2)
+#define XEN_HVM_CPUID_VCPU_ID_PRESENT  (1u << 3) /* vcpu id is present in EBX */
 
 #define XEN_CPUID_MAX_NUM_LEAVES 4
 
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/hvm/save.h
--- a/include/xen/interface/arch-x86/hvm/save.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-x86/hvm/save.h	Fri Oct 16 16:24:14 2015 +0200
@@ -569,6 +569,7 @@ struct hvm_viridian_domain_context {
     uint64_t hypercall_gpa;
     uint64_t guest_os_id;
     uint64_t time_ref_count;
+    uint64_t reference_tsc;
 };
 
 DECLARE_HVM_SAVE_TYPE(VIRIDIAN_DOMAIN, 15, struct hvm_viridian_domain_context);
@@ -617,3 +618,13 @@ struct hvm_msr {
 #define HVM_SAVE_CODE_MAX 20
 
 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/pmu.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/arch-x86/pmu.h	Fri Oct 16 16:24:14 2015 +0200
@@ -0,0 +1,167 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
+#ifndef __XEN_PUBLIC_ARCH_X86_PMU_H__
+#define __XEN_PUBLIC_ARCH_X86_PMU_H__
+
+/* x86-specific PMU definitions */
+
+/* AMD PMU registers and structures */
+struct xen_pmu_amd_ctxt {
+    /*
+     * Offsets to counter and control MSRs (relative to xen_pmu_arch.c.amd).
+     * For PV(H) guests these fields are RO.
+     */
+    uint32_t counters;
+    uint32_t ctrls;
+
+    /* Counter MSRs */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    uint64_t regs[];
+#elif defined(__GNUC__)
+    uint64_t regs[0];
+#endif
+};
+typedef struct xen_pmu_amd_ctxt xen_pmu_amd_ctxt_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_amd_ctxt_t);
+
+/* Intel PMU registers and structures */
+struct xen_pmu_cntr_pair {
+    uint64_t counter;
+    uint64_t control;
+};
+typedef struct xen_pmu_cntr_pair xen_pmu_cntr_pair_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_cntr_pair_t);
+
+struct xen_pmu_intel_ctxt {
+   /*
+    * Offsets to fixed and architectural counter MSRs (relative to
+    * xen_pmu_arch.c.intel).
+    * For PV(H) guests these fields are RO.
+    */
+    uint32_t fixed_counters;
+    uint32_t arch_counters;
+
+    /* PMU registers */
+    uint64_t global_ctrl;
+    uint64_t global_ovf_ctrl;
+    uint64_t global_status;
+    uint64_t fixed_ctrl;
+    uint64_t ds_area;
+    uint64_t pebs_enable;
+    uint64_t debugctl;
+
+    /* Fixed and architectural counter MSRs */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    uint64_t regs[];
+#elif defined(__GNUC__)
+    uint64_t regs[0];
+#endif
+};
+typedef struct xen_pmu_intel_ctxt xen_pmu_intel_ctxt_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_intel_ctxt_t);
+
+/* Sampled domain's registers */
+struct xen_pmu_regs {
+    uint64_t ip;
+    uint64_t sp;
+    uint64_t flags;
+    uint16_t cs;
+    uint16_t ss;
+    uint8_t cpl;
+    uint8_t pad[3];
+};
+typedef struct xen_pmu_regs xen_pmu_regs_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_regs_t);
+
+/* PMU flags */
+#define PMU_CACHED         (1<<0) /* PMU MSRs are cached in the context */
+#define PMU_SAMPLE_USER    (1<<1) /* Sample is from user or kernel mode */
+#define PMU_SAMPLE_REAL    (1<<2) /* Sample is from realmode */
+#define PMU_SAMPLE_PV      (1<<3) /* Sample from a PV guest */
+
+/*
+ * Architecture-specific information describing state of the processor at
+ * the time of PMU interrupt.
+ * Fields of this structure marked as RW for guest should only be written by
+ * the guest when PMU_CACHED bit in pmu_flags is set (which is done by the
+ * hypervisor during PMU interrupt). Hypervisor will read updated data in
+ * XENPMU_flush hypercall and clear PMU_CACHED bit.
+ */
+struct xen_pmu_arch {
+    union {
+        /*
+         * Processor's registers at the time of interrupt.
+         * WO for hypervisor, RO for guests.
+         */
+        struct xen_pmu_regs regs;
+        /* Padding for adding new registers to xen_pmu_regs in the future */
+#define XENPMU_REGS_PAD_SZ  64
+        uint8_t pad[XENPMU_REGS_PAD_SZ];
+    } r;
+
+    /* WO for hypervisor, RO for guest */
+    uint64_t pmu_flags;
+
+    /*
+     * APIC LVTPC register.
+     * RW for both hypervisor and guest.
+     * Only APIC_LVT_MASKED bit is loaded by the hypervisor into hardware
+     * during XENPMU_flush or XENPMU_lvtpc_set.
+     */
+    union {
+        uint32_t lapic_lvtpc;
+        uint64_t pad;
+    } l;
+
+    /*
+     * Vendor-specific PMU registers.
+     * RW for both hypervisor and guest (see exceptions above).
+     * Guest's updates to this field are verified and then loaded by the
+     * hypervisor into hardware during XENPMU_flush
+     */
+    union {
+        struct xen_pmu_amd_ctxt amd;
+        struct xen_pmu_intel_ctxt intel;
+
+        /*
+         * Padding for contexts (fixed parts only, does not include MSR banks
+         * that are specified by offsets)
+         */
+#define XENPMU_CTXT_PAD_SZ  128
+        uint8_t pad[XENPMU_CTXT_PAD_SZ];
+    } c;
+};
+typedef struct xen_pmu_arch xen_pmu_arch_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_arch_t);
+
+#endif /* __XEN_PUBLIC_ARCH_X86_PMU_H__ */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
+
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/xen-x86_32.h
--- a/include/xen/interface/arch-x86/xen-x86_32.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-x86/xen-x86_32.h	Fri Oct 16 16:24:14 2015 +0200
@@ -104,6 +104,7 @@
     do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0;   \
          (hnd).p = val;                                     \
     } while ( 0 )
+#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 #define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name)
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/xen.h
--- a/include/xen/interface/arch-x86/xen.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-x86/xen.h	Fri Oct 16 16:24:14 2015 +0200
@@ -220,14 +220,58 @@ typedef struct vcpu_guest_context vcpu_g
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 
 struct arch_shared_info {
-    unsigned long max_pfn;                  /* max pfn that appears in table */
-    /* Frame containing list of mfns containing list of mfns containing p2m. */
+    /*
+     * Number of valid entries in the p2m table(s) anchored at
+     * pfn_to_mfn_frame_list_list and/or p2m_vaddr.
+     */
+    unsigned long max_pfn;
+    /*
+     * Frame containing list of mfns containing list of mfns containing p2m.
+     * A value of 0 indicates it has not yet been set up, ~0 indicates it has
+     * been set to invalid e.g. due to the p2m being too large for the 3-level
+     * p2m tree. In this case the linear mapper p2m list anchored at p2m_vaddr
+     * is to be used.
+     */
     xen_pfn_t     pfn_to_mfn_frame_list_list;
     unsigned long nmi_reason;
-    uint64_t pad[32];
+    /*
+     * Following three fields are valid if p2m_cr3 contains a value different
+     * from 0.
+     * p2m_cr3 is the root of the address space where p2m_vaddr is valid.
+     * p2m_cr3 is in the same format as a cr3 value in the vcpu register state
+     * and holds the folded machine frame number (via xen_pfn_to_cr3) of a
+     * L3 or L4 page table.
+     * p2m_vaddr holds the virtual address of the linear p2m list. All entries
+     * in the range [0...max_pfn[ are accessible via this pointer.
+     * p2m_generation will be incremented by the guest before and after each
+     * change of the mappings of the p2m list. p2m_generation starts at 0 and
+     * a value with the least significant bit set indicates that a mapping
+     * update is in progress. This allows guest external software (e.g. in Dom0)
+     * to verify that read mappings are consistent and whether they have changed
+     * since the last check.
+     * Modifying a p2m element in the linear p2m list is allowed via an atomic
+     * write only.
+     */
+    unsigned long p2m_cr3;         /* cr3 value of the p2m address space */
+    unsigned long p2m_vaddr;       /* virtual address of the p2m list */
+    unsigned long p2m_generation;  /* generation count of p2m mapping */
+#ifdef __i386__
+    /* There's no room for this field in the generic structure. */
+    uint32_t wc_sec_hi;
+#endif
 };
 typedef struct arch_shared_info arch_shared_info_t;
 
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+/*
+ * struct xen_arch_domainconfig's ABI is covered by
+ * XEN_DOMCTL_INTERFACE_VERSION.
+ */
+struct xen_arch_domainconfig {
+    char dummy;
+};
+#endif
+
 #endif /* !__ASSEMBLY__ */
 
 /*
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/domctl.h	Fri Oct 16 16:24:14 2015 +0200
@@ -37,7 +37,7 @@
 #include "hvm/save.h"
 #include "memory.h"
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000a
+#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000b
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -64,23 +64,11 @@ struct xen_domctl_createdomain {
 #define _XEN_DOMCTL_CDF_pvh_guest     4
 #define XEN_DOMCTL_CDF_pvh_guest      (1U<<_XEN_DOMCTL_CDF_pvh_guest)
     uint32_t flags;
+    struct xen_arch_domainconfig config;
 };
 typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t);
 
-#if defined(__arm__) || defined(__aarch64__)
-#define XEN_DOMCTL_CONFIG_GIC_DEFAULT   0
-#define XEN_DOMCTL_CONFIG_GIC_V2        1
-#define XEN_DOMCTL_CONFIG_GIC_V3        2
-/* XEN_DOMCTL_configure_domain */
-struct xen_domctl_arm_configuredomain {
-    /* IN/OUT parameters */
-    uint8_t gic_version;
-};
-typedef struct xen_domctl_arm_configuredomain xen_domctl_arm_configuredomain_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_arm_configuredomain_t);
-#endif
-
 /* XEN_DOMCTL_getdomaininfo */
 struct xen_domctl_getdomaininfo {
     /* OUT variables. */
@@ -161,27 +149,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getme
 #define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
-struct xen_domctl_getpageframeinfo {
-    /* IN variables. */
-    uint64_aligned_t gmfn; /* GMFN to query */
-    /* OUT variables. */
-    /* Is the page PINNED to a type? */
-    uint32_t type;         /* see above type defs */
-};
-typedef struct xen_domctl_getpageframeinfo xen_domctl_getpageframeinfo_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo_t);
-
-
-/* XEN_DOMCTL_getpageframeinfo2 */
-struct xen_domctl_getpageframeinfo2 {
-    /* IN variables. */
-    uint64_aligned_t num;
-    /* IN/OUT variables. */
-    XEN_GUEST_HANDLE_64(uint32) array;
-};
-typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
-
 /* XEN_DOMCTL_getpageframeinfo3 */
 struct xen_domctl_getpageframeinfo3 {
     /* IN variables. */
@@ -357,7 +324,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_v
 
 /* XEN_DOMCTL_scheduler_op */
 /* Scheduler types. */
-#define XEN_SCHEDULER_SEDF     4
+/* #define XEN_SCHEDULER_SEDF  4 (Removed) */
 #define XEN_SCHEDULER_CREDIT   5
 #define XEN_SCHEDULER_CREDIT2  6
 #define XEN_SCHEDULER_ARINC653 7
@@ -370,13 +337,6 @@ struct xen_domctl_scheduler_op {
     uint32_t sched_id;  /* XEN_SCHEDULER_* */
     uint32_t cmd;       /* XEN_DOMCTL_SCHEDOP_* */
     union {
-        struct xen_domctl_sched_sedf {
-            uint64_aligned_t period;
-            uint64_aligned_t slice;
-            uint64_aligned_t latency;
-            uint32_t extratime;
-            uint32_t weight;
-        } sedf;
         struct xen_domctl_sched_credit {
             uint16_t weight;
             uint16_t cap;
@@ -469,7 +429,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_
 
 /* XEN_DOMCTL_settimeoffset */
 struct xen_domctl_settimeoffset {
-    int32_t  time_offset_seconds; /* applied to domain wallclock time */
+    int64_aligned_t time_offset_seconds; /* applied to domain wallclock time */
 };
 typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
@@ -515,12 +475,33 @@ typedef struct xen_domctl_sendtrigger xe
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
 
 
-/* Assign PCI device to HVM guest. Sets up IOMMU structures. */
+/* Assign a device to a guest. Sets up IOMMU structures. */
 /* XEN_DOMCTL_assign_device */
 /* XEN_DOMCTL_test_assign_device */
-/* XEN_DOMCTL_deassign_device */
+/*
+ * XEN_DOMCTL_deassign_device: The behavior of this DOMCTL differs
+ * between the different type of device:
+ *  - PCI device (XEN_DOMCTL_DEV_PCI) will be reassigned to DOM0
+ *  - DT device (XEN_DOMCTL_DT_PCI) will left unassigned. DOM0
+ *  will have to call XEN_DOMCTL_assign_device in order to use the
+ *  device.
+ */
+#define XEN_DOMCTL_DEV_PCI      0
+#define XEN_DOMCTL_DEV_DT       1
 struct xen_domctl_assign_device {
-    uint32_t  machine_sbdf;   /* machine PCI ID of assigned device */
+    uint32_t dev;   /* XEN_DOMCTL_DEV_* */
+    union {
+        struct {
+            uint32_t machine_sbdf;   /* machine PCI ID of assigned device */
+        } pci;
+        struct {
+            uint32_t size; /* Length of the path */
+            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);
@@ -544,6 +525,7 @@ typedef enum pt_irq_type_e {
     PT_IRQ_TYPE_ISA,
     PT_IRQ_TYPE_MSI,
     PT_IRQ_TYPE_MSI_TRANSLATE,
+    PT_IRQ_TYPE_SPI,    /* ARM: valid range 32-1019 */
 } pt_irq_type_t;
 struct xen_domctl_bind_pt_irq {
     uint32_t machine_irq;
@@ -564,6 +546,9 @@ struct xen_domctl_bind_pt_irq {
             uint32_t gflags;
             uint64_aligned_t gtable;
         } msi;
+        struct {
+            uint16_t spi;
+        } spi;
     } u;
 };
 typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t;
@@ -571,6 +556,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_
 
 
 /* Bind machine I/O address range -> HVM address range. */
+/* If this returns -E2BIG lower nr_mfns value. */
 /* XEN_DOMCTL_memory_mapping */
 #define DPCI_ADD_MAPPING         1
 #define DPCI_REMOVE_MAPPING      0
@@ -752,18 +738,13 @@ typedef struct xen_domctl_disable_migrat
 
 /* XEN_DOMCTL_gettscinfo */
 /* XEN_DOMCTL_settscinfo */
-struct xen_guest_tsc_info {
+typedef struct xen_domctl_tsc_info {
+    /* IN/OUT */
     uint32_t tsc_mode;
     uint32_t gtsc_khz;
     uint32_t incarnation;
     uint32_t pad;
     uint64_aligned_t elapsed_nsec;
-};
-typedef struct xen_guest_tsc_info xen_guest_tsc_info_t;
-DEFINE_XEN_GUEST_HANDLE(xen_guest_tsc_info_t);
-typedef struct xen_domctl_tsc_info {
-    XEN_GUEST_HANDLE_64(xen_guest_tsc_info_t) out_info; /* OUT */
-    xen_guest_tsc_info_t info; /* IN */
 } xen_domctl_tsc_info_t;
 
 /* XEN_DOMCTL_gdbsx_guestmemio      guest mem io */
@@ -793,10 +774,21 @@ struct xen_domctl_gdbsx_domstatus {
 };
 
 /*
- * Memory event operations
+ * VM event operations
  */
 
-/* XEN_DOMCTL_mem_event_op */
+/* XEN_DOMCTL_vm_event_op */
+
+/*
+ * There are currently three rings available for VM events:
+ * sharing, monitor and paging. This hypercall allows one to
+ * control these rings (enable/disable), as well as to signal
+ * to the hypervisor to pull responses (resume) from the given
+ * ring.
+ */
+#define XEN_VM_EVENT_ENABLE               0
+#define XEN_VM_EVENT_DISABLE              1
+#define XEN_VM_EVENT_RESUME               2
 
 /*
  * Domain memory paging
@@ -805,42 +797,38 @@ struct xen_domctl_gdbsx_domstatus {
  * pager<->hypervisor interface. Use XENMEM_paging_op*
  * to perform per-page operations.
  *
- * The XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE domctl returns several
+ * The XEN_VM_EVENT_PAGING_ENABLE domctl returns several
  * non-standard error codes to indicate why paging could not be enabled:
  * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
  * EMLINK - guest has iommu passthrough enabled
  * EXDEV  - guest has PoD enabled
  * EBUSY  - guest has or had paging enabled, ring buffer still active
  */
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING            1
-
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE     0
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE    1
+#define XEN_DOMCTL_VM_EVENT_OP_PAGING            1
 
 /*
- * Access permissions.
+ * Monitor helper.
  *
  * As with paging, use the domctl for teardown/setup of the
  * helper<->hypervisor interface.
  *
- * There are HVM hypercalls to set the per-page access permissions of every
- * page in a domain.  When one of these permissions--independent, read, 
- * write, and execute--is violated, the VCPU is paused and a memory event 
- * is sent with what happened.  (See public/mem_event.h) .
+ * The monitor interface can be used to register for various VM events. For
+ * example, there are HVM hypercalls to set the per-page access permissions
+ * of every page in a domain.  When one of these permissions--independent,
+ * read, write, and execute--is violated, the VCPU is paused and a memory event
+ * is sent with what happened. The memory event handler can then resume the
+ * VCPU and redo the access with a XEN_VM_EVENT_RESUME option.
  *
- * The memory event handler can then resume the VCPU and redo the access 
- * with a XENMEM_access_op_resume hypercall.
+ * See public/vm_event.h for the list of available events that can be
+ * subscribed to via the monitor interface.
  *
- * The XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE domctl returns several
+ * The XEN_VM_EVENT_MONITOR_* domctls returns
  * non-standard error codes to indicate why access could not be enabled:
  * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
  * EBUSY  - guest has or had access enabled, ring buffer still active
+ *
  */
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS                        2
-
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE                 0
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE                1
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE_INTROSPECTION   2
+#define XEN_DOMCTL_VM_EVENT_OP_MONITOR           2
 
 /*
  * Sharing ENOMEM helper.
@@ -855,21 +843,18 @@ struct xen_domctl_gdbsx_domstatus {
  * Note that shring can be turned on (as per the domctl below)
  * *without* this ring being setup.
  */
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING           3
-
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE    0
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE   1
+#define XEN_DOMCTL_VM_EVENT_OP_SHARING           3
 
 /* Use for teardown/setup of helper<->hypervisor interface for paging, 
  * access and sharing.*/
-struct xen_domctl_mem_event_op {
-    uint32_t       op;           /* XEN_DOMCTL_MEM_EVENT_OP_*_* */
-    uint32_t       mode;         /* XEN_DOMCTL_MEM_EVENT_OP_* */
+struct xen_domctl_vm_event_op {
+    uint32_t       op;           /* XEN_VM_EVENT_* */
+    uint32_t       mode;         /* XEN_DOMCTL_VM_EVENT_OP_* */
 
     uint32_t port;              /* OUT: event channel for ring */
 };
-typedef struct xen_domctl_mem_event_op xen_domctl_mem_event_op_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
+typedef struct xen_domctl_vm_event_op xen_domctl_vm_event_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_vm_event_op_t);
 
 /*
  * Memory sharing operations
@@ -1001,27 +986,37 @@ typedef struct xen_domctl_vcpu_msrs xen_
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpu_msrs_t);
 #endif
 
-/*
- * Use in XEN_DOMCTL_setvnumainfo to set
- * vNUMA domain topology.
- */
+/* XEN_DOMCTL_setvnumainfo: specifies a virtual NUMA topology for the guest */
 struct xen_domctl_vnuma {
+    /* IN: number of vNUMA nodes to setup. Shall be greater than 0 */
     uint32_t nr_vnodes;
+    /* IN: number of memory ranges to setup */
     uint32_t nr_vmemranges;
+    /*
+     * IN: number of vCPUs of the domain (used as size of the vcpu_to_vnode
+     * array declared below). Shall be equal to the domain's max_vcpus.
+     */
     uint32_t nr_vcpus;
-    uint32_t pad;
-    XEN_GUEST_HANDLE_64(uint) vdistance;
-    XEN_GUEST_HANDLE_64(uint) vcpu_to_vnode;
+    uint32_t pad;                                  /* must be zero */
 
     /*
-     * vnodes to physical NUMA nodes mask.
-     * This kept on per-domain basis for
-     * interested consumers, such as numa aware ballooning.
+     * IN: array for specifying the distances of the vNUMA nodes
+     * between each others. Shall have nr_vnodes*nr_vnodes elements.
+     */
+    XEN_GUEST_HANDLE_64(uint) vdistance;
+    /*
+     * IN: array for specifying to what vNUMA node each vCPU belongs.
+     * Shall have nr_vcpus elements.
+     */
+    XEN_GUEST_HANDLE_64(uint) vcpu_to_vnode;
+    /*
+     * IN: array for specifying on what physical NUMA node each vNUMA
+     * node is placed. Shall have nr_vnodes elements.
      */
     XEN_GUEST_HANDLE_64(uint) vnode_to_pnode;
-
     /*
-     * memory rages for each vNUMA node
+     * IN: array for specifying the memory ranges. Shall have
+     * nr_vmemranges elements.
      */
     XEN_GUEST_HANDLE_64(xen_vmemrange_t) vmemrange;
 };
@@ -1038,6 +1033,79 @@ struct xen_domctl_psr_cmt_op {
 typedef struct xen_domctl_psr_cmt_op xen_domctl_psr_cmt_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cmt_op_t);
 
+/*  XEN_DOMCTL_MONITOR_*
+ *
+ * Enable/disable monitoring various VM events.
+ * This domctl configures what events will be reported to helper apps
+ * via the ring buffer "MONITOR". The ring has to be first enabled
+ * with the domctl XEN_DOMCTL_VM_EVENT_OP_MONITOR.
+ *
+ * GET_CAPABILITIES can be used to determine which of these features is
+ * available on a given platform.
+ *
+ * NOTICE: mem_access events are also delivered via the "MONITOR" ring buffer;
+ * however, enabling/disabling those events is performed with the use of
+ * memory_op hypercalls!
+ */
+#define XEN_DOMCTL_MONITOR_OP_ENABLE            0
+#define XEN_DOMCTL_MONITOR_OP_DISABLE           1
+#define XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES  2
+
+#define XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG         0
+#define XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR            1
+#define XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP            2
+#define XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT   3
+#define XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST         4
+
+struct xen_domctl_monitor_op {
+    uint32_t op; /* XEN_DOMCTL_MONITOR_OP_* */
+
+    /*
+     * When used with ENABLE/DISABLE this has to be set to
+     * the requested XEN_DOMCTL_MONITOR_EVENT_* value.
+     * With GET_CAPABILITIES this field returns a bitmap of
+     * events supported by the platform, in the format
+     * (1 << XEN_DOMCTL_MONITOR_EVENT_*).
+     */
+    uint32_t event;
+
+    /*
+     * Further options when issuing XEN_DOMCTL_MONITOR_OP_ENABLE.
+     */
+    union {
+        struct {
+            /* Which control register */
+            uint8_t index;
+            /* Pause vCPU until response */
+            uint8_t sync;
+            /* Send event only on a change of value */
+            uint8_t onchangeonly;
+        } mov_to_cr;
+
+        struct {
+            /* Enable the capture of an extended set of MSRs */
+            uint8_t extended_capture;
+        } mov_to_msr;
+
+        struct {
+            /* Pause vCPU until response */
+            uint8_t sync;
+        } guest_request;
+    } u;
+};
+typedef struct xen_domctl_monitor_op xen_domctl_monitor_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_monitor_op_t);
+
+struct xen_domctl_psr_cat_op {
+#define XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM     0
+#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM     1
+    uint32_t cmd;       /* IN: XEN_DOMCTL_PSR_CAT_OP_* */
+    uint32_t target;    /* IN */
+    uint64_t data;      /* IN/OUT */
+};
+typedef struct xen_domctl_psr_cat_op xen_domctl_psr_cat_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cat_op_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -1046,8 +1114,8 @@ struct xen_domctl {
 #define XEN_DOMCTL_unpausedomain                  4
 #define XEN_DOMCTL_getdomaininfo                  5
 #define XEN_DOMCTL_getmemlist                     6
-#define XEN_DOMCTL_getpageframeinfo               7
-#define XEN_DOMCTL_getpageframeinfo2              8
+/* #define XEN_DOMCTL_getpageframeinfo            7 Obsolete - use getpageframeinfo3 */
+/* #define XEN_DOMCTL_getpageframeinfo2           8 Obsolete - use getpageframeinfo3 */
 #define XEN_DOMCTL_setvcpuaffinity                9
 #define XEN_DOMCTL_shadow_op                     10
 #define XEN_DOMCTL_max_mem                       11
@@ -1062,10 +1130,10 @@ struct xen_domctl {
 #define XEN_DOMCTL_iomem_permission              20
 #define XEN_DOMCTL_ioport_permission             21
 #define XEN_DOMCTL_hypercall_init                22
-#define XEN_DOMCTL_arch_setup                    23
+#define XEN_DOMCTL_arch_setup                    23 /* Obsolete IA64 only */
 #define XEN_DOMCTL_settimeoffset                 24
 #define XEN_DOMCTL_getvcpuaffinity               25
-#define XEN_DOMCTL_real_mode_area                26
+#define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
 #define XEN_DOMCTL_resumedomain                  27
 #define XEN_DOMCTL_sendtrigger                   28
 #define XEN_DOMCTL_subscribe                     29
@@ -1080,7 +1148,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_pin_mem_cacheattr             41
 #define XEN_DOMCTL_set_ext_vcpucontext           42
 #define XEN_DOMCTL_get_ext_vcpucontext           43
-#define XEN_DOMCTL_set_opt_feature               44
+#define XEN_DOMCTL_set_opt_feature               44 /* Obsolete IA64 only */
 #define XEN_DOMCTL_test_assign_device            45
 #define XEN_DOMCTL_set_target                    46
 #define XEN_DOMCTL_deassign_device               47
@@ -1092,7 +1160,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_suppress_spurious_page_faults 53
 #define XEN_DOMCTL_debug_op                      54
 #define XEN_DOMCTL_gethvmcontext_partial         55
-#define XEN_DOMCTL_mem_event_op                  56
+#define XEN_DOMCTL_vm_event_op                   56
 #define XEN_DOMCTL_mem_sharing_op                57
 #define XEN_DOMCTL_disable_migrate               58
 #define XEN_DOMCTL_gettscinfo                    59
@@ -1112,7 +1180,8 @@ struct xen_domctl {
 #define XEN_DOMCTL_set_vcpu_msrs                 73
 #define XEN_DOMCTL_setvnumainfo                  74
 #define XEN_DOMCTL_psr_cmt_op                    75
-#define XEN_DOMCTL_arm_configure_domain          76
+#define XEN_DOMCTL_monitor_op                    77
+#define XEN_DOMCTL_psr_cat_op                    78
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -1126,8 +1195,6 @@ struct xen_domctl {
 #endif
         struct xen_domctl_getdomaininfo     getdomaininfo;
         struct xen_domctl_getmemlist        getmemlist;
-        struct xen_domctl_getpageframeinfo  getpageframeinfo;
-        struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
         struct xen_domctl_getpageframeinfo3 getpageframeinfo3;
         struct xen_domctl_nodeaffinity      nodeaffinity;
         struct xen_domctl_vcpuaffinity      vcpuaffinity;
@@ -1163,7 +1230,7 @@ struct xen_domctl {
         struct xen_domctl_set_target        set_target;
         struct xen_domctl_subscribe         subscribe;
         struct xen_domctl_debug_op          debug_op;
-        struct xen_domctl_mem_event_op      mem_event_op;
+        struct xen_domctl_vm_event_op       vm_event_op;
         struct xen_domctl_mem_sharing_op    mem_sharing_op;
 #if defined(__i386__) || defined(__x86_64__)
         struct xen_domctl_cpuid             cpuid;
@@ -1181,6 +1248,8 @@ struct xen_domctl {
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         struct xen_domctl_vnuma             vnuma;
         struct xen_domctl_psr_cmt_op        psr_cmt_op;
+        struct xen_domctl_monitor_op        monitor_op;
+        struct xen_domctl_psr_cat_op        psr_cat_op;
         uint8_t                             pad[128];
     } u;
 };
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/errno.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/errno.h	Fri Oct 16 16:24:14 2015 +0200
@@ -0,0 +1,95 @@
+#ifndef __XEN_PUBLIC_ERRNO_H__
+
+#ifndef __ASSEMBLY__
+
+#define XEN_ERRNO(name, value) XEN_##name = value,
+enum xen_errno {
+
+#else /* !__ASSEMBLY__ */
+
+#define XEN_ERRNO(name, value) .equ XEN_##name, value
+
+#endif /* __ASSEMBLY__ */
+
+/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
+/* ` enum errnoval { */
+
+#endif /* __XEN_PUBLIC_ERRNO_H__ */
+
+#ifdef 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 */
+XEN_ERRNO(ENOENT,	 2)	/* No such file or directory */
+XEN_ERRNO(ESRCH,	 3)	/* No such process */
+#ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
+XEN_ERRNO(EINTR,	 4)	/* Interrupted system call */
+#endif
+XEN_ERRNO(EIO,		 5)	/* I/O error */
+XEN_ERRNO(ENXIO,	 6)	/* No such device or address */
+XEN_ERRNO(E2BIG,	 7)	/* Arg list too long */
+XEN_ERRNO(ENOEXEC,	 8)	/* Exec format error */
+XEN_ERRNO(EBADF,	 9)	/* Bad file number */
+XEN_ERRNO(ECHILD,	10)	/* No child processes */
+XEN_ERRNO(EAGAIN,	11)	/* Try again */
+XEN_ERRNO(ENOMEM,	12)	/* Out of memory */
+XEN_ERRNO(EACCES,	13)	/* Permission denied */
+XEN_ERRNO(EFAULT,	14)	/* Bad address */
+XEN_ERRNO(EBUSY,	16)	/* Device or resource busy */
+XEN_ERRNO(EEXIST,	17)	/* File exists */
+XEN_ERRNO(EXDEV,	18)	/* Cross-device link */
+XEN_ERRNO(ENODEV,	19)	/* No such device */
+XEN_ERRNO(EINVAL,	22)	/* Invalid argument */
+XEN_ERRNO(ENFILE,	23)	/* File table overflow */
+XEN_ERRNO(EMFILE,	24)	/* Too many open files */
+XEN_ERRNO(ENOSPC,	28)	/* No space left on device */
+XEN_ERRNO(EMLINK,	31)	/* Too many links */
+XEN_ERRNO(EDOM,		33)	/* Math argument out of domain of func */
+XEN_ERRNO(ERANGE,	34)	/* Math result not representable */
+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(ENODATA,	61)	/* No data available */
+XEN_ERRNO(ETIME,	62)	/* Timer expired */
+XEN_ERRNO(EBADMSG,	74)	/* Not a data message */
+XEN_ERRNO(EOVERFLOW,	75)	/* Value too large for defined data type */
+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(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 */
+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(ETIMEDOUT,	110)	/* Connection timed out */
+
+#undef XEN_ERRNO
+#endif /* XEN_ERRNO */
+
+#ifndef __XEN_PUBLIC_ERRNO_H__
+#define __XEN_PUBLIC_ERRNO_H__
+
+/* ` } */
+
+#ifndef __ASSEMBLY__
+};
+#endif
+
+#define	XEN_EWOULDBLOCK	XEN_EAGAIN	/* Operation would block */
+#define	XEN_EDEADLOCK	XEN_EDEADLK	/* Resource deadlock would occur */
+
+#endif /*  __XEN_PUBLIC_ERRNO_H__ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/features.h
--- a/include/xen/interface/features.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/features.h	Fri Oct 16 16:24:14 2015 +0200
@@ -99,6 +99,9 @@
 #define XENFEAT_grant_map_identity        12
  */
 
+/* Guest can use XENMEMF_vnode to specify virtual node for memory op. */
+#define XENFEAT_memory_op_vnode_supported 13
+
 #define XENFEAT_NR_SUBMAPS 1
 
 #endif /* __XEN_PUBLIC_FEATURES_H__ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/grant_table.h
--- a/include/xen/interface/grant_table.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/grant_table.h	Fri Oct 16 16:24:14 2015 +0200
@@ -134,8 +134,10 @@ struct grant_entry_v1 {
     /* The domain being granted foreign privileges. [GST] */
     domid_t  domid;
     /*
-     * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
-     * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
+     * GTF_permit_access: GFN that @domid is allowed to map and access. [GST]
+     * GTF_accept_transfer: GFN that @domid is allowed to transfer into. [GST]
+     * GTF_transfer_completed: MFN whose ownership transferred by @domid
+     *                         (non-translated guests only). [XEN]
      */
     uint32_t frame;
 };
@@ -321,7 +323,7 @@ typedef uint32_t grant_handle_t;
 /*
  * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
  * by devices and/or host CPUs. If successful, <handle> is a tracking number
- * that must be presented later to destroy the mapping(s). On error, <handle>
+ * that must be presented later to destroy the mapping(s). On error, <status>
  * is a negative status code.
  * NOTES:
  *  1. If GNTMAP_device_map is specified then <dev_bus_addr> is the address
@@ -453,7 +455,7 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_
 
 struct gnttab_copy {
     /* IN parameters. */
-    struct {
+    struct gnttab_copy_ptr {
         union {
             grant_ref_t ref;
             xen_pfn_t   gmfn;
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/e820.h
--- a/include/xen/interface/hvm/e820.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/e820.h	Fri Oct 16 16:24:14 2015 +0200
@@ -1,4 +1,3 @@
-
 /*
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -17,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_E820_H__
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/hvm_info_table.h
--- a/include/xen/interface/hvm/hvm_info_table.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/hvm_info_table.h	Fri Oct 16 16:24:14 2015 +0200
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/hvm_op.h
--- a/include/xen/interface/hvm/hvm_op.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/hvm_op.h	Fri Oct 16 16:24:14 2015 +0200
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
@@ -81,6 +83,7 @@ typedef enum {
     HVMMEM_ram_rw,             /* Normal read/write guest RAM */
     HVMMEM_ram_ro,             /* Read-only; writes are discarded */
     HVMMEM_mmio_dm,            /* Reads and write go to the device model */
+    HVMMEM_mmio_write_dm       /* Read-only; writes go to the device model */
 } hvmmem_type_t;
 
 /* Following tools-only interfaces may change in future. */
@@ -265,6 +268,13 @@ typedef uint16_t ioservid_t;
 #define HVMOP_create_ioreq_server 17
 struct xen_hvm_create_ioreq_server {
     domid_t domid;           /* IN - domain to be serviced */
+#define HVM_IOREQSRV_BUFIOREQ_OFF    0
+#define HVM_IOREQSRV_BUFIOREQ_LEGACY 1
+/*
+ * Use this when read_pointer gets updated atomically and
+ * the pointer pair gets read atomically:
+ */
+#define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
     uint8_t handle_bufioreq; /* IN - should server handle buffered ioreqs */
     ioservid_t id;           /* OUT - server id */
 };
@@ -369,6 +379,116 @@ DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_iore
 
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
+#if defined(__i386__) || defined(__x86_64__)
+
+/*
+ * HVMOP_set_evtchn_upcall_vector: Set a <vector> that should be used for event
+ *                                 channel upcalls on the specified <vcpu>. If set,
+ *                                 this vector will be used in preference to the
+ *                                 domain global callback via (see
+ *                                 HVM_PARAM_CALLBACK_IRQ).
+ */
+#define HVMOP_set_evtchn_upcall_vector 23
+struct xen_hvm_evtchn_upcall_vector {
+    uint32_t vcpu;
+    uint8_t vector;
+};
+typedef struct xen_hvm_evtchn_upcall_vector xen_hvm_evtchn_upcall_vector_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_evtchn_upcall_vector_t);
+
+#endif /* defined(__i386__) || defined(__x86_64__) */
+
+#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__ */
 
 /*
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/hvm_xs_strings.h
--- a/include/xen/interface/hvm/hvm_xs_strings.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/hvm_xs_strings.h	Fri Oct 16 16:24:14 2015 +0200
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2013, Citrix Systems
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_XS_STRINGS_H__
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/ioreq.h
--- a/include/xen/interface/hvm/ioreq.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/ioreq.h	Fri Oct 16 16:24:14 2015 +0200
@@ -83,8 +83,17 @@ typedef struct buf_ioreq buf_ioreq_t;
 
 #define IOREQ_BUFFER_SLOT_NUM     511 /* 8 bytes each, plus 2 4-byte indexes */
 struct buffered_iopage {
-    unsigned int read_pointer;
-    unsigned int write_pointer;
+#ifdef __XEN__
+    union bufioreq_pointers {
+        struct {
+#endif
+            uint32_t read_pointer;
+            uint32_t write_pointer;
+#ifdef __XEN__
+        };
+        uint64_t full;
+    } ptrs;
+#endif
     buf_ioreq_t buf_ioreq[IOREQ_BUFFER_SLOT_NUM];
 }; /* NB. Size of this structure must be no greater than one page. */
 typedef struct buffered_iopage buffered_iopage_t;
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/params.h
--- a/include/xen/interface/hvm/params.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/params.h	Fri Oct 16 16:24:14 2015 +0200
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_PARAMS_H__
@@ -97,10 +99,15 @@
 #define _HVMPV_time_ref_count 2
 #define HVMPV_time_ref_count  (1 << _HVMPV_time_ref_count)
 
+/* Enable Reference TSC Page (HV_X64_MSR_REFERENCE_TSC) */
+#define _HVMPV_reference_tsc 3
+#define HVMPV_reference_tsc  (1 << _HVMPV_reference_tsc)
+
 #define HVMPV_feature_mask \
 	(HVMPV_base_freq | \
 	 HVMPV_no_freq | \
-	 HVMPV_time_ref_count)
+	 HVMPV_time_ref_count | \
+	 HVMPV_reference_tsc)
 
 #endif
 
@@ -162,8 +169,7 @@
  */
 #define HVM_PARAM_ACPI_IOPORTS_LOCATION 19
 
-/* Enable blocking memory events, async or sync (pause vcpu until response) 
- * onchangeonly indicates messages only on a change of value */
+/* Deprecated */
 #define HVM_PARAM_MEMORY_EVENT_CR0          20
 #define HVM_PARAM_MEMORY_EVENT_CR3          21
 #define HVM_PARAM_MEMORY_EVENT_CR4          22
@@ -171,18 +177,12 @@
 #define HVM_PARAM_MEMORY_EVENT_SINGLE_STEP  25
 #define HVM_PARAM_MEMORY_EVENT_MSR          30
 
-#define HVMPME_MODE_MASK       (3 << 0)
-#define HVMPME_mode_disabled   0
-#define HVMPME_mode_async      1
-#define HVMPME_mode_sync       2
-#define HVMPME_onchangeonly    (1 << 2)
-
 /* Boolean: Enable nestedhvm (hvm only) */
 #define HVM_PARAM_NESTEDHVM    24
 
 /* Params for the mem event rings */
 #define HVM_PARAM_PAGING_RING_PFN   27
-#define HVM_PARAM_ACCESS_RING_PFN   28
+#define HVM_PARAM_MONITOR_RING_PFN  28
 #define HVM_PARAM_SHARING_RING_PFN  29
 
 /* SHUTDOWN_* action in case of a triple fault */
@@ -194,6 +194,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__ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/blkif.h
--- a/include/xen/interface/io/blkif.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/blkif.h	Fri Oct 16 16:24:14 2015 +0200
@@ -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"
  *
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/libxenvchan.h
--- a/include/xen/interface/io/libxenvchan.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/libxenvchan.h	Fri Oct 16 16:24:14 2015 +0200
@@ -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 -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/netif.h
--- a/include/xen/interface/io/netif.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/netif.h	Fri Oct 16 16:24:14 2015 +0200
@@ -136,14 +136,145 @@
  */
 
 /*
+ * "feature-multicast-control" advertises the capability to filter ethernet
+ * multicast packets in the backend. To enable use of this capability the
+ * frontend must set "request-multicast-control" before moving into the
+ * connected state.
+ *
+ * If "request-multicast-control" is set then the backend transmit side should
+ * no longer flood multicast packets to the frontend, it should instead drop any
+ * multicast packet that does not match in a filter list. The list is
+ * amended by the frontend by sending dummy transmit requests containing
+ * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL} extra-info fragments as specified below.
+ * Once enabled by the frontend, the feature cannot be disabled except by
+ * closing and re-connecting to the backend.
+ */
+
+/*
  * This is the 'wire' format for packets:
- *  Request 1: netif_tx_request -- NETTXF_* (any flags)
- * [Request 2: netif_tx_extra]  (only if request 1 has NETTXF_extra_info)
- * [Request 3: netif_tx_extra]  (only if request 2 has XEN_NETIF_EXTRA_MORE)
- *  Request 4: netif_tx_request -- NETTXF_more_data
- *  Request 5: netif_tx_request -- NETTXF_more_data
+ *  Request 1: netif_tx_request_t -- NETTXF_* (any flags)
+ * [Request 2: netif_extra_info_t] (only if request 1 has NETTXF_extra_info)
+ * [Request 3: netif_extra_info_t] (only if request 2 has XEN_NETIF_EXTRA_MORE)
+ *  Request 4: netif_tx_request_t -- NETTXF_more_data
+ *  Request 5: netif_tx_request_t -- NETTXF_more_data
  *  ...
- *  Request N: netif_tx_request -- 0
+ *  Request N: netif_tx_request_t -- 0
+ */
+
+/*
+ * Guest transmit
+ * ==============
+ *
+ * Ring slot size is 12 octets, however not all request/response
+ * structs use the full size.
+ *
+ * tx request data (netif_tx_request_t)
+ * ------------------------------------
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | grant ref             | offset    | flags     |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | id        | size      |
+ * +-----+-----+-----+-----+
+ *
+ * grant ref: Reference to buffer page.
+ * offset: Offset within buffer page.
+ * flags: NETTXF_*.
+ * id: request identifier, echoed in response.
+ * size: packet size in bytes.
+ *
+ * tx response (netif_tx_response_t)
+ * ---------------------------------
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | id        | status    | unused                |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | unused                |
+ * +-----+-----+-----+-----+
+ *
+ * id: reflects id in transmit request
+ * status: NETIF_RSP_*
+ *
+ * Guest receive
+ * =============
+ *
+ * Ring slot size is 8 octets.
+ *
+ * rx request (netif_rx_request_t)
+ * -------------------------------
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | id        | pad       | gref                  |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * id: request identifier, echoed in response.
+ * gref: reference to incoming granted frame.
+ *
+ * rx response (netif_rx_response_t)
+ * ---------------------------------
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | id        | offset    | flags     | status    |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * id: reflects id in receive request
+ * offset: offset in page of start of received packet
+ * flags: NETRXF_*
+ * status: -ve: NETIF_RSP_*; +ve: Rx'ed pkt size.
+ *
+ * Extra Info
+ * ==========
+ *
+ * Can be present if initial request has NET{T,R}XF_extra_info, or
+ * previous extra request has XEN_NETIF_EXTRA_MORE.
+ *
+ * The struct therefore needs to fit into either a tx or rx slot and
+ * is therefore limited to 8 octets.
+ *
+ * extra info (netif_extra_info_t)
+ * -------------------------------
+ *
+ * General format:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags| type specfic data                 |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | padding for tx        |
+ * +-----+-----+-----+-----+
+ *
+ * type: XEN_NETIF_EXTRA_TYPE_*
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * padding for tx: present only in the tx case due to 8 octet limit
+ *     from rx case. Not shown in type specific entries below.
+ *
+ * XEN_NETIF_EXTRA_TYPE_GSO:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags| size      |type | pad | features  |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * type: Must be XEN_NETIF_EXTRA_TYPE_GSO
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * size: Maximum payload size of each segment.
+ * type: XEN_NETIF_GSO_TYPE_*
+ * features: EN_NETIF_GSO_FEAT_*
+ *
+ * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags| addr                              |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * type: Must be XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * addr: address to add/remove
  */
 
 /* Protocol checksum field is blank in the packet (hardware offload)? */
@@ -179,7 +310,7 @@ typedef struct netif_tx_request netif_tx
 #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3)  /* u.mcast */
 #define XEN_NETIF_EXTRA_TYPE_MAX       (4)
 
-/* netif_extra_info flags. */
+/* netif_extra_info_t flags. */
 #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
 #define XEN_NETIF_EXTRA_FLAG_MORE  (1U<<_XEN_NETIF_EXTRA_FLAG_MORE)
 
@@ -189,8 +320,8 @@ typedef struct netif_tx_request netif_tx
 #define XEN_NETIF_GSO_TYPE_TCPV6        (2)
 
 /*
- * This structure needs to fit within both netif_tx_request and
- * netif_rx_response for compatibility.
+ * This structure needs to fit within both netif_tx_request_t and
+ * netif_rx_response_t for compatibility.
  */
 struct netif_extra_info {
     uint8_t type;  /* XEN_NETIF_EXTRA_TYPE_* */
@@ -225,14 +356,6 @@ struct netif_extra_info {
 
         /*
          * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}:
-         * Backend advertises availability via 'feature-multicast-control'
-         * xenbus node containing value '1'.
-         * Frontend requests this feature by advertising
-         * 'request-multicast-control' xenbus node containing value '1'.
-         * If multicast control is requested then multicast flooding is
-         * disabled and the frontend must explicitly register its interest
-         * in multicast groups using dummy transmit requests containing
-         * MCAST_{ADD,DEL} extra-info fragments.
          */
         struct {
             uint8_t addr[6]; /* Address to add/remove. */
@@ -251,6 +374,7 @@ typedef struct netif_tx_response netif_t
 
 struct netif_rx_request {
     uint16_t    id;        /* Echoed in response message.        */
+    uint16_t    pad;
     grant_ref_t gref;      /* Reference to incoming granted frame */
 };
 typedef struct netif_rx_request netif_rx_request_t;
@@ -289,7 +413,7 @@ DEFINE_RING_TYPES(netif_rx, struct netif
 #define NETIF_RSP_DROPPED         -2
 #define NETIF_RSP_ERROR           -1
 #define NETIF_RSP_OKAY             0
-/* No response: used for auxiliary requests (e.g., netif_tx_extra). */
+/* No response: used for auxiliary requests (e.g., netif_extra_info_t). */
 #define NETIF_RSP_NULL             1
 
 #endif
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/protocols.h
--- a/include/xen/interface/io/protocols.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/protocols.h	Fri Oct 16 16:24:14 2015 +0200
@@ -18,6 +18,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2008, Keir Fraser
  */
 
 #ifndef __XEN_PROTOCOLS_H__
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/ring.h
--- a/include/xen/interface/io/ring.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/ring.h	Fri Oct 16 16:24:14 2015 +0200
@@ -111,7 +111,7 @@ struct __name##_sring {                 
             uint8_t msg;                                                \
         } tapif_user;                                                   \
         uint8_t pvt_pad[4];                                             \
-    } private;                                                          \
+    } pvt;                                                              \
     uint8_t __pad[44];                                                  \
     union __name##_sring_entry ring[1]; /* variable-length */           \
 };                                                                      \
@@ -156,7 +156,7 @@ typedef struct __name##_back_ring __name
 #define SHARED_RING_INIT(_s) do {                                       \
     (_s)->req_prod  = (_s)->rsp_prod  = 0;                              \
     (_s)->req_event = (_s)->rsp_event = 1;                              \
-    (void)memset((_s)->private.pvt_pad, 0, sizeof((_s)->private.pvt_pad)); \
+    (void)memset((_s)->pvt.pvt_pad, 0, sizeof((_s)->pvt.pvt_pad));      \
     (void)memset((_s)->__pad, 0, sizeof((_s)->__pad));                  \
 } while(0)
 
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/usbif.h
--- a/include/xen/interface/io/usbif.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/usbif.h	Fri Oct 16 16:24:14 2015 +0200
@@ -31,6 +31,76 @@
 #include "ring.h"
 #include "../grant_table.h"
 
+/*
+ * Feature and Parameter Negotiation
+ * =================================
+ * The two halves of a Xen pvUSB driver utilize nodes within the XenStore to
+ * communicate capabilities and to negotiate operating parameters. This
+ * section enumerates these nodes which reside in the respective front and
+ * backend portions of the XenStore, following the XenBus convention.
+ *
+ * Any specified default value is in effect if the corresponding XenBus node
+ * is not present in the XenStore.
+ *
+ * XenStore nodes in sections marked "PRIVATE" are solely for use by the
+ * driver side whose XenBus tree contains them.
+ *
+ *****************************************************************************
+ *                            Backend XenBus Nodes
+ *****************************************************************************
+ *
+ *------------------ Backend Device Identification (PRIVATE) ------------------
+ *
+ * num-ports
+ *      Values:         unsigned [1...31]
+ *
+ *      Number of ports for this (virtual) USB host connector.
+ *
+ * usb-ver
+ *      Values:         unsigned [1...2]
+ *
+ *      USB version of this host connector: 1 = USB 1.1, 2 = USB 2.0.
+ *
+ * port/[1...31]
+ *      Values:         string
+ *
+ *      Physical USB device connected to the given port, e.g. "3-1.5".
+ *
+ *****************************************************************************
+ *                            Frontend XenBus Nodes
+ *****************************************************************************
+ *
+ *----------------------- Request Transport Parameters -----------------------
+ *
+ * event-channel
+ *      Values:         unsigned
+ *
+ *      The identifier of the Xen event channel used to signal activity
+ *      in the ring buffer.
+ *
+ * urb-ring-ref
+ *      Values:         unsigned
+ *
+ *      The Xen grant reference granting permission for the backend to map
+ *      the sole page in a single page sized ring buffer. This is the ring
+ *      buffer for urb requests.
+ *
+ * conn-ring-ref
+ *      Values:         unsigned
+ *
+ *      The Xen grant reference granting permission for the backend to map
+ *      the sole page in a single page sized ring buffer. This is the ring
+ *      buffer for connection/disconnection requests.
+ *
+ * protocol
+ *      Values:         string (XEN_IO_PROTO_ABI_*)
+ *      Default Value:  XEN_IO_PROTO_ABI_NATIVE
+ *
+ *      The machine ABI rules governing the format of all ring request and
+ *      response structures.
+ *
+ */
+
 enum usb_spec_version {
 	USB_VER_UNKNOWN = 0,
 	USB_VER_USB11,
@@ -41,37 +111,65 @@ enum usb_spec_version {
 /*
  *  USB pipe in usbif_request
  *
- *  bits 0-5 are specific bits for virtual USB driver.
- *  bits 7-31 are standard urb pipe.
+ *  - port number:	bits 0-4
+ *				(USB_MAXCHILDREN is 31)
  *
- *  - port number(NEW):	bits 0-4
- *  				(USB_MAXCHILDREN is 31)
- *
- *  - operation flag(NEW):	bit 5
- *  				(0 = submit urb,
- *  				 1 = unlink urb)
+ *  - operation flag:	bit 5
+ *				(0 = submit urb,
+ *				 1 = unlink urb)
  *
  *  - direction:		bit 7
- *  				(0 = Host-to-Device [Out]
- *                           1 = Device-to-Host [In])
+ *				(0 = Host-to-Device [Out]
+ *				 1 = Device-to-Host [In])
  *
  *  - device address:	bits 8-14
  *
  *  - endpoint:		bits 15-18
  *
- *  - pipe type:		bits 30-31
- *  				(00 = isochronous, 01 = interrupt,
- *                           10 = control, 11 = bulk)
+ *  - pipe type:	bits 30-31
+ *				(00 = isochronous, 01 = interrupt,
+ *				 10 = control, 11 = bulk)
  */
-#define usbif_pipeportnum(pipe) ((pipe) & 0x1f)
-#define usbif_setportnum_pipe(pipe, portnum) \
-	((pipe)|(portnum))
 
-#define usbif_pipeunlink(pipe) ((pipe) & 0x20)
-#define usbif_pipesubmit(pipe) (!usbif_pipeunlink(pipe))
-#define usbif_setunlink_pipe(pipe) ((pipe)|(0x20))
+#define USBIF_PIPE_PORT_MASK	0x0000001f
+#define USBIF_PIPE_UNLINK	0x00000020
+#define USBIF_PIPE_DIR		0x00000080
+#define USBIF_PIPE_DEV_MASK	0x0000007f
+#define USBIF_PIPE_DEV_SHIFT	8
+#define USBIF_PIPE_EP_MASK	0x0000000f
+#define USBIF_PIPE_EP_SHIFT	15
+#define USBIF_PIPE_TYPE_MASK	0x00000003
+#define USBIF_PIPE_TYPE_SHIFT	30
+#define USBIF_PIPE_TYPE_ISOC	0
+#define USBIF_PIPE_TYPE_INT	1
+#define USBIF_PIPE_TYPE_CTRL	2
+#define USBIF_PIPE_TYPE_BULK	3
+
+#define usbif_pipeportnum(pipe)			((pipe) & USBIF_PIPE_PORT_MASK)
+#define usbif_setportnum_pipe(pipe, portnum)	((pipe) | (portnum))
+
+#define usbif_pipeunlink(pipe)			((pipe) & USBIF_PIPE_UNLINK)
+#define usbif_pipesubmit(pipe)			(!usbif_pipeunlink(pipe))
+#define usbif_setunlink_pipe(pipe)		((pipe) | USBIF_PIPE_UNLINK)
+
+#define usbif_pipein(pipe)			((pipe) & USBIF_PIPE_DIR)
+#define usbif_pipeout(pipe)			(!usbif_pipein(pipe))
+
+#define usbif_pipedevice(pipe)			\
+		(((pipe) >> USBIF_PIPE_DEV_SHIFT) & USBIF_PIPE_DEV_MASK)
+
+#define usbif_pipeendpoint(pipe)		\
+		(((pipe) >> USBIF_PIPE_EP_SHIFT) & USBIF_PIPE_EP_MASK)
+
+#define usbif_pipetype(pipe)			\
+		(((pipe) >> USBIF_PIPE_TYPE_SHIFT) & USBIF_PIPE_TYPE_MASK)
+#define usbif_pipeisoc(pipe)	(usbif_pipetype(pipe) == USBIF_PIPE_TYPE_ISOC)
+#define usbif_pipeint(pipe)	(usbif_pipetype(pipe) == USBIF_PIPE_TYPE_INT)
+#define usbif_pipectrl(pipe)	(usbif_pipetype(pipe) == USBIF_PIPE_TYPE_CTRL)
+#define usbif_pipebulk(pipe)	(usbif_pipetype(pipe) == USBIF_PIPE_TYPE_BULK)
 
 #define USBIF_MAX_SEGMENTS_PER_REQUEST (16)
+#define USBIF_MAX_PORTNR	31
 
 /*
  * RING for transferring urbs.
@@ -141,6 +239,10 @@ struct usbif_conn_response {
 	uint16_t id; /* request id */
 	uint8_t portnum; /* port number */
 	uint8_t speed; /* usb_device_speed */
+#define USBIF_SPEED_NONE	0
+#define USBIF_SPEED_LOW		1
+#define USBIF_SPEED_FULL	2
+#define USBIF_SPEED_HIGH	3
 };
 typedef struct usbif_conn_response usbif_conn_response_t;
 
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/mem_event.h
--- a/include/xen/interface/mem_event.h	Fri Oct 16 15:57:20 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/******************************************************************************
- * mem_event.h
- *
- * Memory event common structures.
- *
- * Copyright (c) 2009 by Citrix Systems, Inc. (Patrick Colp)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _XEN_PUBLIC_MEM_EVENT_H
-#define _XEN_PUBLIC_MEM_EVENT_H
-
-#include "xen.h"
-#include "io/ring.h"
-
-/* Memory event flags */
-#define MEM_EVENT_FLAG_VCPU_PAUSED     (1 << 0)
-#define MEM_EVENT_FLAG_DROP_PAGE       (1 << 1)
-#define MEM_EVENT_FLAG_EVICT_FAIL      (1 << 2)
-#define MEM_EVENT_FLAG_FOREIGN         (1 << 3)
-#define MEM_EVENT_FLAG_DUMMY           (1 << 4)
-/*
- * Emulate the fault-causing instruction (if set in the event response flags).
- * This will allow the guest to continue execution without lifting the page
- * access restrictions.
- */
-#define MEM_EVENT_FLAG_EMULATE         (1 << 5)
-/*
- * Same as MEM_EVENT_FLAG_EMULATE, but with write operations or operations
- * potentially having side effects (like memory mapped or port I/O) disabled.
- */
-#define MEM_EVENT_FLAG_EMULATE_NOWRITE (1 << 6)
-
-/* Reasons for the memory event request */
-#define MEM_EVENT_REASON_UNKNOWN     0    /* typical reason */
-#define MEM_EVENT_REASON_VIOLATION   1    /* access violation, GFN is address */
-#define MEM_EVENT_REASON_CR0         2    /* CR0 was hit: gfn is new CR0 value, gla is previous */
-#define MEM_EVENT_REASON_CR3         3    /* CR3 was hit: gfn is new CR3 value, gla is previous */
-#define MEM_EVENT_REASON_CR4         4    /* CR4 was hit: gfn is new CR4 value, gla is previous */
-#define MEM_EVENT_REASON_INT3        5    /* int3 was hit: gla/gfn are RIP */
-#define MEM_EVENT_REASON_SINGLESTEP  6    /* single step was invoked: gla/gfn are RIP */
-#define MEM_EVENT_REASON_MSR         7    /* MSR was hit: gfn is MSR value, gla is MSR address;
-                                             does NOT honour HVMPME_onchangeonly */
-
-/* Using a custom struct (not hvm_hw_cpu) so as to not fill
- * the mem_event ring buffer too quickly. */
-struct mem_event_regs_x86 {
-    uint64_t rax;
-    uint64_t rcx;
-    uint64_t rdx;
-    uint64_t rbx;
-    uint64_t rsp;
-    uint64_t rbp;
-    uint64_t rsi;
-    uint64_t rdi;
-    uint64_t r8;
-    uint64_t r9;
-    uint64_t r10;
-    uint64_t r11;
-    uint64_t r12;
-    uint64_t r13;
-    uint64_t r14;
-    uint64_t r15;
-    uint64_t rflags;
-    uint64_t dr7;
-    uint64_t rip;
-    uint64_t cr0;
-    uint64_t cr2;
-    uint64_t cr3;
-    uint64_t cr4;
-    uint64_t sysenter_cs;
-    uint64_t sysenter_esp;
-    uint64_t sysenter_eip;
-    uint64_t msr_efer;
-    uint64_t msr_star;
-    uint64_t msr_lstar;
-    uint64_t fs_base;
-    uint64_t gs_base;
-    uint32_t cs_arbytes;
-    uint32_t _pad;
-};
-
-typedef struct mem_event_st {
-    uint32_t flags;
-    uint32_t vcpu_id;
-
-    uint64_t gfn;
-    uint64_t offset;
-    uint64_t gla; /* if gla_valid */
-
-    uint32_t p2mt;
-
-    uint16_t access_r:1;
-    uint16_t access_w:1;
-    uint16_t access_x:1;
-    uint16_t gla_valid:1;
-    uint16_t fault_with_gla:1;
-    uint16_t fault_in_gpt:1;
-    uint16_t available:10;
-
-    uint16_t reason;
-    struct mem_event_regs_x86 x86_regs;
-} mem_event_request_t, mem_event_response_t;
-
-DEFINE_RING_TYPES(mem_event, mem_event_request_t, mem_event_response_t);
-
-#endif
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/memory.h
--- a/include/xen/interface/memory.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/memory.h	Fri Oct 16 16:24:14 2015 +0200
@@ -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
@@ -55,6 +56,8 @@
 /* Flag to request allocation only from the node specified */
 #define XENMEMF_exact_node_request  (1<<17)
 #define XENMEMF_exact_node(n) (XENMEMF_node(n) | XENMEMF_exact_node_request)
+/* Flag to indicate the node specified is virtual node */
+#define XENMEMF_vnode  (1<<18)
 #endif
 
 struct xen_memory_reservation {
@@ -372,23 +375,23 @@ typedef struct xen_pod_target xen_pod_ta
 #define XENMEM_paging_op_evict              1
 #define XENMEM_paging_op_prep               2
 
-struct xen_mem_event_op {
-    uint8_t     op;         /* XENMEM_*_op_* */
+struct xen_mem_paging_op {
+    uint8_t     op;         /* XENMEM_paging_op_* */
     domid_t     domain;
-    
 
     /* PAGING_PREP IN: buffer to immediately fill page in */
     uint64_aligned_t    buffer;
     /* Other OPs */
     uint64_aligned_t    gfn;           /* IN:  gfn of page being operated on */
 };
-typedef struct xen_mem_event_op xen_mem_event_op_t;
-DEFINE_XEN_GUEST_HANDLE(xen_mem_event_op_t);
+typedef struct xen_mem_paging_op xen_mem_paging_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_mem_paging_op_t);
 
 #define XENMEM_access_op                    21
-#define XENMEM_access_op_resume             0
-#define XENMEM_access_op_set_access         1
-#define XENMEM_access_op_get_access         2
+#define XENMEM_access_op_set_access         0
+#define XENMEM_access_op_get_access         1
+#define XENMEM_access_op_enable_emulate     2
+#define XENMEM_access_op_disable_emulate    3
 
 typedef enum {
     XENMEM_access_n,
@@ -439,12 +442,11 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_access_o
 #define XENMEM_sharing_op_nominate_gfn      0
 #define XENMEM_sharing_op_nominate_gref     1
 #define XENMEM_sharing_op_share             2
-#define XENMEM_sharing_op_resume            3
-#define XENMEM_sharing_op_debug_gfn         4
-#define XENMEM_sharing_op_debug_mfn         5
-#define XENMEM_sharing_op_debug_gref        6
-#define XENMEM_sharing_op_add_physmap       7
-#define XENMEM_sharing_op_audit             8
+#define XENMEM_sharing_op_debug_gfn         3
+#define XENMEM_sharing_op_debug_mfn         4
+#define XENMEM_sharing_op_debug_gref        5
+#define XENMEM_sharing_op_add_physmap       6
+#define XENMEM_sharing_op_audit             7
 
 #define XENMEM_SHARING_OP_S_HANDLE_INVALID  (-10)
 #define XENMEM_SHARING_OP_C_HANDLE_INVALID  (-9)
@@ -521,6 +523,40 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_
  * 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__) */
 
 /*
@@ -572,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 -r 3f51e783c26a -r 288d236ca763 include/xen/interface/physdev.h
--- a/include/xen/interface/physdev.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/physdev.h	Fri Oct 16 16:24:14 2015 +0200
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_PHYSDEV_H__
@@ -293,6 +295,11 @@ struct physdev_pci_device_add {
         uint8_t bus;
         uint8_t devfn;
     } physfn;
+    /*
+     * Optional parameters array.
+     * First element ([0]) is PXM domain associated with the device (if
+     * XEN_PCI_DEV_PXM is set)
+     */
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     uint32_t optarr[];
 #elif defined(__GNUC__)
@@ -344,9 +351,11 @@ DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_
  */
 #define PHYSDEVOP_IRQ_UNMASK_NOTIFY      4
 
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
 /*
  * These all-capitals physdev operation names are superceded by the new names
- * (defined above) since interface version 0x00030202.
+ * (defined above) since interface version 0x00030202. The guard above was
+ * added post-4.5 only though and hence shouldn't check for 0x00030202.
  */
 #define PHYSDEVOP_IRQ_STATUS_QUERY       PHYSDEVOP_irq_status_query
 #define PHYSDEVOP_SET_IOPL               PHYSDEVOP_set_iopl
@@ -357,6 +366,7 @@ DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_
 #define PHYSDEVOP_FREE_VECTOR            PHYSDEVOP_free_irq_vector
 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
 #define PHYSDEVOP_IRQ_SHARED             XENIRQSTAT_shared
+#endif
 
 #if __XEN_INTERFACE_VERSION__ < 0x00040200
 #define PHYSDEVOP_pirq_eoi_gmfn PHYSDEVOP_pirq_eoi_gmfn_v1
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/platform.h
--- a/include/xen/interface/platform.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/platform.h	Fri Oct 16 16:24:14 2015 +0200
@@ -35,13 +35,28 @@
  * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
  * 1 January, 1970 if the current system time was <system_time>.
  */
-#define XENPF_settime             17
-struct xenpf_settime {
+#define XENPF_settime32           17
+struct xenpf_settime32 {
     /* IN variables. */
     uint32_t secs;
     uint32_t nsecs;
     uint64_t system_time;
 };
+#define XENPF_settime64           62
+struct xenpf_settime64 {
+    /* IN variables. */
+    uint64_t secs;
+    uint32_t nsecs;
+    uint32_t mbz;
+    uint64_t system_time;
+};
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
+#define XENPF_settime XENPF_settime32
+#define xenpf_settime xenpf_settime32
+#else
+#define XENPF_settime XENPF_settime64
+#define xenpf_settime xenpf_settime64
+#endif
 typedef struct xenpf_settime xenpf_settime_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t);
 
@@ -126,6 +141,26 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_platform_q
 #define XEN_EFI_query_variable_info           9
 #define XEN_EFI_query_capsule_capabilities   10
 #define XEN_EFI_update_capsule               11
+
+struct xenpf_efi_time {
+    uint16_t year;
+    uint8_t month;
+    uint8_t day;
+    uint8_t hour;
+    uint8_t min;
+    uint8_t sec;
+    uint32_t ns;
+    int16_t tz;
+    uint8_t daylight;
+};
+
+struct xenpf_efi_guid {
+    uint32_t data1;
+    uint16_t data2;
+    uint16_t data3;
+    uint8_t data4[8];
+};
+
 struct xenpf_efi_runtime_call {
     uint32_t function;
     /*
@@ -138,17 +173,7 @@ struct xenpf_efi_runtime_call {
     union {
 #define XEN_EFI_GET_TIME_SET_CLEARS_NS 0x00000001
         struct {
-            struct xenpf_efi_time {
-                uint16_t year;
-                uint8_t month;
-                uint8_t day;
-                uint8_t hour;
-                uint8_t min;
-                uint8_t sec;
-                uint32_t ns;
-                int16_t tz;
-                uint8_t daylight;
-            } time;
+            struct xenpf_efi_time time;
             uint32_t resolution;
             uint32_t accuracy;
         } get_time;
@@ -170,12 +195,7 @@ struct xenpf_efi_runtime_call {
             XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
             xen_ulong_t size;
             XEN_GUEST_HANDLE(void) data;
-            struct xenpf_efi_guid {
-                uint32_t data1;
-                uint16_t data2;
-                uint16_t data3;
-                uint8_t data4[8];
-            } vendor_guid;
+            struct xenpf_efi_guid vendor_guid;
         } get_variable, set_variable;
 
         struct {
@@ -540,6 +560,16 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_core_parki
 #define XEN_RESOURCE_OP_MSR_READ  0
 #define XEN_RESOURCE_OP_MSR_WRITE 1
 
+/*
+ * Specially handled MSRs:
+ * - MSR_IA32_TSC
+ * READ: Returns the scaled system time(ns) instead of raw timestamp. In
+ *       multiple entry case, if other MSR read is followed by a MSR_IA32_TSC
+ *       read, then both reads are guaranteed to be performed atomically (with
+ *       IRQ disabled). The return time indicates the point of reading that MSR.
+ * WRITE: Not supported.
+ */
+
 struct xenpf_resource_entry {
     union {
         uint32_t cmd;   /* IN: XEN_RESOURCE_OP_* */
@@ -560,6 +590,24 @@ struct xenpf_resource_op {
 typedef struct xenpf_resource_op xenpf_resource_op_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_resource_op_t);
 
+#define XENPF_get_symbol   63
+struct xenpf_symdata {
+    /* IN/OUT variables */
+    uint32_t namelen; /* IN:  size of name buffer                       */
+                      /* OUT: strlen(name) of hypervisor symbol (may be */
+                      /*      larger than what's been copied to guest)  */
+    uint32_t symnum;  /* IN:  Symbol to read                            */
+                      /* OUT: Next available symbol. If same as IN then */
+                      /*      we reached the end                        */
+
+    /* OUT variables */
+    XEN_GUEST_HANDLE(char) name;
+    uint64_t address;
+    char type;
+};
+typedef struct xenpf_symdata xenpf_symdata_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t);
+
 /*
  * ` enum neg_errnoval
  * ` HYPERVISOR_platform_op(const struct xen_platform_op*);
@@ -569,6 +617,8 @@ struct xen_platform_op {
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
     union {
         struct xenpf_settime           settime;
+        struct xenpf_settime32         settime32;
+        struct xenpf_settime64         settime64;
         struct xenpf_add_memtype       add_memtype;
         struct xenpf_del_memtype       del_memtype;
         struct xenpf_read_memtype      read_memtype;
@@ -587,6 +637,7 @@ struct xen_platform_op {
         struct xenpf_mem_hotadd        mem_add;
         struct xenpf_core_parking      core_parking;
         struct xenpf_resource_op       resource_op;
+        struct xenpf_symdata           symdata;
         uint8_t                        pad[128];
     } u;
 };
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/pmu.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/pmu.h	Fri Oct 16 16:24:14 2015 +0200
@@ -0,0 +1,133 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
+#ifndef __XEN_PUBLIC_PMU_H__
+#define __XEN_PUBLIC_PMU_H__
+
+#include "xen.h"
+#if defined(__i386__) || defined(__x86_64__)
+#include "arch-x86/pmu.h"
+#elif defined (__arm__) || defined (__aarch64__)
+#include "arch-arm.h"
+#else
+#error "Unsupported architecture"
+#endif
+
+#define XENPMU_VER_MAJ    0
+#define XENPMU_VER_MIN    1
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_xenpmu_op(enum xenpmu_op cmd, struct xenpmu_params *args);
+ *
+ * @cmd  == XENPMU_* (PMU operation)
+ * @args == struct xenpmu_params
+ */
+/* ` enum xenpmu_op { */
+#define XENPMU_mode_get        0 /* Also used for getting PMU version */
+#define XENPMU_mode_set        1
+#define XENPMU_feature_get     2
+#define XENPMU_feature_set     3
+#define XENPMU_init            4
+#define XENPMU_finish          5
+#define XENPMU_lvtpc_set       6
+#define XENPMU_flush           7 /* Write cached MSR values to HW     */
+/* ` } */
+
+/* Parameters structure for HYPERVISOR_xenpmu_op call */
+struct xen_pmu_params {
+    /* IN/OUT parameters */
+    struct {
+        uint32_t maj;
+        uint32_t min;
+    } version;
+    uint64_t val;
+
+    /* IN parameters */
+    uint32_t vcpu;
+    uint32_t pad;
+};
+typedef struct xen_pmu_params xen_pmu_params_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_params_t);
+
+/* PMU modes:
+ * - XENPMU_MODE_OFF:   No PMU virtualization
+ * - XENPMU_MODE_SELF:  Guests can profile themselves
+ * - XENPMU_MODE_HV:    Guests can profile themselves, dom0 profiles
+ *                      itself and Xen
+ * - XENPMU_MODE_ALL:   Only dom0 has access to VPMU and it profiles
+ *                      everyone: itself, the hypervisor and the guests.
+ */
+#define XENPMU_MODE_OFF           0
+#define XENPMU_MODE_SELF          (1<<0)
+#define XENPMU_MODE_HV            (1<<1)
+#define XENPMU_MODE_ALL           (1<<2)
+
+/*
+ * PMU features:
+ * - XENPMU_FEATURE_INTEL_BTS: Intel BTS support (ignored on AMD)
+ */
+#define XENPMU_FEATURE_INTEL_BTS  1
+
+/*
+ * Shared PMU data between hypervisor and PV(H) domains.
+ *
+ * The hypervisor fills out this structure during PMU interrupt and sends an
+ * interrupt to appropriate VCPU.
+ * Architecture-independent fields of xen_pmu_data are WO for the hypervisor
+ * and RO for the guest but some fields in xen_pmu_arch can be writable
+ * by both the hypervisor and the guest (see arch-$arch/pmu.h).
+ */
+struct xen_pmu_data {
+    /* Interrupted VCPU */
+    uint32_t vcpu_id;
+
+    /*
+     * Physical processor on which the interrupt occurred. On non-privileged
+     * guests set to vcpu_id;
+     */
+    uint32_t pcpu_id;
+
+    /*
+     * Domain that was interrupted. On non-privileged guests set to DOMID_SELF.
+     * On privileged guests can be DOMID_SELF, DOMID_XEN, or, when in
+     * XENPMU_MODE_ALL mode, domain ID of another domain.
+     */
+    domid_t  domain_id;
+
+    uint8_t pad[6];
+
+    /* Architecture-specific information */
+    struct xen_pmu_arch pmu;
+};
+
+#endif /* __XEN_PUBLIC_PMU_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/sysctl.h
--- a/include/xen/interface/sysctl.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/sysctl.h	Fri Oct 16 16:24:14 2015 +0200
@@ -33,8 +33,10 @@
 
 #include "xen.h"
 #include "domctl.h"
+#include "physdev.h"
+#include "tmem.h"
 
-#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000B
+#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000C
 
 /*
  * Read console content from Xen buffer ring.
@@ -462,61 +464,76 @@ struct xen_sysctl_lockprof_op {
 typedef struct xen_sysctl_lockprof_op xen_sysctl_lockprof_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_op_t);
 
-/* XEN_SYSCTL_topologyinfo */
-#define INVALID_TOPOLOGY_ID  (~0U)
-struct xen_sysctl_topologyinfo {
-    /*
-     * IN: maximum addressable entry in the caller-provided arrays.
-     * OUT: largest cpu identifier in the system.
-     * If OUT is greater than IN then the arrays are truncated!
-     * If OUT is leass than IN then the array tails are not written by sysctl.
-     */
-    uint32_t max_cpu_index;
+/* XEN_SYSCTL_cputopoinfo */
+#define XEN_INVALID_CORE_ID     (~0U)
+#define XEN_INVALID_SOCKET_ID   (~0U)
+#define XEN_INVALID_NODE_ID     (~0U)
+
+struct xen_sysctl_cputopo {
+    uint32_t core;
+    uint32_t socket;
+    uint32_t node;
+};
+typedef struct xen_sysctl_cputopo xen_sysctl_cputopo_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cputopo_t);
+
+/*
+ * IN:
+ *  - a NULL 'cputopo' handle is a request for maximun 'num_cpus'.
+ *  - otherwise it's the number of entries in 'cputopo'
+ *
+ * OUT:
+ *  - If 'num_cpus' is less than the number Xen wants to write but the handle
+ *    handle is not a NULL one, partial data gets returned and 'num_cpus' gets
+ *    updated to reflect the intended number.
+ *  - Otherwise, 'num_cpus' shall indicate the number of entries written, which
+ *    may be less than the input value.
+ */
+struct xen_sysctl_cputopoinfo {
+    uint32_t num_cpus;
+    XEN_GUEST_HANDLE_64(xen_sysctl_cputopo_t) cputopo;
+};
+typedef struct xen_sysctl_cputopoinfo xen_sysctl_cputopoinfo_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cputopoinfo_t);
+
+/* XEN_SYSCTL_numainfo */
+#define XEN_INVALID_MEM_SZ     (~0U)
+#define XEN_INVALID_NODE_DIST  (~0U)
+
+struct xen_sysctl_meminfo {
+    uint64_t memsize;
+    uint64_t memfree;
+};
+typedef struct xen_sysctl_meminfo xen_sysctl_meminfo_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_meminfo_t);
+
+/*
+ * IN:
+ *  - Both 'meminfo' and 'distance' handles being null is a request
+ *    for maximum value of 'num_nodes'.
+ *  - Otherwise it's the number of entries in 'meminfo' and square root
+ *    of number of entries in 'distance' (when corresponding handle is
+ *    non-null)
+ *
+ * OUT:
+ *  - If 'num_nodes' is less than the number Xen wants to write but either
+ *    handle is not a NULL one, partial data gets returned and 'num_nodes'
+ *    gets updated to reflect the intended number.
+ *  - Otherwise, 'num_nodes' shall indicate the number of entries written, which
+ *    may be less than the input value.
+ */
+
+struct xen_sysctl_numainfo {
+    uint32_t num_nodes;
+
+    XEN_GUEST_HANDLE_64(xen_sysctl_meminfo_t) meminfo;
 
     /*
-     * If not NULL, these arrays are filled with core/socket/node identifier
-     * for each cpu.
-     * If a cpu has no core/socket/node information (e.g., cpu not present) 
-     * then the sentinel value ~0u is written to each array.
-     * The number of array elements written by the sysctl is:
-     *   min(@max_cpu_index_IN,@max_cpu_index_OUT)+1
+     * Distance between nodes 'i' and 'j' is stored in index 'i*N + j',
+     * where N is the number of nodes that will be returned in 'num_nodes'
+     * (i.e. not 'num_nodes' provided by the caller)
      */
-    XEN_GUEST_HANDLE_64(uint32) cpu_to_core;
-    XEN_GUEST_HANDLE_64(uint32) cpu_to_socket;
-    XEN_GUEST_HANDLE_64(uint32) cpu_to_node;
-};
-typedef struct xen_sysctl_topologyinfo xen_sysctl_topologyinfo_t;
-DEFINE_XEN_GUEST_HANDLE(xen_sysctl_topologyinfo_t);
-
-/* XEN_SYSCTL_numainfo */
-#define INVALID_NUMAINFO_ID (~0U)
-struct xen_sysctl_numainfo {
-    /*
-     * IN: maximum addressable entry in the caller-provided arrays.
-     * OUT: largest node identifier in the system.
-     * If OUT is greater than IN then the arrays are truncated!
-     */
-    uint32_t max_node_index;
-
-    /* NB. Entries are 0 if node is not present. */
-    XEN_GUEST_HANDLE_64(uint64) node_to_memsize;
-    XEN_GUEST_HANDLE_64(uint64) node_to_memfree;
-
-    /*
-     * Array, of size (max_node_index+1)^2, listing memory access distances
-     * between nodes. If an entry has no node distance information (e.g., node 
-     * not present) then the value ~0u is written.
-     * 
-     * Note that the array rows must be indexed by multiplying by the minimum 
-     * of the caller-provided max_node_index and the returned value of
-     * max_node_index. That is, if the largest node index in the system is
-     * smaller than the caller can handle, a smaller 2-d array is constructed
-     * within the space provided by the caller. When this occurs, trailing
-     * space provided by the caller is not modified. If the largest node index
-     * in the system is larger than the caller can handle, then a 2-d array of
-     * the maximum size handleable by the caller is constructed.
-     */
-    XEN_GUEST_HANDLE_64(uint32) node_to_node_distance;
+    XEN_GUEST_HANDLE_64(uint32) distance;
 };
 typedef struct xen_sysctl_numainfo xen_sysctl_numainfo_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_numainfo_t);
@@ -641,6 +658,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cover
 /* The L3 cache size is returned in KB unit */
 #define XEN_SYSCTL_PSR_CMT_get_l3_cache_size         2
 #define XEN_SYSCTL_PSR_CMT_enabled                   3
+#define XEN_SYSCTL_PSR_CMT_get_l3_event_mask         4
 struct xen_sysctl_psr_cmt_op {
     uint32_t cmd;       /* IN: XEN_SYSCTL_PSR_CMT_* */
     uint32_t flags;     /* padding variable, may be extended for future use */
@@ -655,6 +673,97 @@ struct xen_sysctl_psr_cmt_op {
 typedef struct xen_sysctl_psr_cmt_op xen_sysctl_psr_cmt_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_psr_cmt_op_t);
 
+/* XEN_SYSCTL_pcitopoinfo */
+#define XEN_INVALID_DEV (XEN_INVALID_NODE_ID - 1)
+struct xen_sysctl_pcitopoinfo {
+    /*
+     * IN: Number of elements in 'pcitopo' and 'nodes' arrays.
+     * OUT: Number of processed elements of those arrays.
+     */
+    uint32_t num_devs;
+
+    /* IN: list of devices for which node IDs are requested. */
+    XEN_GUEST_HANDLE_64(physdev_pci_device_t) devs;
+
+    /*
+     * OUT: node identifier for each device.
+     * If information for a particular device is not available then
+     * corresponding entry will be set to XEN_INVALID_NODE_ID. If
+     * device is not known to the hypervisor then XEN_INVALID_DEV
+     * will be provided.
+     */
+    XEN_GUEST_HANDLE_64(uint32) nodes;
+};
+typedef struct xen_sysctl_pcitopoinfo xen_sysctl_pcitopoinfo_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_pcitopoinfo_t);
+
+#define XEN_SYSCTL_PSR_CAT_get_l3_info               0
+struct xen_sysctl_psr_cat_op {
+    uint32_t cmd;       /* IN: XEN_SYSCTL_PSR_CAT_* */
+    uint32_t target;    /* IN */
+    union {
+        struct {
+            uint32_t cbm_len;   /* OUT: CBM length */
+            uint32_t cos_max;   /* OUT: Maximum COS */
+        } l3_info;
+    } u;
+};
+typedef struct xen_sysctl_psr_cat_op xen_sysctl_psr_cat_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_psr_cat_op_t);
+
+#define XEN_SYSCTL_TMEM_OP_ALL_CLIENTS 0xFFFFU
+
+#define XEN_SYSCTL_TMEM_OP_THAW                   0
+#define XEN_SYSCTL_TMEM_OP_FREEZE                 1
+#define XEN_SYSCTL_TMEM_OP_FLUSH                  2
+#define XEN_SYSCTL_TMEM_OP_DESTROY                3
+#define XEN_SYSCTL_TMEM_OP_LIST                   4
+#define XEN_SYSCTL_TMEM_OP_SET_WEIGHT             5
+#define XEN_SYSCTL_TMEM_OP_SET_CAP                6
+#define XEN_SYSCTL_TMEM_OP_SET_COMPRESS           7
+#define XEN_SYSCTL_TMEM_OP_QUERY_FREEABLE_MB      8
+#define XEN_SYSCTL_TMEM_OP_SAVE_BEGIN             10
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_VERSION       11
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_MAXPOOLS      12
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_WEIGHT 13
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_CAP    14
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_FLAGS  15
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_FLAGS    16
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_NPAGES   17
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_UUID     18
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_PAGE     19
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_INV      20
+#define XEN_SYSCTL_TMEM_OP_SAVE_END               21
+#define XEN_SYSCTL_TMEM_OP_RESTORE_BEGIN          30
+#define XEN_SYSCTL_TMEM_OP_RESTORE_PUT_PAGE       32
+#define XEN_SYSCTL_TMEM_OP_RESTORE_FLUSH_PAGE     33
+
+/*
+ * XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_[PAGE|INV] override the 'buf' in
+ * xen_sysctl_tmem_op with this structure - sometimes with an extra
+ * page tackled on.
+ */
+struct tmem_handle {
+    uint32_t pool_id;
+    uint32_t index;
+    xen_tmem_oid_t oid;
+};
+
+struct xen_sysctl_tmem_op {
+    uint32_t cmd;       /* IN: XEN_SYSCTL_TMEM_OP_* . */
+    int32_t pool_id;    /* IN: 0 by default unless _SAVE_*, RESTORE_* .*/
+    uint32_t cli_id;    /* IN: client id, 0 for XEN_SYSCTL_TMEM_QUERY_FREEABLE_MB
+                           for all others can be the domain id or
+                           XEN_SYSCTL_TMEM_OP_ALL_CLIENTS for all. */
+    uint32_t arg1;      /* IN: If not applicable to command use 0. */
+    uint32_t arg2;      /* IN: If not applicable to command use 0. */
+    uint32_t pad;       /* Padding so structure is the same under 32 and 64. */
+    xen_tmem_oid_t oid; /* IN: If not applicable to command use 0s. */
+    XEN_GUEST_HANDLE_64(char) buf; /* IN/OUT: Buffer to save and restore ops. */
+};
+typedef struct xen_sysctl_tmem_op xen_sysctl_tmem_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tmem_op_t);
+
 struct xen_sysctl {
     uint32_t cmd;
 #define XEN_SYSCTL_readconsole                    1
@@ -671,18 +780,22 @@ struct xen_sysctl {
 #define XEN_SYSCTL_pm_op                         12
 #define XEN_SYSCTL_page_offline_op               14
 #define XEN_SYSCTL_lockprof_op                   15
-#define XEN_SYSCTL_topologyinfo                  16 
+#define XEN_SYSCTL_cputopoinfo                   16
 #define XEN_SYSCTL_numainfo                      17
 #define XEN_SYSCTL_cpupool_op                    18
 #define XEN_SYSCTL_scheduler_op                  19
 #define XEN_SYSCTL_coverage_op                   20
 #define XEN_SYSCTL_psr_cmt_op                    21
+#define XEN_SYSCTL_pcitopoinfo                   22
+#define XEN_SYSCTL_psr_cat_op                    23
+#define XEN_SYSCTL_tmem_op                       24
     uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
     union {
         struct xen_sysctl_readconsole       readconsole;
         struct xen_sysctl_tbuf_op           tbuf_op;
         struct xen_sysctl_physinfo          physinfo;
-        struct xen_sysctl_topologyinfo      topologyinfo;
+        struct xen_sysctl_cputopoinfo       cputopoinfo;
+        struct xen_sysctl_pcitopoinfo       pcitopoinfo;
         struct xen_sysctl_numainfo          numainfo;
         struct xen_sysctl_sched_id          sched_id;
         struct xen_sysctl_perfc_op          perfc_op;
@@ -699,6 +812,8 @@ struct xen_sysctl {
         struct xen_sysctl_scheduler_op      scheduler_op;
         struct xen_sysctl_coverage_op       coverage_op;
         struct xen_sysctl_psr_cmt_op        psr_cmt_op;
+        struct xen_sysctl_psr_cat_op        psr_cat_op;
+        struct xen_sysctl_tmem_op           tmem_op;
         uint8_t                             pad[128];
     } u;
 };
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/tmem.h
--- a/include/xen/interface/tmem.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/tmem.h	Fri Oct 16 16:24:14 2015 +0200
@@ -33,7 +33,11 @@
 #define TMEM_SPEC_VERSION          1
 
 /* Commands to HYPERVISOR_tmem_op() */
-#define TMEM_CONTROL               0
+#ifdef __XEN__
+#define TMEM_CONTROL               0 /* Now called XEN_SYSCTL_tmem_op */
+#else
+#undef TMEM_CONTROL
+#endif
 #define TMEM_NEW_POOL              1
 #define TMEM_DESTROY_POOL          2
 #define TMEM_PUT_PAGE              4
@@ -48,35 +52,9 @@
 #endif
 
 /* Privileged commands to HYPERVISOR_tmem_op() */
-#define TMEM_AUTH                 101 
+#define TMEM_AUTH                 101
 #define TMEM_RESTORE_NEW          102
 
-/* Subops for HYPERVISOR_tmem_op(TMEM_CONTROL) */
-#define TMEMC_THAW                   0
-#define TMEMC_FREEZE                 1
-#define TMEMC_FLUSH                  2
-#define TMEMC_DESTROY                3
-#define TMEMC_LIST                   4
-#define TMEMC_SET_WEIGHT             5
-#define TMEMC_SET_CAP                6
-#define TMEMC_SET_COMPRESS           7
-#define TMEMC_QUERY_FREEABLE_MB      8
-#define TMEMC_SAVE_BEGIN             10
-#define TMEMC_SAVE_GET_VERSION       11
-#define TMEMC_SAVE_GET_MAXPOOLS      12
-#define TMEMC_SAVE_GET_CLIENT_WEIGHT 13
-#define TMEMC_SAVE_GET_CLIENT_CAP    14
-#define TMEMC_SAVE_GET_CLIENT_FLAGS  15
-#define TMEMC_SAVE_GET_POOL_FLAGS    16
-#define TMEMC_SAVE_GET_POOL_NPAGES   17
-#define TMEMC_SAVE_GET_POOL_UUID     18
-#define TMEMC_SAVE_GET_NEXT_PAGE     19
-#define TMEMC_SAVE_GET_NEXT_INV      20
-#define TMEMC_SAVE_END               21
-#define TMEMC_RESTORE_BEGIN          30
-#define TMEMC_RESTORE_PUT_PAGE       32
-#define TMEMC_RESTORE_FLUSH_PAGE     33
-
 /* Bits for HYPERVISOR_tmem_op(TMEM_NEW_POOL) */
 #define TMEM_POOL_PERSIST          1
 #define TMEM_POOL_SHARED           2
@@ -95,6 +73,11 @@
 #define EFROZEN                 1000
 #define EEMPTY                  1001
 
+struct xen_tmem_oid {
+    uint64_t oid[3];
+};
+typedef struct xen_tmem_oid xen_tmem_oid_t;
+DEFINE_XEN_GUEST_HANDLE(xen_tmem_oid_t);
 
 #ifndef __ASSEMBLY__
 #if __XEN_INTERFACE_VERSION__ < 0x00040400
@@ -110,17 +93,12 @@ struct tmem_op {
             uint32_t flags;
             uint32_t arg1;
         } creat; /* for cmd == TMEM_NEW_POOL, TMEM_AUTH, TMEM_RESTORE_NEW */
-        struct { 
-            uint32_t subop;
-            uint32_t cli_id;
-            uint32_t arg1;
-            uint32_t arg2;
+        struct {
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
             uint64_t oid[3];
-            tmem_cli_va_t buf;
-        } ctrl; /* for cmd == TMEM_CONTROL */
-        struct {
-            
-            uint64_t oid[3];
+#else
+            xen_tmem_oid_t oid;
+#endif
             uint32_t index;
             uint32_t tmem_offset;
             uint32_t pfn_offset;
@@ -131,12 +109,6 @@ struct tmem_op {
 };
 typedef struct tmem_op tmem_op_t;
 DEFINE_XEN_GUEST_HANDLE(tmem_op_t);
-
-struct tmem_handle {
-    uint32_t pool_id;
-    uint32_t index;
-    uint64_t oid[3];
-};
 #endif
 
 #endif /* __XEN_PUBLIC_TMEM_H__ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/trace.h
--- a/include/xen/interface/trace.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/trace.h	Fri Oct 16 16:24:14 2015 +0200
@@ -75,7 +75,7 @@
 /* Per-scheduler IDs, to identify scheduler specific events */
 #define TRC_SCHED_CSCHED   0
 #define TRC_SCHED_CSCHED2  1
-#define TRC_SCHED_SEDF     2
+/* #define XEN_SCHEDULER_SEDF 2 (Removed) */
 #define TRC_SCHED_ARINC653 3
 #define TRC_SCHED_RTDS     4
 
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/vcpu.h
--- a/include/xen/interface/vcpu.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/vcpu.h	Fri Oct 16 16:24:14 2015 +0200
@@ -31,7 +31,7 @@
 
 /*
  * Prototype for this hypercall is:
- *  int vcpu_op(int cmd, int vcpuid, void *extra_args)
+ *  long vcpu_op(int cmd, unsigned int vcpuid, void *extra_args)
  * @cmd        == VCPUOP_??? (VCPU operation).
  * @vcpuid     == VCPU to operate on.
  * @extra_args == Operation-specific extra arguments (NULL if none).
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/vm_event.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/vm_event.h	Fri Oct 16 16:24:14 2015 +0200
@@ -0,0 +1,269 @@
+/******************************************************************************
+ * vm_event.h
+ *
+ * Memory event common structures.
+ *
+ * Copyright (c) 2009 by Citrix Systems, Inc. (Patrick Colp)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _XEN_PUBLIC_VM_EVENT_H
+#define _XEN_PUBLIC_VM_EVENT_H
+
+#include "xen.h"
+
+#define VM_EVENT_INTERFACE_VERSION 0x00000001
+
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+
+#include "io/ring.h"
+
+/*
+ * Memory event flags
+ */
+
+/*
+ * VCPU_PAUSED in a request signals that the vCPU triggering the event has been
+ *  paused
+ * VCPU_PAUSED in a response signals to unpause the vCPU
+ */
+#define VM_EVENT_FLAG_VCPU_PAUSED        (1 << 0)
+/* Flags to aid debugging vm_event */
+#define VM_EVENT_FLAG_FOREIGN            (1 << 1)
+/*
+ * The following flags can be set in response to a mem_access event.
+ *
+ * Emulate the fault-causing instruction (if set in the event response flags).
+ * This will allow the guest to continue execution without lifting the page
+ * access restrictions.
+ */
+#define VM_EVENT_FLAG_EMULATE            (1 << 2)
+/*
+ * Same as VM_EVENT_FLAG_EMULATE, but with write operations or operations
+ * potentially having side effects (like memory mapped or port I/O) disabled.
+ */
+#define VM_EVENT_FLAG_EMULATE_NOWRITE    (1 << 3)
+/*
+ * Toggle singlestepping on vm_event response.
+ * Requires the vCPU to be paused already (synchronous events only).
+ */
+#define VM_EVENT_FLAG_TOGGLE_SINGLESTEP  (1 << 4)
+/*
+ * Data is being sent back to the hypervisor in the event response, to be
+ * returned by the read function when emulating an instruction.
+ * This flag is only useful when combined with VM_EVENT_FLAG_EMULATE
+ * and takes precedence if combined with VM_EVENT_FLAG_EMULATE_NOWRITE
+ * (i.e. if both VM_EVENT_FLAG_EMULATE_NOWRITE and
+ * VM_EVENT_FLAG_SET_EMUL_READ_DATA are set, only the latter will be honored).
+ */
+#define VM_EVENT_FLAG_SET_EMUL_READ_DATA (1 << 5)
+ /*
+  * Deny completion of the operation that triggered the event.
+  * 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
+ */
+
+/* Default case */
+#define VM_EVENT_REASON_UNKNOWN                 0
+/* Memory access violation */
+#define VM_EVENT_REASON_MEM_ACCESS              1
+/* Memory sharing event */
+#define VM_EVENT_REASON_MEM_SHARING             2
+/* Memory paging event */
+#define VM_EVENT_REASON_MEM_PAGING              3
+/* A control register was updated */
+#define VM_EVENT_REASON_WRITE_CTRLREG           4
+/* An MSR was updated. */
+#define VM_EVENT_REASON_MOV_TO_MSR              5
+/* Debug operation executed (e.g. int3) */
+#define VM_EVENT_REASON_SOFTWARE_BREAKPOINT     6
+/* Single-step (e.g. MTF) */
+#define VM_EVENT_REASON_SINGLESTEP              7
+/* An event has been requested via HVMOP_guest_request_vm_event. */
+#define VM_EVENT_REASON_GUEST_REQUEST           8
+
+/* Supported values for the vm_event_write_ctrlreg index. */
+#define VM_EVENT_X86_CR0    0
+#define VM_EVENT_X86_CR3    1
+#define VM_EVENT_X86_CR4    2
+#define VM_EVENT_X86_XCR0   3
+
+/*
+ * Using a custom struct (not hvm_hw_cpu) so as to not fill
+ * the vm_event ring buffer too quickly.
+ */
+struct vm_event_regs_x86 {
+    uint64_t rax;
+    uint64_t rcx;
+    uint64_t rdx;
+    uint64_t rbx;
+    uint64_t rsp;
+    uint64_t rbp;
+    uint64_t rsi;
+    uint64_t rdi;
+    uint64_t r8;
+    uint64_t r9;
+    uint64_t r10;
+    uint64_t r11;
+    uint64_t r12;
+    uint64_t r13;
+    uint64_t r14;
+    uint64_t r15;
+    uint64_t rflags;
+    uint64_t dr7;
+    uint64_t rip;
+    uint64_t cr0;
+    uint64_t cr2;
+    uint64_t cr3;
+    uint64_t cr4;
+    uint64_t sysenter_cs;
+    uint64_t sysenter_esp;
+    uint64_t sysenter_eip;
+    uint64_t msr_efer;
+    uint64_t msr_star;
+    uint64_t msr_lstar;
+    uint64_t fs_base;
+    uint64_t gs_base;
+    uint32_t cs_arbytes;
+    uint32_t _pad;
+};
+
+/*
+ * mem_access flag definitions
+ *
+ * These flags are set only as part of a mem_event request.
+ *
+ * R/W/X: Defines the type of violation that has triggered the event
+ *        Multiple types can be set in a single violation!
+ * GLA_VALID: If the gla field holds a guest VA associated with the event
+ * FAULT_WITH_GLA: If the violation was triggered by accessing gla
+ * FAULT_IN_GPT: If the violation was triggered during translating gla
+ */
+#define MEM_ACCESS_R                    (1 << 0)
+#define MEM_ACCESS_W                    (1 << 1)
+#define MEM_ACCESS_X                    (1 << 2)
+#define MEM_ACCESS_RWX                  (MEM_ACCESS_R | MEM_ACCESS_W | MEM_ACCESS_X)
+#define MEM_ACCESS_RW                   (MEM_ACCESS_R | MEM_ACCESS_W)
+#define MEM_ACCESS_RX                   (MEM_ACCESS_R | MEM_ACCESS_X)
+#define MEM_ACCESS_WX                   (MEM_ACCESS_W | MEM_ACCESS_X)
+#define MEM_ACCESS_GLA_VALID            (1 << 3)
+#define MEM_ACCESS_FAULT_WITH_GLA       (1 << 4)
+#define MEM_ACCESS_FAULT_IN_GPT         (1 << 5)
+
+struct vm_event_mem_access {
+    uint64_t gfn;
+    uint64_t offset;
+    uint64_t gla;   /* if flags has MEM_ACCESS_GLA_VALID set */
+    uint32_t flags; /* MEM_ACCESS_* */
+    uint32_t _pad;
+};
+
+struct vm_event_write_ctrlreg {
+    uint32_t index;
+    uint32_t _pad;
+    uint64_t new_value;
+    uint64_t old_value;
+};
+
+struct vm_event_debug {
+    uint64_t gfn;
+};
+
+struct vm_event_mov_to_msr {
+    uint64_t msr;
+    uint64_t value;
+};
+
+#define MEM_PAGING_DROP_PAGE       (1 << 0)
+#define MEM_PAGING_EVICT_FAIL      (1 << 1)
+
+struct vm_event_paging {
+    uint64_t gfn;
+    uint32_t p2mt;
+    uint32_t flags;
+};
+
+struct vm_event_sharing {
+    uint64_t gfn;
+    uint32_t p2mt;
+    uint32_t _pad;
+};
+
+struct vm_event_emul_read_data {
+    uint32_t size;
+    /* The struct is used in a union with vm_event_regs_x86. */
+    uint8_t  data[sizeof(struct vm_event_regs_x86) - sizeof(uint32_t)];
+};
+
+typedef struct vm_event_st {
+    uint32_t version;   /* VM_EVENT_INTERFACE_VERSION */
+    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;
+        struct vm_event_sharing               mem_sharing;
+        struct vm_event_mem_access            mem_access;
+        struct vm_event_write_ctrlreg         write_ctrlreg;
+        struct vm_event_mov_to_msr            mov_to_msr;
+        struct vm_event_debug                 software_breakpoint;
+        struct vm_event_debug                 singlestep;
+    } u;
+
+    union {
+        union {
+            struct vm_event_regs_x86 x86;
+        } regs;
+
+        struct vm_event_emul_read_data emul_read_data;
+    } data;
+} vm_event_request_t, vm_event_response_t;
+
+DEFINE_RING_TYPES(vm_event, vm_event_request_t, vm_event_response_t);
+
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+#endif /* _XEN_PUBLIC_VM_EVENT_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/xen-compat.h
--- a/include/xen/interface/xen-compat.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/xen-compat.h	Fri Oct 16 16:24:14 2015 +0200
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040500
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040600
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/xen.h
--- a/include/xen/interface/xen.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/xen.h	Fri Oct 16 16:24:14 2015 +0200
@@ -103,6 +103,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define __HYPERVISOR_kexec_op             37
 #define __HYPERVISOR_tmem_op              38
 #define __HYPERVISOR_xc_reserved_op       39 /* reserved for XenClient */
+#define __HYPERVISOR_xenpmu_op            40
 
 /* Architecture-specific hypercall definitions. */
 #define __HYPERVISOR_arch_0               48
@@ -162,6 +163,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define VIRQ_MEM_EVENT  10 /* G. (DOM0) A memory event has occured           */
 #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient                     */
 #define VIRQ_ENOMEM     12 /* G. (DOM0) Low on heap memory       */
+#define VIRQ_XENPMU     13 /* V.  PMC interrupt                              */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16
@@ -488,7 +490,21 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 /* x86/PAE guests: support PDPTs above 4GB. */
 #define VMASST_TYPE_pae_extended_cr3     3
 
+/*
+ * x86/64 guests: strictly hide M2P from user mode.
+ * This allows the guest to control respective hypervisor behavior:
+ * - when not set, L4 tables get created with the respective slot blank,
+ *   and whenever the L4 table gets used as a kernel one the missing
+ *   mapping gets inserted,
+ * - when set, L4 tables get created with the respective slot initialized
+ *   as before, and whenever the L4 table gets used as a user one the
+ *   mapping gets zapped.
+ */
+#define VMASST_TYPE_m2p_strict           32
+
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
 #define MAX_VMASST_TYPE                  3
+#endif
 
 #ifndef __ASSEMBLY__
 
@@ -684,6 +700,12 @@ struct shared_info {
     uint32_t wc_version;      /* Version counter: see vcpu_time_info_t. */
     uint32_t wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
     uint32_t wc_nsec;         /* Nsecs 00:00:00 UTC, Jan 1, 1970.  */
+#if !defined(__i386__)
+    uint32_t wc_sec_hi;
+# define xen_wc_sec_hi wc_sec_hi
+#elif !defined(__XEN__) && !defined(__XEN_TOOLS__)
+# define xen_wc_sec_hi arch.wc_sec_hi
+#endif
 
     struct arch_shared_info arch;
 
@@ -700,24 +722,27 @@ typedef struct shared_info shared_info_t
  *  3. This the order of bootstrap elements in the initial virtual region:
  *      a. relocated kernel image
  *      b. initial ram disk              [mod_start, mod_len]
+ *         (may be omitted)
  *      c. list of allocated page frames [mfn_list, nr_pages]
  *         (unless relocated due to XEN_ELFNOTE_INIT_P2M)
  *      d. start_info_t structure        [register ESI (x86)]
- *      e. bootstrap page tables         [pt_base and CR3 (x86)]
- *      f. bootstrap stack               [register ESP (x86)]
+ *         in case of dom0 this page contains the console info, too
+ *      e. unless dom0: xenstore ring page
+ *      f. unless dom0: console ring page
+ *      g. bootstrap page tables         [pt_base and CR3 (x86)]
+ *      h. bootstrap stack               [register ESP (x86)]
  *  4. Bootstrap elements are packed together, but each is 4kB-aligned.
- *  5. The initial ram disk may be omitted.
- *  6. The list of page frames forms a contiguous 'pseudo-physical' memory
+ *  5. The list of page frames forms a contiguous 'pseudo-physical' memory
  *     layout for the domain. In particular, the bootstrap virtual-memory
  *     region is a 1:1 mapping to the first section of the pseudo-physical map.
- *  7. All bootstrap elements are mapped read-writable for the guest OS. The
+ *  6. All bootstrap elements are mapped read-writable for the guest OS. The
  *     only exception is the bootstrap page table, which is mapped read-only.
- *  8. There is guaranteed to be at least 512kB padding after the final
+ *  7. There is guaranteed to be at least 512kB padding after the final
  *     bootstrap element. If necessary, the bootstrap virtual region is
  *     extended by an extra 4MB to ensure this.
  *
  * Note: Prior to 25833:bb85bbccb1c9. ("x86/32-on-64 adjust Dom0 initial page
- * table layout") a bug caused the pt_base (3.e above) and cr3 to not point
+ * table layout") a bug caused the pt_base (3.g above) and cr3 to not point
  * to the start of the guest page tables (it was offset by two pages).
  * This only manifested itself on 32-on-64 dom0 kernels and not 32-on-64 domU
  * or 64-bit kernels of any colour. The page tables for a 32-on-64 dom0 got
@@ -773,6 +798,8 @@ typedef struct start_info start_info_t;
 #define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
 #define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
 #define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
+#define SIF_VIRT_P2M_4TOOLS (1<<4) /* Do Xen tools understand a virt. mapped */
+                                   /* P->M making the 3 level tree obsolete? */
 #define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
 
 /*
@@ -872,6 +899,9 @@ __DEFINE_XEN_GUEST_HANDLE(uint64, uint64
 /* Default definitions for macros used by domctl/sysctl. */
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 
+#ifndef int64_aligned_t
+#define int64_aligned_t int64_t
+#endif
 #ifndef uint64_aligned_t
 #define uint64_aligned_t uint64_t
 #endif
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/xsm/flask_op.h
--- a/include/xen/interface/xsm/flask_op.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/xsm/flask_op.h	Fri Oct 16 16:24:14 2015 +0200
@@ -25,6 +25,8 @@
 #ifndef __FLASK_OP_H__
 #define __FLASK_OP_H__
 
+#include "../event_channel.h"
+
 #define XEN_FLASK_INTERFACE_VERSION 1
 
 struct xen_flask_load {
@@ -148,6 +150,13 @@ struct xen_flask_relabel {
     uint32_t sid;
 };
 
+struct xen_flask_devicetree_label {
+    /* IN */
+    uint32_t sid;
+    uint32_t length;
+    XEN_GUEST_HANDLE(char) path;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -174,6 +183,7 @@ struct xen_flask_op {
 #define FLASK_DEL_OCONTEXT      22
 #define FLASK_GET_PEER_SID      23
 #define FLASK_RELABEL_DOMAIN    24
+#define FLASK_DEVICETREE_LABEL  25
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -193,6 +203,7 @@ struct xen_flask_op {
         struct xen_flask_ocontext ocontext;
         struct xen_flask_peersid peersid;
         struct xen_flask_relabel relabel;
+        struct xen_flask_devicetree_label devicetree_label;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 14:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 14:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6Pa-0007Rb-Kc; Fri, 16 Oct 2015 14:55:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PZ-0007Qu-48
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:13 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	5E/09-00536-0DF01265; Fri, 16 Oct 2015 14:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445007305!53907990!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 16201 invoked from network); 16 Oct 2015 14:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2015 14:55:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PR-0005mf-2Y
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6PQ-0004WA-Vb
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 14:55:05 +0000
Message-Id: <E1Zn6PQ-0004WA-Vb@xenbits.xen.org>
Date: Fri, 16 Oct 2015 14:55:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] sync Xen public headers to 4.6.0
	level
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1445005454 -7200
# Node ID 288d236ca763e3e889774fcb8a10fda136723130
# Parent  3f51e783c26a52086fb349313fad1758e4e35297
sync Xen public headers to 4.6.0 level
---


diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-arm.h
--- a/include/xen/interface/arch-arm.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-arm.h	Fri Oct 16 16:24:14 2015 +0200
@@ -87,15 +87,10 @@
  * unavailable/unsupported.
  *
  *  HYPERVISOR_memory_op
- *   All generic sub-operations.
- *
- *   In addition the following arch specific sub-ops:
- *    * XENMEM_add_to_physmap
- *    * XENMEM_add_to_physmap_batch
+ *   All generic sub-operations
  *
  *  HYPERVISOR_domctl
  *   All generic sub-operations, with the exception of:
- *    * XEN_DOMCTL_iomem_permission (not yet implemented)
  *    * XEN_DOMCTL_irq_permission (not yet implemented)
  *
  *  HYPERVISOR_sched_op
@@ -170,6 +165,7 @@
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
+#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 
 #ifndef __ASSEMBLY__
@@ -183,8 +179,8 @@
  * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
  * in a struct in memory. On ARM is always 8 bytes sizes and 8 bytes
  * aligned.
- * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
- * hypercall argument. It is 4 bytes on aarch and 8 bytes on aarch64.
+ * XEN_GUEST_HANDLE_PARAM represents a guest pointer, when passed as an
+ * hypercall argument. It is 4 bytes on aarch32 and 8 bytes on aarch64.
  */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
@@ -192,7 +188,6 @@
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
 #define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
-/* this is going to be changed on 64 bit */
 #define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
 #define set_xen_guest_handle_raw(hnd, val)                  \
     do {                                                    \
@@ -303,7 +298,35 @@ struct vcpu_guest_context {
 };
 typedef struct vcpu_guest_context vcpu_guest_context_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
-#endif
+
+/*
+ * struct xen_arch_domainconfig's ABI is covered by
+ * XEN_DOMCTL_INTERFACE_VERSION.
+ */
+#define XEN_DOMCTL_CONFIG_GIC_NATIVE    0
+#define XEN_DOMCTL_CONFIG_GIC_V2        1
+#define XEN_DOMCTL_CONFIG_GIC_V3        2
+struct xen_arch_domainconfig {
+    /* IN/OUT */
+    uint8_t gic_version;
+    /* IN */
+    uint32_t nr_spis;
+    /*
+     * OUT
+     * Based on the property clock-frequency in the DT timer node.
+     * The property may be present when the bootloader/firmware doesn't
+     * set correctly CNTFRQ which hold the timer frequency.
+     *
+     * As it's not possible to trap this register, we have to replicate
+     * the value in the guest DT.
+     *
+     * = 0 => property not present
+     * > 0 => Value of the property
+     *
+     */
+    uint32_t clock_frequency;
+};
+#endif /* __XEN__ || __XEN_TOOLS__ */
 
 struct arch_vcpu_info {
 };
@@ -318,7 +341,7 @@ typedef uint64_t xen_callback_t;
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 
-/* PSR bits (CPSR, SPSR)*/
+/* PSR bits (CPSR, SPSR) */
 
 #define PSR_THUMB       (1<<5)        /* Thumb Mode enable */
 #define PSR_FIQ_MASK    (1<<6)        /* Fast Interrupt mask */
@@ -365,7 +388,8 @@ typedef uint64_t xen_callback_t;
 
 /* Physical Address Space */
 
-/* vGIC mappings: Only one set of mapping is used by the guest.
+/*
+ * vGIC mappings: Only one set of mapping is used by the guest.
  * Therefore they can overlap.
  */
 
@@ -382,10 +406,11 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICV3_RDIST_STRIDE   0x20000ULL
 #define GUEST_GICV3_RDIST_REGIONS  1
 
-#define GUEST_GICV3_GICR0_BASE     0x03020000ULL    /* vCPU0 - vCPU7 */
-#define GUEST_GICV3_GICR0_SIZE     0x00100000ULL
+#define GUEST_GICV3_GICR0_BASE     0x03020000ULL    /* vCPU0 - vCPU127 */
+#define GUEST_GICV3_GICR0_SIZE     0x01000000ULL
 
-/* 16MB == 4096 pages reserved for guest to use as a region to map its
+/*
+ * 16MB == 4096 pages reserved for guest to use as a region to map its
  * grant table in.
  */
 #define GUEST_GNTTAB_BASE 0x38000000ULL
@@ -423,6 +448,11 @@ typedef uint64_t xen_callback_t;
 
 #endif
 
+#ifndef __ASSEMBLY__
+/* Stub definition of PMU structure */
+typedef struct xen_pmu_arch { uint8_t dummy; } xen_pmu_arch_t;
+#endif
+
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
 
 /*
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/cpuid.h
--- a/include/xen/interface/arch-x86/cpuid.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-x86/cpuid.h	Fri Oct 16 16:24:14 2015 +0200
@@ -76,13 +76,14 @@
 /*
  * Leaf 5 (0x40000x04)
  * HVM-specific features
+ * EAX: Features
+ * EBX: vcpu id (iff EAX has XEN_HVM_CPUID_VCPU_ID_PRESENT flag)
  */
-
-/* EAX Features */
 #define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers */
 #define XEN_HVM_CPUID_X2APIC_VIRT      (1u << 1) /* Virtualized x2APIC accesses */
 /* Memory mapped from other domains has valid IOMMU entries */
 #define XEN_HVM_CPUID_IOMMU_MAPPINGS   (1u << 2)
+#define XEN_HVM_CPUID_VCPU_ID_PRESENT  (1u << 3) /* vcpu id is present in EBX */
 
 #define XEN_CPUID_MAX_NUM_LEAVES 4
 
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/hvm/save.h
--- a/include/xen/interface/arch-x86/hvm/save.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-x86/hvm/save.h	Fri Oct 16 16:24:14 2015 +0200
@@ -569,6 +569,7 @@ struct hvm_viridian_domain_context {
     uint64_t hypercall_gpa;
     uint64_t guest_os_id;
     uint64_t time_ref_count;
+    uint64_t reference_tsc;
 };
 
 DECLARE_HVM_SAVE_TYPE(VIRIDIAN_DOMAIN, 15, struct hvm_viridian_domain_context);
@@ -617,3 +618,13 @@ struct hvm_msr {
 #define HVM_SAVE_CODE_MAX 20
 
 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/pmu.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/arch-x86/pmu.h	Fri Oct 16 16:24:14 2015 +0200
@@ -0,0 +1,167 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
+#ifndef __XEN_PUBLIC_ARCH_X86_PMU_H__
+#define __XEN_PUBLIC_ARCH_X86_PMU_H__
+
+/* x86-specific PMU definitions */
+
+/* AMD PMU registers and structures */
+struct xen_pmu_amd_ctxt {
+    /*
+     * Offsets to counter and control MSRs (relative to xen_pmu_arch.c.amd).
+     * For PV(H) guests these fields are RO.
+     */
+    uint32_t counters;
+    uint32_t ctrls;
+
+    /* Counter MSRs */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    uint64_t regs[];
+#elif defined(__GNUC__)
+    uint64_t regs[0];
+#endif
+};
+typedef struct xen_pmu_amd_ctxt xen_pmu_amd_ctxt_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_amd_ctxt_t);
+
+/* Intel PMU registers and structures */
+struct xen_pmu_cntr_pair {
+    uint64_t counter;
+    uint64_t control;
+};
+typedef struct xen_pmu_cntr_pair xen_pmu_cntr_pair_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_cntr_pair_t);
+
+struct xen_pmu_intel_ctxt {
+   /*
+    * Offsets to fixed and architectural counter MSRs (relative to
+    * xen_pmu_arch.c.intel).
+    * For PV(H) guests these fields are RO.
+    */
+    uint32_t fixed_counters;
+    uint32_t arch_counters;
+
+    /* PMU registers */
+    uint64_t global_ctrl;
+    uint64_t global_ovf_ctrl;
+    uint64_t global_status;
+    uint64_t fixed_ctrl;
+    uint64_t ds_area;
+    uint64_t pebs_enable;
+    uint64_t debugctl;
+
+    /* Fixed and architectural counter MSRs */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    uint64_t regs[];
+#elif defined(__GNUC__)
+    uint64_t regs[0];
+#endif
+};
+typedef struct xen_pmu_intel_ctxt xen_pmu_intel_ctxt_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_intel_ctxt_t);
+
+/* Sampled domain's registers */
+struct xen_pmu_regs {
+    uint64_t ip;
+    uint64_t sp;
+    uint64_t flags;
+    uint16_t cs;
+    uint16_t ss;
+    uint8_t cpl;
+    uint8_t pad[3];
+};
+typedef struct xen_pmu_regs xen_pmu_regs_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_regs_t);
+
+/* PMU flags */
+#define PMU_CACHED         (1<<0) /* PMU MSRs are cached in the context */
+#define PMU_SAMPLE_USER    (1<<1) /* Sample is from user or kernel mode */
+#define PMU_SAMPLE_REAL    (1<<2) /* Sample is from realmode */
+#define PMU_SAMPLE_PV      (1<<3) /* Sample from a PV guest */
+
+/*
+ * Architecture-specific information describing state of the processor at
+ * the time of PMU interrupt.
+ * Fields of this structure marked as RW for guest should only be written by
+ * the guest when PMU_CACHED bit in pmu_flags is set (which is done by the
+ * hypervisor during PMU interrupt). Hypervisor will read updated data in
+ * XENPMU_flush hypercall and clear PMU_CACHED bit.
+ */
+struct xen_pmu_arch {
+    union {
+        /*
+         * Processor's registers at the time of interrupt.
+         * WO for hypervisor, RO for guests.
+         */
+        struct xen_pmu_regs regs;
+        /* Padding for adding new registers to xen_pmu_regs in the future */
+#define XENPMU_REGS_PAD_SZ  64
+        uint8_t pad[XENPMU_REGS_PAD_SZ];
+    } r;
+
+    /* WO for hypervisor, RO for guest */
+    uint64_t pmu_flags;
+
+    /*
+     * APIC LVTPC register.
+     * RW for both hypervisor and guest.
+     * Only APIC_LVT_MASKED bit is loaded by the hypervisor into hardware
+     * during XENPMU_flush or XENPMU_lvtpc_set.
+     */
+    union {
+        uint32_t lapic_lvtpc;
+        uint64_t pad;
+    } l;
+
+    /*
+     * Vendor-specific PMU registers.
+     * RW for both hypervisor and guest (see exceptions above).
+     * Guest's updates to this field are verified and then loaded by the
+     * hypervisor into hardware during XENPMU_flush
+     */
+    union {
+        struct xen_pmu_amd_ctxt amd;
+        struct xen_pmu_intel_ctxt intel;
+
+        /*
+         * Padding for contexts (fixed parts only, does not include MSR banks
+         * that are specified by offsets)
+         */
+#define XENPMU_CTXT_PAD_SZ  128
+        uint8_t pad[XENPMU_CTXT_PAD_SZ];
+    } c;
+};
+typedef struct xen_pmu_arch xen_pmu_arch_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_arch_t);
+
+#endif /* __XEN_PUBLIC_ARCH_X86_PMU_H__ */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
+
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/xen-x86_32.h
--- a/include/xen/interface/arch-x86/xen-x86_32.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-x86/xen-x86_32.h	Fri Oct 16 16:24:14 2015 +0200
@@ -104,6 +104,7 @@
     do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0;   \
          (hnd).p = val;                                     \
     } while ( 0 )
+#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
 #define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 #define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name)
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/arch-x86/xen.h
--- a/include/xen/interface/arch-x86/xen.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/arch-x86/xen.h	Fri Oct 16 16:24:14 2015 +0200
@@ -220,14 +220,58 @@ typedef struct vcpu_guest_context vcpu_g
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 
 struct arch_shared_info {
-    unsigned long max_pfn;                  /* max pfn that appears in table */
-    /* Frame containing list of mfns containing list of mfns containing p2m. */
+    /*
+     * Number of valid entries in the p2m table(s) anchored at
+     * pfn_to_mfn_frame_list_list and/or p2m_vaddr.
+     */
+    unsigned long max_pfn;
+    /*
+     * Frame containing list of mfns containing list of mfns containing p2m.
+     * A value of 0 indicates it has not yet been set up, ~0 indicates it has
+     * been set to invalid e.g. due to the p2m being too large for the 3-level
+     * p2m tree. In this case the linear mapper p2m list anchored at p2m_vaddr
+     * is to be used.
+     */
     xen_pfn_t     pfn_to_mfn_frame_list_list;
     unsigned long nmi_reason;
-    uint64_t pad[32];
+    /*
+     * Following three fields are valid if p2m_cr3 contains a value different
+     * from 0.
+     * p2m_cr3 is the root of the address space where p2m_vaddr is valid.
+     * p2m_cr3 is in the same format as a cr3 value in the vcpu register state
+     * and holds the folded machine frame number (via xen_pfn_to_cr3) of a
+     * L3 or L4 page table.
+     * p2m_vaddr holds the virtual address of the linear p2m list. All entries
+     * in the range [0...max_pfn[ are accessible via this pointer.
+     * p2m_generation will be incremented by the guest before and after each
+     * change of the mappings of the p2m list. p2m_generation starts at 0 and
+     * a value with the least significant bit set indicates that a mapping
+     * update is in progress. This allows guest external software (e.g. in Dom0)
+     * to verify that read mappings are consistent and whether they have changed
+     * since the last check.
+     * Modifying a p2m element in the linear p2m list is allowed via an atomic
+     * write only.
+     */
+    unsigned long p2m_cr3;         /* cr3 value of the p2m address space */
+    unsigned long p2m_vaddr;       /* virtual address of the p2m list */
+    unsigned long p2m_generation;  /* generation count of p2m mapping */
+#ifdef __i386__
+    /* There's no room for this field in the generic structure. */
+    uint32_t wc_sec_hi;
+#endif
 };
 typedef struct arch_shared_info arch_shared_info_t;
 
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+/*
+ * struct xen_arch_domainconfig's ABI is covered by
+ * XEN_DOMCTL_INTERFACE_VERSION.
+ */
+struct xen_arch_domainconfig {
+    char dummy;
+};
+#endif
+
 #endif /* !__ASSEMBLY__ */
 
 /*
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/domctl.h	Fri Oct 16 16:24:14 2015 +0200
@@ -37,7 +37,7 @@
 #include "hvm/save.h"
 #include "memory.h"
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000a
+#define XEN_DOMCTL_INTERFACE_VERSION 0x0000000b
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -64,23 +64,11 @@ struct xen_domctl_createdomain {
 #define _XEN_DOMCTL_CDF_pvh_guest     4
 #define XEN_DOMCTL_CDF_pvh_guest      (1U<<_XEN_DOMCTL_CDF_pvh_guest)
     uint32_t flags;
+    struct xen_arch_domainconfig config;
 };
 typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t);
 
-#if defined(__arm__) || defined(__aarch64__)
-#define XEN_DOMCTL_CONFIG_GIC_DEFAULT   0
-#define XEN_DOMCTL_CONFIG_GIC_V2        1
-#define XEN_DOMCTL_CONFIG_GIC_V3        2
-/* XEN_DOMCTL_configure_domain */
-struct xen_domctl_arm_configuredomain {
-    /* IN/OUT parameters */
-    uint8_t gic_version;
-};
-typedef struct xen_domctl_arm_configuredomain xen_domctl_arm_configuredomain_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_arm_configuredomain_t);
-#endif
-
 /* XEN_DOMCTL_getdomaininfo */
 struct xen_domctl_getdomaininfo {
     /* OUT variables. */
@@ -161,27 +149,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getme
 #define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
-struct xen_domctl_getpageframeinfo {
-    /* IN variables. */
-    uint64_aligned_t gmfn; /* GMFN to query */
-    /* OUT variables. */
-    /* Is the page PINNED to a type? */
-    uint32_t type;         /* see above type defs */
-};
-typedef struct xen_domctl_getpageframeinfo xen_domctl_getpageframeinfo_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo_t);
-
-
-/* XEN_DOMCTL_getpageframeinfo2 */
-struct xen_domctl_getpageframeinfo2 {
-    /* IN variables. */
-    uint64_aligned_t num;
-    /* IN/OUT variables. */
-    XEN_GUEST_HANDLE_64(uint32) array;
-};
-typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
-
 /* XEN_DOMCTL_getpageframeinfo3 */
 struct xen_domctl_getpageframeinfo3 {
     /* IN variables. */
@@ -357,7 +324,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_v
 
 /* XEN_DOMCTL_scheduler_op */
 /* Scheduler types. */
-#define XEN_SCHEDULER_SEDF     4
+/* #define XEN_SCHEDULER_SEDF  4 (Removed) */
 #define XEN_SCHEDULER_CREDIT   5
 #define XEN_SCHEDULER_CREDIT2  6
 #define XEN_SCHEDULER_ARINC653 7
@@ -370,13 +337,6 @@ struct xen_domctl_scheduler_op {
     uint32_t sched_id;  /* XEN_SCHEDULER_* */
     uint32_t cmd;       /* XEN_DOMCTL_SCHEDOP_* */
     union {
-        struct xen_domctl_sched_sedf {
-            uint64_aligned_t period;
-            uint64_aligned_t slice;
-            uint64_aligned_t latency;
-            uint32_t extratime;
-            uint32_t weight;
-        } sedf;
         struct xen_domctl_sched_credit {
             uint16_t weight;
             uint16_t cap;
@@ -469,7 +429,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_
 
 /* XEN_DOMCTL_settimeoffset */
 struct xen_domctl_settimeoffset {
-    int32_t  time_offset_seconds; /* applied to domain wallclock time */
+    int64_aligned_t time_offset_seconds; /* applied to domain wallclock time */
 };
 typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
@@ -515,12 +475,33 @@ typedef struct xen_domctl_sendtrigger xe
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
 
 
-/* Assign PCI device to HVM guest. Sets up IOMMU structures. */
+/* Assign a device to a guest. Sets up IOMMU structures. */
 /* XEN_DOMCTL_assign_device */
 /* XEN_DOMCTL_test_assign_device */
-/* XEN_DOMCTL_deassign_device */
+/*
+ * XEN_DOMCTL_deassign_device: The behavior of this DOMCTL differs
+ * between the different type of device:
+ *  - PCI device (XEN_DOMCTL_DEV_PCI) will be reassigned to DOM0
+ *  - DT device (XEN_DOMCTL_DT_PCI) will left unassigned. DOM0
+ *  will have to call XEN_DOMCTL_assign_device in order to use the
+ *  device.
+ */
+#define XEN_DOMCTL_DEV_PCI      0
+#define XEN_DOMCTL_DEV_DT       1
 struct xen_domctl_assign_device {
-    uint32_t  machine_sbdf;   /* machine PCI ID of assigned device */
+    uint32_t dev;   /* XEN_DOMCTL_DEV_* */
+    union {
+        struct {
+            uint32_t machine_sbdf;   /* machine PCI ID of assigned device */
+        } pci;
+        struct {
+            uint32_t size; /* Length of the path */
+            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);
@@ -544,6 +525,7 @@ typedef enum pt_irq_type_e {
     PT_IRQ_TYPE_ISA,
     PT_IRQ_TYPE_MSI,
     PT_IRQ_TYPE_MSI_TRANSLATE,
+    PT_IRQ_TYPE_SPI,    /* ARM: valid range 32-1019 */
 } pt_irq_type_t;
 struct xen_domctl_bind_pt_irq {
     uint32_t machine_irq;
@@ -564,6 +546,9 @@ struct xen_domctl_bind_pt_irq {
             uint32_t gflags;
             uint64_aligned_t gtable;
         } msi;
+        struct {
+            uint16_t spi;
+        } spi;
     } u;
 };
 typedef struct xen_domctl_bind_pt_irq xen_domctl_bind_pt_irq_t;
@@ -571,6 +556,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_bind_
 
 
 /* Bind machine I/O address range -> HVM address range. */
+/* If this returns -E2BIG lower nr_mfns value. */
 /* XEN_DOMCTL_memory_mapping */
 #define DPCI_ADD_MAPPING         1
 #define DPCI_REMOVE_MAPPING      0
@@ -752,18 +738,13 @@ typedef struct xen_domctl_disable_migrat
 
 /* XEN_DOMCTL_gettscinfo */
 /* XEN_DOMCTL_settscinfo */
-struct xen_guest_tsc_info {
+typedef struct xen_domctl_tsc_info {
+    /* IN/OUT */
     uint32_t tsc_mode;
     uint32_t gtsc_khz;
     uint32_t incarnation;
     uint32_t pad;
     uint64_aligned_t elapsed_nsec;
-};
-typedef struct xen_guest_tsc_info xen_guest_tsc_info_t;
-DEFINE_XEN_GUEST_HANDLE(xen_guest_tsc_info_t);
-typedef struct xen_domctl_tsc_info {
-    XEN_GUEST_HANDLE_64(xen_guest_tsc_info_t) out_info; /* OUT */
-    xen_guest_tsc_info_t info; /* IN */
 } xen_domctl_tsc_info_t;
 
 /* XEN_DOMCTL_gdbsx_guestmemio      guest mem io */
@@ -793,10 +774,21 @@ struct xen_domctl_gdbsx_domstatus {
 };
 
 /*
- * Memory event operations
+ * VM event operations
  */
 
-/* XEN_DOMCTL_mem_event_op */
+/* XEN_DOMCTL_vm_event_op */
+
+/*
+ * There are currently three rings available for VM events:
+ * sharing, monitor and paging. This hypercall allows one to
+ * control these rings (enable/disable), as well as to signal
+ * to the hypervisor to pull responses (resume) from the given
+ * ring.
+ */
+#define XEN_VM_EVENT_ENABLE               0
+#define XEN_VM_EVENT_DISABLE              1
+#define XEN_VM_EVENT_RESUME               2
 
 /*
  * Domain memory paging
@@ -805,42 +797,38 @@ struct xen_domctl_gdbsx_domstatus {
  * pager<->hypervisor interface. Use XENMEM_paging_op*
  * to perform per-page operations.
  *
- * The XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE domctl returns several
+ * The XEN_VM_EVENT_PAGING_ENABLE domctl returns several
  * non-standard error codes to indicate why paging could not be enabled:
  * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
  * EMLINK - guest has iommu passthrough enabled
  * EXDEV  - guest has PoD enabled
  * EBUSY  - guest has or had paging enabled, ring buffer still active
  */
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING            1
-
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE     0
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE    1
+#define XEN_DOMCTL_VM_EVENT_OP_PAGING            1
 
 /*
- * Access permissions.
+ * Monitor helper.
  *
  * As with paging, use the domctl for teardown/setup of the
  * helper<->hypervisor interface.
  *
- * There are HVM hypercalls to set the per-page access permissions of every
- * page in a domain.  When one of these permissions--independent, read, 
- * write, and execute--is violated, the VCPU is paused and a memory event 
- * is sent with what happened.  (See public/mem_event.h) .
+ * The monitor interface can be used to register for various VM events. For
+ * example, there are HVM hypercalls to set the per-page access permissions
+ * of every page in a domain.  When one of these permissions--independent,
+ * read, write, and execute--is violated, the VCPU is paused and a memory event
+ * is sent with what happened. The memory event handler can then resume the
+ * VCPU and redo the access with a XEN_VM_EVENT_RESUME option.
  *
- * The memory event handler can then resume the VCPU and redo the access 
- * with a XENMEM_access_op_resume hypercall.
+ * See public/vm_event.h for the list of available events that can be
+ * subscribed to via the monitor interface.
  *
- * The XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE domctl returns several
+ * The XEN_VM_EVENT_MONITOR_* domctls returns
  * non-standard error codes to indicate why access could not be enabled:
  * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
  * EBUSY  - guest has or had access enabled, ring buffer still active
+ *
  */
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS                        2
-
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE                 0
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE                1
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE_INTROSPECTION   2
+#define XEN_DOMCTL_VM_EVENT_OP_MONITOR           2
 
 /*
  * Sharing ENOMEM helper.
@@ -855,21 +843,18 @@ struct xen_domctl_gdbsx_domstatus {
  * Note that shring can be turned on (as per the domctl below)
  * *without* this ring being setup.
  */
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING           3
-
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE    0
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE   1
+#define XEN_DOMCTL_VM_EVENT_OP_SHARING           3
 
 /* Use for teardown/setup of helper<->hypervisor interface for paging, 
  * access and sharing.*/
-struct xen_domctl_mem_event_op {
-    uint32_t       op;           /* XEN_DOMCTL_MEM_EVENT_OP_*_* */
-    uint32_t       mode;         /* XEN_DOMCTL_MEM_EVENT_OP_* */
+struct xen_domctl_vm_event_op {
+    uint32_t       op;           /* XEN_VM_EVENT_* */
+    uint32_t       mode;         /* XEN_DOMCTL_VM_EVENT_OP_* */
 
     uint32_t port;              /* OUT: event channel for ring */
 };
-typedef struct xen_domctl_mem_event_op xen_domctl_mem_event_op_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
+typedef struct xen_domctl_vm_event_op xen_domctl_vm_event_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_vm_event_op_t);
 
 /*
  * Memory sharing operations
@@ -1001,27 +986,37 @@ typedef struct xen_domctl_vcpu_msrs xen_
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpu_msrs_t);
 #endif
 
-/*
- * Use in XEN_DOMCTL_setvnumainfo to set
- * vNUMA domain topology.
- */
+/* XEN_DOMCTL_setvnumainfo: specifies a virtual NUMA topology for the guest */
 struct xen_domctl_vnuma {
+    /* IN: number of vNUMA nodes to setup. Shall be greater than 0 */
     uint32_t nr_vnodes;
+    /* IN: number of memory ranges to setup */
     uint32_t nr_vmemranges;
+    /*
+     * IN: number of vCPUs of the domain (used as size of the vcpu_to_vnode
+     * array declared below). Shall be equal to the domain's max_vcpus.
+     */
     uint32_t nr_vcpus;
-    uint32_t pad;
-    XEN_GUEST_HANDLE_64(uint) vdistance;
-    XEN_GUEST_HANDLE_64(uint) vcpu_to_vnode;
+    uint32_t pad;                                  /* must be zero */
 
     /*
-     * vnodes to physical NUMA nodes mask.
-     * This kept on per-domain basis for
-     * interested consumers, such as numa aware ballooning.
+     * IN: array for specifying the distances of the vNUMA nodes
+     * between each others. Shall have nr_vnodes*nr_vnodes elements.
+     */
+    XEN_GUEST_HANDLE_64(uint) vdistance;
+    /*
+     * IN: array for specifying to what vNUMA node each vCPU belongs.
+     * Shall have nr_vcpus elements.
+     */
+    XEN_GUEST_HANDLE_64(uint) vcpu_to_vnode;
+    /*
+     * IN: array for specifying on what physical NUMA node each vNUMA
+     * node is placed. Shall have nr_vnodes elements.
      */
     XEN_GUEST_HANDLE_64(uint) vnode_to_pnode;
-
     /*
-     * memory rages for each vNUMA node
+     * IN: array for specifying the memory ranges. Shall have
+     * nr_vmemranges elements.
      */
     XEN_GUEST_HANDLE_64(xen_vmemrange_t) vmemrange;
 };
@@ -1038,6 +1033,79 @@ struct xen_domctl_psr_cmt_op {
 typedef struct xen_domctl_psr_cmt_op xen_domctl_psr_cmt_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cmt_op_t);
 
+/*  XEN_DOMCTL_MONITOR_*
+ *
+ * Enable/disable monitoring various VM events.
+ * This domctl configures what events will be reported to helper apps
+ * via the ring buffer "MONITOR". The ring has to be first enabled
+ * with the domctl XEN_DOMCTL_VM_EVENT_OP_MONITOR.
+ *
+ * GET_CAPABILITIES can be used to determine which of these features is
+ * available on a given platform.
+ *
+ * NOTICE: mem_access events are also delivered via the "MONITOR" ring buffer;
+ * however, enabling/disabling those events is performed with the use of
+ * memory_op hypercalls!
+ */
+#define XEN_DOMCTL_MONITOR_OP_ENABLE            0
+#define XEN_DOMCTL_MONITOR_OP_DISABLE           1
+#define XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES  2
+
+#define XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG         0
+#define XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR            1
+#define XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP            2
+#define XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT   3
+#define XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST         4
+
+struct xen_domctl_monitor_op {
+    uint32_t op; /* XEN_DOMCTL_MONITOR_OP_* */
+
+    /*
+     * When used with ENABLE/DISABLE this has to be set to
+     * the requested XEN_DOMCTL_MONITOR_EVENT_* value.
+     * With GET_CAPABILITIES this field returns a bitmap of
+     * events supported by the platform, in the format
+     * (1 << XEN_DOMCTL_MONITOR_EVENT_*).
+     */
+    uint32_t event;
+
+    /*
+     * Further options when issuing XEN_DOMCTL_MONITOR_OP_ENABLE.
+     */
+    union {
+        struct {
+            /* Which control register */
+            uint8_t index;
+            /* Pause vCPU until response */
+            uint8_t sync;
+            /* Send event only on a change of value */
+            uint8_t onchangeonly;
+        } mov_to_cr;
+
+        struct {
+            /* Enable the capture of an extended set of MSRs */
+            uint8_t extended_capture;
+        } mov_to_msr;
+
+        struct {
+            /* Pause vCPU until response */
+            uint8_t sync;
+        } guest_request;
+    } u;
+};
+typedef struct xen_domctl_monitor_op xen_domctl_monitor_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_monitor_op_t);
+
+struct xen_domctl_psr_cat_op {
+#define XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM     0
+#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM     1
+    uint32_t cmd;       /* IN: XEN_DOMCTL_PSR_CAT_OP_* */
+    uint32_t target;    /* IN */
+    uint64_t data;      /* IN/OUT */
+};
+typedef struct xen_domctl_psr_cat_op xen_domctl_psr_cat_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cat_op_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -1046,8 +1114,8 @@ struct xen_domctl {
 #define XEN_DOMCTL_unpausedomain                  4
 #define XEN_DOMCTL_getdomaininfo                  5
 #define XEN_DOMCTL_getmemlist                     6
-#define XEN_DOMCTL_getpageframeinfo               7
-#define XEN_DOMCTL_getpageframeinfo2              8
+/* #define XEN_DOMCTL_getpageframeinfo            7 Obsolete - use getpageframeinfo3 */
+/* #define XEN_DOMCTL_getpageframeinfo2           8 Obsolete - use getpageframeinfo3 */
 #define XEN_DOMCTL_setvcpuaffinity                9
 #define XEN_DOMCTL_shadow_op                     10
 #define XEN_DOMCTL_max_mem                       11
@@ -1062,10 +1130,10 @@ struct xen_domctl {
 #define XEN_DOMCTL_iomem_permission              20
 #define XEN_DOMCTL_ioport_permission             21
 #define XEN_DOMCTL_hypercall_init                22
-#define XEN_DOMCTL_arch_setup                    23
+#define XEN_DOMCTL_arch_setup                    23 /* Obsolete IA64 only */
 #define XEN_DOMCTL_settimeoffset                 24
 #define XEN_DOMCTL_getvcpuaffinity               25
-#define XEN_DOMCTL_real_mode_area                26
+#define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
 #define XEN_DOMCTL_resumedomain                  27
 #define XEN_DOMCTL_sendtrigger                   28
 #define XEN_DOMCTL_subscribe                     29
@@ -1080,7 +1148,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_pin_mem_cacheattr             41
 #define XEN_DOMCTL_set_ext_vcpucontext           42
 #define XEN_DOMCTL_get_ext_vcpucontext           43
-#define XEN_DOMCTL_set_opt_feature               44
+#define XEN_DOMCTL_set_opt_feature               44 /* Obsolete IA64 only */
 #define XEN_DOMCTL_test_assign_device            45
 #define XEN_DOMCTL_set_target                    46
 #define XEN_DOMCTL_deassign_device               47
@@ -1092,7 +1160,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_suppress_spurious_page_faults 53
 #define XEN_DOMCTL_debug_op                      54
 #define XEN_DOMCTL_gethvmcontext_partial         55
-#define XEN_DOMCTL_mem_event_op                  56
+#define XEN_DOMCTL_vm_event_op                   56
 #define XEN_DOMCTL_mem_sharing_op                57
 #define XEN_DOMCTL_disable_migrate               58
 #define XEN_DOMCTL_gettscinfo                    59
@@ -1112,7 +1180,8 @@ struct xen_domctl {
 #define XEN_DOMCTL_set_vcpu_msrs                 73
 #define XEN_DOMCTL_setvnumainfo                  74
 #define XEN_DOMCTL_psr_cmt_op                    75
-#define XEN_DOMCTL_arm_configure_domain          76
+#define XEN_DOMCTL_monitor_op                    77
+#define XEN_DOMCTL_psr_cat_op                    78
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -1126,8 +1195,6 @@ struct xen_domctl {
 #endif
         struct xen_domctl_getdomaininfo     getdomaininfo;
         struct xen_domctl_getmemlist        getmemlist;
-        struct xen_domctl_getpageframeinfo  getpageframeinfo;
-        struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
         struct xen_domctl_getpageframeinfo3 getpageframeinfo3;
         struct xen_domctl_nodeaffinity      nodeaffinity;
         struct xen_domctl_vcpuaffinity      vcpuaffinity;
@@ -1163,7 +1230,7 @@ struct xen_domctl {
         struct xen_domctl_set_target        set_target;
         struct xen_domctl_subscribe         subscribe;
         struct xen_domctl_debug_op          debug_op;
-        struct xen_domctl_mem_event_op      mem_event_op;
+        struct xen_domctl_vm_event_op       vm_event_op;
         struct xen_domctl_mem_sharing_op    mem_sharing_op;
 #if defined(__i386__) || defined(__x86_64__)
         struct xen_domctl_cpuid             cpuid;
@@ -1181,6 +1248,8 @@ struct xen_domctl {
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         struct xen_domctl_vnuma             vnuma;
         struct xen_domctl_psr_cmt_op        psr_cmt_op;
+        struct xen_domctl_monitor_op        monitor_op;
+        struct xen_domctl_psr_cat_op        psr_cat_op;
         uint8_t                             pad[128];
     } u;
 };
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/errno.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/errno.h	Fri Oct 16 16:24:14 2015 +0200
@@ -0,0 +1,95 @@
+#ifndef __XEN_PUBLIC_ERRNO_H__
+
+#ifndef __ASSEMBLY__
+
+#define XEN_ERRNO(name, value) XEN_##name = value,
+enum xen_errno {
+
+#else /* !__ASSEMBLY__ */
+
+#define XEN_ERRNO(name, value) .equ XEN_##name, value
+
+#endif /* __ASSEMBLY__ */
+
+/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
+/* ` enum errnoval { */
+
+#endif /* __XEN_PUBLIC_ERRNO_H__ */
+
+#ifdef 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 */
+XEN_ERRNO(ENOENT,	 2)	/* No such file or directory */
+XEN_ERRNO(ESRCH,	 3)	/* No such process */
+#ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
+XEN_ERRNO(EINTR,	 4)	/* Interrupted system call */
+#endif
+XEN_ERRNO(EIO,		 5)	/* I/O error */
+XEN_ERRNO(ENXIO,	 6)	/* No such device or address */
+XEN_ERRNO(E2BIG,	 7)	/* Arg list too long */
+XEN_ERRNO(ENOEXEC,	 8)	/* Exec format error */
+XEN_ERRNO(EBADF,	 9)	/* Bad file number */
+XEN_ERRNO(ECHILD,	10)	/* No child processes */
+XEN_ERRNO(EAGAIN,	11)	/* Try again */
+XEN_ERRNO(ENOMEM,	12)	/* Out of memory */
+XEN_ERRNO(EACCES,	13)	/* Permission denied */
+XEN_ERRNO(EFAULT,	14)	/* Bad address */
+XEN_ERRNO(EBUSY,	16)	/* Device or resource busy */
+XEN_ERRNO(EEXIST,	17)	/* File exists */
+XEN_ERRNO(EXDEV,	18)	/* Cross-device link */
+XEN_ERRNO(ENODEV,	19)	/* No such device */
+XEN_ERRNO(EINVAL,	22)	/* Invalid argument */
+XEN_ERRNO(ENFILE,	23)	/* File table overflow */
+XEN_ERRNO(EMFILE,	24)	/* Too many open files */
+XEN_ERRNO(ENOSPC,	28)	/* No space left on device */
+XEN_ERRNO(EMLINK,	31)	/* Too many links */
+XEN_ERRNO(EDOM,		33)	/* Math argument out of domain of func */
+XEN_ERRNO(ERANGE,	34)	/* Math result not representable */
+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(ENODATA,	61)	/* No data available */
+XEN_ERRNO(ETIME,	62)	/* Timer expired */
+XEN_ERRNO(EBADMSG,	74)	/* Not a data message */
+XEN_ERRNO(EOVERFLOW,	75)	/* Value too large for defined data type */
+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(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 */
+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(ETIMEDOUT,	110)	/* Connection timed out */
+
+#undef XEN_ERRNO
+#endif /* XEN_ERRNO */
+
+#ifndef __XEN_PUBLIC_ERRNO_H__
+#define __XEN_PUBLIC_ERRNO_H__
+
+/* ` } */
+
+#ifndef __ASSEMBLY__
+};
+#endif
+
+#define	XEN_EWOULDBLOCK	XEN_EAGAIN	/* Operation would block */
+#define	XEN_EDEADLOCK	XEN_EDEADLK	/* Resource deadlock would occur */
+
+#endif /*  __XEN_PUBLIC_ERRNO_H__ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/features.h
--- a/include/xen/interface/features.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/features.h	Fri Oct 16 16:24:14 2015 +0200
@@ -99,6 +99,9 @@
 #define XENFEAT_grant_map_identity        12
  */
 
+/* Guest can use XENMEMF_vnode to specify virtual node for memory op. */
+#define XENFEAT_memory_op_vnode_supported 13
+
 #define XENFEAT_NR_SUBMAPS 1
 
 #endif /* __XEN_PUBLIC_FEATURES_H__ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/grant_table.h
--- a/include/xen/interface/grant_table.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/grant_table.h	Fri Oct 16 16:24:14 2015 +0200
@@ -134,8 +134,10 @@ struct grant_entry_v1 {
     /* The domain being granted foreign privileges. [GST] */
     domid_t  domid;
     /*
-     * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
-     * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
+     * GTF_permit_access: GFN that @domid is allowed to map and access. [GST]
+     * GTF_accept_transfer: GFN that @domid is allowed to transfer into. [GST]
+     * GTF_transfer_completed: MFN whose ownership transferred by @domid
+     *                         (non-translated guests only). [XEN]
      */
     uint32_t frame;
 };
@@ -321,7 +323,7 @@ typedef uint32_t grant_handle_t;
 /*
  * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
  * by devices and/or host CPUs. If successful, <handle> is a tracking number
- * that must be presented later to destroy the mapping(s). On error, <handle>
+ * that must be presented later to destroy the mapping(s). On error, <status>
  * is a negative status code.
  * NOTES:
  *  1. If GNTMAP_device_map is specified then <dev_bus_addr> is the address
@@ -453,7 +455,7 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_
 
 struct gnttab_copy {
     /* IN parameters. */
-    struct {
+    struct gnttab_copy_ptr {
         union {
             grant_ref_t ref;
             xen_pfn_t   gmfn;
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/e820.h
--- a/include/xen/interface/hvm/e820.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/e820.h	Fri Oct 16 16:24:14 2015 +0200
@@ -1,4 +1,3 @@
-
 /*
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -17,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_E820_H__
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/hvm_info_table.h
--- a/include/xen/interface/hvm/hvm_info_table.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/hvm_info_table.h	Fri Oct 16 16:24:14 2015 +0200
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/hvm_op.h
--- a/include/xen/interface/hvm/hvm_op.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/hvm_op.h	Fri Oct 16 16:24:14 2015 +0200
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
@@ -81,6 +83,7 @@ typedef enum {
     HVMMEM_ram_rw,             /* Normal read/write guest RAM */
     HVMMEM_ram_ro,             /* Read-only; writes are discarded */
     HVMMEM_mmio_dm,            /* Reads and write go to the device model */
+    HVMMEM_mmio_write_dm       /* Read-only; writes go to the device model */
 } hvmmem_type_t;
 
 /* Following tools-only interfaces may change in future. */
@@ -265,6 +268,13 @@ typedef uint16_t ioservid_t;
 #define HVMOP_create_ioreq_server 17
 struct xen_hvm_create_ioreq_server {
     domid_t domid;           /* IN - domain to be serviced */
+#define HVM_IOREQSRV_BUFIOREQ_OFF    0
+#define HVM_IOREQSRV_BUFIOREQ_LEGACY 1
+/*
+ * Use this when read_pointer gets updated atomically and
+ * the pointer pair gets read atomically:
+ */
+#define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
     uint8_t handle_bufioreq; /* IN - should server handle buffered ioreqs */
     ioservid_t id;           /* OUT - server id */
 };
@@ -369,6 +379,116 @@ DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_iore
 
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
+#if defined(__i386__) || defined(__x86_64__)
+
+/*
+ * HVMOP_set_evtchn_upcall_vector: Set a <vector> that should be used for event
+ *                                 channel upcalls on the specified <vcpu>. If set,
+ *                                 this vector will be used in preference to the
+ *                                 domain global callback via (see
+ *                                 HVM_PARAM_CALLBACK_IRQ).
+ */
+#define HVMOP_set_evtchn_upcall_vector 23
+struct xen_hvm_evtchn_upcall_vector {
+    uint32_t vcpu;
+    uint8_t vector;
+};
+typedef struct xen_hvm_evtchn_upcall_vector xen_hvm_evtchn_upcall_vector_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_evtchn_upcall_vector_t);
+
+#endif /* defined(__i386__) || defined(__x86_64__) */
+
+#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__ */
 
 /*
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/hvm_xs_strings.h
--- a/include/xen/interface/hvm/hvm_xs_strings.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/hvm_xs_strings.h	Fri Oct 16 16:24:14 2015 +0200
@@ -20,6 +20,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2013, Citrix Systems
  */
 
 #ifndef __XEN_PUBLIC_HVM_HVM_XS_STRINGS_H__
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/ioreq.h
--- a/include/xen/interface/hvm/ioreq.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/ioreq.h	Fri Oct 16 16:24:14 2015 +0200
@@ -83,8 +83,17 @@ typedef struct buf_ioreq buf_ioreq_t;
 
 #define IOREQ_BUFFER_SLOT_NUM     511 /* 8 bytes each, plus 2 4-byte indexes */
 struct buffered_iopage {
-    unsigned int read_pointer;
-    unsigned int write_pointer;
+#ifdef __XEN__
+    union bufioreq_pointers {
+        struct {
+#endif
+            uint32_t read_pointer;
+            uint32_t write_pointer;
+#ifdef __XEN__
+        };
+        uint64_t full;
+    } ptrs;
+#endif
     buf_ioreq_t buf_ioreq[IOREQ_BUFFER_SLOT_NUM];
 }; /* NB. Size of this structure must be no greater than one page. */
 typedef struct buffered_iopage buffered_iopage_t;
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/hvm/params.h
--- a/include/xen/interface/hvm/params.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/hvm/params.h	Fri Oct 16 16:24:14 2015 +0200
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2007, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_HVM_PARAMS_H__
@@ -97,10 +99,15 @@
 #define _HVMPV_time_ref_count 2
 #define HVMPV_time_ref_count  (1 << _HVMPV_time_ref_count)
 
+/* Enable Reference TSC Page (HV_X64_MSR_REFERENCE_TSC) */
+#define _HVMPV_reference_tsc 3
+#define HVMPV_reference_tsc  (1 << _HVMPV_reference_tsc)
+
 #define HVMPV_feature_mask \
 	(HVMPV_base_freq | \
 	 HVMPV_no_freq | \
-	 HVMPV_time_ref_count)
+	 HVMPV_time_ref_count | \
+	 HVMPV_reference_tsc)
 
 #endif
 
@@ -162,8 +169,7 @@
  */
 #define HVM_PARAM_ACPI_IOPORTS_LOCATION 19
 
-/* Enable blocking memory events, async or sync (pause vcpu until response) 
- * onchangeonly indicates messages only on a change of value */
+/* Deprecated */
 #define HVM_PARAM_MEMORY_EVENT_CR0          20
 #define HVM_PARAM_MEMORY_EVENT_CR3          21
 #define HVM_PARAM_MEMORY_EVENT_CR4          22
@@ -171,18 +177,12 @@
 #define HVM_PARAM_MEMORY_EVENT_SINGLE_STEP  25
 #define HVM_PARAM_MEMORY_EVENT_MSR          30
 
-#define HVMPME_MODE_MASK       (3 << 0)
-#define HVMPME_mode_disabled   0
-#define HVMPME_mode_async      1
-#define HVMPME_mode_sync       2
-#define HVMPME_onchangeonly    (1 << 2)
-
 /* Boolean: Enable nestedhvm (hvm only) */
 #define HVM_PARAM_NESTEDHVM    24
 
 /* Params for the mem event rings */
 #define HVM_PARAM_PAGING_RING_PFN   27
-#define HVM_PARAM_ACCESS_RING_PFN   28
+#define HVM_PARAM_MONITOR_RING_PFN  28
 #define HVM_PARAM_SHARING_RING_PFN  29
 
 /* SHUTDOWN_* action in case of a triple fault */
@@ -194,6 +194,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__ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/blkif.h
--- a/include/xen/interface/io/blkif.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/blkif.h	Fri Oct 16 16:24:14 2015 +0200
@@ -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"
  *
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/libxenvchan.h
--- a/include/xen/interface/io/libxenvchan.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/libxenvchan.h	Fri Oct 16 16:24:14 2015 +0200
@@ -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 -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/netif.h
--- a/include/xen/interface/io/netif.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/netif.h	Fri Oct 16 16:24:14 2015 +0200
@@ -136,14 +136,145 @@
  */
 
 /*
+ * "feature-multicast-control" advertises the capability to filter ethernet
+ * multicast packets in the backend. To enable use of this capability the
+ * frontend must set "request-multicast-control" before moving into the
+ * connected state.
+ *
+ * If "request-multicast-control" is set then the backend transmit side should
+ * no longer flood multicast packets to the frontend, it should instead drop any
+ * multicast packet that does not match in a filter list. The list is
+ * amended by the frontend by sending dummy transmit requests containing
+ * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL} extra-info fragments as specified below.
+ * Once enabled by the frontend, the feature cannot be disabled except by
+ * closing and re-connecting to the backend.
+ */
+
+/*
  * This is the 'wire' format for packets:
- *  Request 1: netif_tx_request -- NETTXF_* (any flags)
- * [Request 2: netif_tx_extra]  (only if request 1 has NETTXF_extra_info)
- * [Request 3: netif_tx_extra]  (only if request 2 has XEN_NETIF_EXTRA_MORE)
- *  Request 4: netif_tx_request -- NETTXF_more_data
- *  Request 5: netif_tx_request -- NETTXF_more_data
+ *  Request 1: netif_tx_request_t -- NETTXF_* (any flags)
+ * [Request 2: netif_extra_info_t] (only if request 1 has NETTXF_extra_info)
+ * [Request 3: netif_extra_info_t] (only if request 2 has XEN_NETIF_EXTRA_MORE)
+ *  Request 4: netif_tx_request_t -- NETTXF_more_data
+ *  Request 5: netif_tx_request_t -- NETTXF_more_data
  *  ...
- *  Request N: netif_tx_request -- 0
+ *  Request N: netif_tx_request_t -- 0
+ */
+
+/*
+ * Guest transmit
+ * ==============
+ *
+ * Ring slot size is 12 octets, however not all request/response
+ * structs use the full size.
+ *
+ * tx request data (netif_tx_request_t)
+ * ------------------------------------
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | grant ref             | offset    | flags     |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | id        | size      |
+ * +-----+-----+-----+-----+
+ *
+ * grant ref: Reference to buffer page.
+ * offset: Offset within buffer page.
+ * flags: NETTXF_*.
+ * id: request identifier, echoed in response.
+ * size: packet size in bytes.
+ *
+ * tx response (netif_tx_response_t)
+ * ---------------------------------
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | id        | status    | unused                |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | unused                |
+ * +-----+-----+-----+-----+
+ *
+ * id: reflects id in transmit request
+ * status: NETIF_RSP_*
+ *
+ * Guest receive
+ * =============
+ *
+ * Ring slot size is 8 octets.
+ *
+ * rx request (netif_rx_request_t)
+ * -------------------------------
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | id        | pad       | gref                  |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * id: request identifier, echoed in response.
+ * gref: reference to incoming granted frame.
+ *
+ * rx response (netif_rx_response_t)
+ * ---------------------------------
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | id        | offset    | flags     | status    |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * id: reflects id in receive request
+ * offset: offset in page of start of received packet
+ * flags: NETRXF_*
+ * status: -ve: NETIF_RSP_*; +ve: Rx'ed pkt size.
+ *
+ * Extra Info
+ * ==========
+ *
+ * Can be present if initial request has NET{T,R}XF_extra_info, or
+ * previous extra request has XEN_NETIF_EXTRA_MORE.
+ *
+ * The struct therefore needs to fit into either a tx or rx slot and
+ * is therefore limited to 8 octets.
+ *
+ * extra info (netif_extra_info_t)
+ * -------------------------------
+ *
+ * General format:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags| type specfic data                 |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * | padding for tx        |
+ * +-----+-----+-----+-----+
+ *
+ * type: XEN_NETIF_EXTRA_TYPE_*
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * padding for tx: present only in the tx case due to 8 octet limit
+ *     from rx case. Not shown in type specific entries below.
+ *
+ * XEN_NETIF_EXTRA_TYPE_GSO:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags| size      |type | pad | features  |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * type: Must be XEN_NETIF_EXTRA_TYPE_GSO
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * size: Maximum payload size of each segment.
+ * type: XEN_NETIF_GSO_TYPE_*
+ * features: EN_NETIF_GSO_FEAT_*
+ *
+ * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags| addr                              |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * type: Must be XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * addr: address to add/remove
  */
 
 /* Protocol checksum field is blank in the packet (hardware offload)? */
@@ -179,7 +310,7 @@ typedef struct netif_tx_request netif_tx
 #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3)  /* u.mcast */
 #define XEN_NETIF_EXTRA_TYPE_MAX       (4)
 
-/* netif_extra_info flags. */
+/* netif_extra_info_t flags. */
 #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
 #define XEN_NETIF_EXTRA_FLAG_MORE  (1U<<_XEN_NETIF_EXTRA_FLAG_MORE)
 
@@ -189,8 +320,8 @@ typedef struct netif_tx_request netif_tx
 #define XEN_NETIF_GSO_TYPE_TCPV6        (2)
 
 /*
- * This structure needs to fit within both netif_tx_request and
- * netif_rx_response for compatibility.
+ * This structure needs to fit within both netif_tx_request_t and
+ * netif_rx_response_t for compatibility.
  */
 struct netif_extra_info {
     uint8_t type;  /* XEN_NETIF_EXTRA_TYPE_* */
@@ -225,14 +356,6 @@ struct netif_extra_info {
 
         /*
          * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}:
-         * Backend advertises availability via 'feature-multicast-control'
-         * xenbus node containing value '1'.
-         * Frontend requests this feature by advertising
-         * 'request-multicast-control' xenbus node containing value '1'.
-         * If multicast control is requested then multicast flooding is
-         * disabled and the frontend must explicitly register its interest
-         * in multicast groups using dummy transmit requests containing
-         * MCAST_{ADD,DEL} extra-info fragments.
          */
         struct {
             uint8_t addr[6]; /* Address to add/remove. */
@@ -251,6 +374,7 @@ typedef struct netif_tx_response netif_t
 
 struct netif_rx_request {
     uint16_t    id;        /* Echoed in response message.        */
+    uint16_t    pad;
     grant_ref_t gref;      /* Reference to incoming granted frame */
 };
 typedef struct netif_rx_request netif_rx_request_t;
@@ -289,7 +413,7 @@ DEFINE_RING_TYPES(netif_rx, struct netif
 #define NETIF_RSP_DROPPED         -2
 #define NETIF_RSP_ERROR           -1
 #define NETIF_RSP_OKAY             0
-/* No response: used for auxiliary requests (e.g., netif_tx_extra). */
+/* No response: used for auxiliary requests (e.g., netif_extra_info_t). */
 #define NETIF_RSP_NULL             1
 
 #endif
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/protocols.h
--- a/include/xen/interface/io/protocols.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/protocols.h	Fri Oct 16 16:24:14 2015 +0200
@@ -18,6 +18,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2008, Keir Fraser
  */
 
 #ifndef __XEN_PROTOCOLS_H__
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/ring.h
--- a/include/xen/interface/io/ring.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/ring.h	Fri Oct 16 16:24:14 2015 +0200
@@ -111,7 +111,7 @@ struct __name##_sring {                 
             uint8_t msg;                                                \
         } tapif_user;                                                   \
         uint8_t pvt_pad[4];                                             \
-    } private;                                                          \
+    } pvt;                                                              \
     uint8_t __pad[44];                                                  \
     union __name##_sring_entry ring[1]; /* variable-length */           \
 };                                                                      \
@@ -156,7 +156,7 @@ typedef struct __name##_back_ring __name
 #define SHARED_RING_INIT(_s) do {                                       \
     (_s)->req_prod  = (_s)->rsp_prod  = 0;                              \
     (_s)->req_event = (_s)->rsp_event = 1;                              \
-    (void)memset((_s)->private.pvt_pad, 0, sizeof((_s)->private.pvt_pad)); \
+    (void)memset((_s)->pvt.pvt_pad, 0, sizeof((_s)->pvt.pvt_pad));      \
     (void)memset((_s)->__pad, 0, sizeof((_s)->__pad));                  \
 } while(0)
 
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/io/usbif.h
--- a/include/xen/interface/io/usbif.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/io/usbif.h	Fri Oct 16 16:24:14 2015 +0200
@@ -31,6 +31,76 @@
 #include "ring.h"
 #include "../grant_table.h"
 
+/*
+ * Feature and Parameter Negotiation
+ * =================================
+ * The two halves of a Xen pvUSB driver utilize nodes within the XenStore to
+ * communicate capabilities and to negotiate operating parameters. This
+ * section enumerates these nodes which reside in the respective front and
+ * backend portions of the XenStore, following the XenBus convention.
+ *
+ * Any specified default value is in effect if the corresponding XenBus node
+ * is not present in the XenStore.
+ *
+ * XenStore nodes in sections marked "PRIVATE" are solely for use by the
+ * driver side whose XenBus tree contains them.
+ *
+ *****************************************************************************
+ *                            Backend XenBus Nodes
+ *****************************************************************************
+ *
+ *------------------ Backend Device Identification (PRIVATE) ------------------
+ *
+ * num-ports
+ *      Values:         unsigned [1...31]
+ *
+ *      Number of ports for this (virtual) USB host connector.
+ *
+ * usb-ver
+ *      Values:         unsigned [1...2]
+ *
+ *      USB version of this host connector: 1 = USB 1.1, 2 = USB 2.0.
+ *
+ * port/[1...31]
+ *      Values:         string
+ *
+ *      Physical USB device connected to the given port, e.g. "3-1.5".
+ *
+ *****************************************************************************
+ *                            Frontend XenBus Nodes
+ *****************************************************************************
+ *
+ *----------------------- Request Transport Parameters -----------------------
+ *
+ * event-channel
+ *      Values:         unsigned
+ *
+ *      The identifier of the Xen event channel used to signal activity
+ *      in the ring buffer.
+ *
+ * urb-ring-ref
+ *      Values:         unsigned
+ *
+ *      The Xen grant reference granting permission for the backend to map
+ *      the sole page in a single page sized ring buffer. This is the ring
+ *      buffer for urb requests.
+ *
+ * conn-ring-ref
+ *      Values:         unsigned
+ *
+ *      The Xen grant reference granting permission for the backend to map
+ *      the sole page in a single page sized ring buffer. This is the ring
+ *      buffer for connection/disconnection requests.
+ *
+ * protocol
+ *      Values:         string (XEN_IO_PROTO_ABI_*)
+ *      Default Value:  XEN_IO_PROTO_ABI_NATIVE
+ *
+ *      The machine ABI rules governing the format of all ring request and
+ *      response structures.
+ *
+ */
+
 enum usb_spec_version {
 	USB_VER_UNKNOWN = 0,
 	USB_VER_USB11,
@@ -41,37 +111,65 @@ enum usb_spec_version {
 /*
  *  USB pipe in usbif_request
  *
- *  bits 0-5 are specific bits for virtual USB driver.
- *  bits 7-31 are standard urb pipe.
+ *  - port number:	bits 0-4
+ *				(USB_MAXCHILDREN is 31)
  *
- *  - port number(NEW):	bits 0-4
- *  				(USB_MAXCHILDREN is 31)
- *
- *  - operation flag(NEW):	bit 5
- *  				(0 = submit urb,
- *  				 1 = unlink urb)
+ *  - operation flag:	bit 5
+ *				(0 = submit urb,
+ *				 1 = unlink urb)
  *
  *  - direction:		bit 7
- *  				(0 = Host-to-Device [Out]
- *                           1 = Device-to-Host [In])
+ *				(0 = Host-to-Device [Out]
+ *				 1 = Device-to-Host [In])
  *
  *  - device address:	bits 8-14
  *
  *  - endpoint:		bits 15-18
  *
- *  - pipe type:		bits 30-31
- *  				(00 = isochronous, 01 = interrupt,
- *                           10 = control, 11 = bulk)
+ *  - pipe type:	bits 30-31
+ *				(00 = isochronous, 01 = interrupt,
+ *				 10 = control, 11 = bulk)
  */
-#define usbif_pipeportnum(pipe) ((pipe) & 0x1f)
-#define usbif_setportnum_pipe(pipe, portnum) \
-	((pipe)|(portnum))
 
-#define usbif_pipeunlink(pipe) ((pipe) & 0x20)
-#define usbif_pipesubmit(pipe) (!usbif_pipeunlink(pipe))
-#define usbif_setunlink_pipe(pipe) ((pipe)|(0x20))
+#define USBIF_PIPE_PORT_MASK	0x0000001f
+#define USBIF_PIPE_UNLINK	0x00000020
+#define USBIF_PIPE_DIR		0x00000080
+#define USBIF_PIPE_DEV_MASK	0x0000007f
+#define USBIF_PIPE_DEV_SHIFT	8
+#define USBIF_PIPE_EP_MASK	0x0000000f
+#define USBIF_PIPE_EP_SHIFT	15
+#define USBIF_PIPE_TYPE_MASK	0x00000003
+#define USBIF_PIPE_TYPE_SHIFT	30
+#define USBIF_PIPE_TYPE_ISOC	0
+#define USBIF_PIPE_TYPE_INT	1
+#define USBIF_PIPE_TYPE_CTRL	2
+#define USBIF_PIPE_TYPE_BULK	3
+
+#define usbif_pipeportnum(pipe)			((pipe) & USBIF_PIPE_PORT_MASK)
+#define usbif_setportnum_pipe(pipe, portnum)	((pipe) | (portnum))
+
+#define usbif_pipeunlink(pipe)			((pipe) & USBIF_PIPE_UNLINK)
+#define usbif_pipesubmit(pipe)			(!usbif_pipeunlink(pipe))
+#define usbif_setunlink_pipe(pipe)		((pipe) | USBIF_PIPE_UNLINK)
+
+#define usbif_pipein(pipe)			((pipe) & USBIF_PIPE_DIR)
+#define usbif_pipeout(pipe)			(!usbif_pipein(pipe))
+
+#define usbif_pipedevice(pipe)			\
+		(((pipe) >> USBIF_PIPE_DEV_SHIFT) & USBIF_PIPE_DEV_MASK)
+
+#define usbif_pipeendpoint(pipe)		\
+		(((pipe) >> USBIF_PIPE_EP_SHIFT) & USBIF_PIPE_EP_MASK)
+
+#define usbif_pipetype(pipe)			\
+		(((pipe) >> USBIF_PIPE_TYPE_SHIFT) & USBIF_PIPE_TYPE_MASK)
+#define usbif_pipeisoc(pipe)	(usbif_pipetype(pipe) == USBIF_PIPE_TYPE_ISOC)
+#define usbif_pipeint(pipe)	(usbif_pipetype(pipe) == USBIF_PIPE_TYPE_INT)
+#define usbif_pipectrl(pipe)	(usbif_pipetype(pipe) == USBIF_PIPE_TYPE_CTRL)
+#define usbif_pipebulk(pipe)	(usbif_pipetype(pipe) == USBIF_PIPE_TYPE_BULK)
 
 #define USBIF_MAX_SEGMENTS_PER_REQUEST (16)
+#define USBIF_MAX_PORTNR	31
 
 /*
  * RING for transferring urbs.
@@ -141,6 +239,10 @@ struct usbif_conn_response {
 	uint16_t id; /* request id */
 	uint8_t portnum; /* port number */
 	uint8_t speed; /* usb_device_speed */
+#define USBIF_SPEED_NONE	0
+#define USBIF_SPEED_LOW		1
+#define USBIF_SPEED_FULL	2
+#define USBIF_SPEED_HIGH	3
 };
 typedef struct usbif_conn_response usbif_conn_response_t;
 
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/mem_event.h
--- a/include/xen/interface/mem_event.h	Fri Oct 16 15:57:20 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/******************************************************************************
- * mem_event.h
- *
- * Memory event common structures.
- *
- * Copyright (c) 2009 by Citrix Systems, Inc. (Patrick Colp)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _XEN_PUBLIC_MEM_EVENT_H
-#define _XEN_PUBLIC_MEM_EVENT_H
-
-#include "xen.h"
-#include "io/ring.h"
-
-/* Memory event flags */
-#define MEM_EVENT_FLAG_VCPU_PAUSED     (1 << 0)
-#define MEM_EVENT_FLAG_DROP_PAGE       (1 << 1)
-#define MEM_EVENT_FLAG_EVICT_FAIL      (1 << 2)
-#define MEM_EVENT_FLAG_FOREIGN         (1 << 3)
-#define MEM_EVENT_FLAG_DUMMY           (1 << 4)
-/*
- * Emulate the fault-causing instruction (if set in the event response flags).
- * This will allow the guest to continue execution without lifting the page
- * access restrictions.
- */
-#define MEM_EVENT_FLAG_EMULATE         (1 << 5)
-/*
- * Same as MEM_EVENT_FLAG_EMULATE, but with write operations or operations
- * potentially having side effects (like memory mapped or port I/O) disabled.
- */
-#define MEM_EVENT_FLAG_EMULATE_NOWRITE (1 << 6)
-
-/* Reasons for the memory event request */
-#define MEM_EVENT_REASON_UNKNOWN     0    /* typical reason */
-#define MEM_EVENT_REASON_VIOLATION   1    /* access violation, GFN is address */
-#define MEM_EVENT_REASON_CR0         2    /* CR0 was hit: gfn is new CR0 value, gla is previous */
-#define MEM_EVENT_REASON_CR3         3    /* CR3 was hit: gfn is new CR3 value, gla is previous */
-#define MEM_EVENT_REASON_CR4         4    /* CR4 was hit: gfn is new CR4 value, gla is previous */
-#define MEM_EVENT_REASON_INT3        5    /* int3 was hit: gla/gfn are RIP */
-#define MEM_EVENT_REASON_SINGLESTEP  6    /* single step was invoked: gla/gfn are RIP */
-#define MEM_EVENT_REASON_MSR         7    /* MSR was hit: gfn is MSR value, gla is MSR address;
-                                             does NOT honour HVMPME_onchangeonly */
-
-/* Using a custom struct (not hvm_hw_cpu) so as to not fill
- * the mem_event ring buffer too quickly. */
-struct mem_event_regs_x86 {
-    uint64_t rax;
-    uint64_t rcx;
-    uint64_t rdx;
-    uint64_t rbx;
-    uint64_t rsp;
-    uint64_t rbp;
-    uint64_t rsi;
-    uint64_t rdi;
-    uint64_t r8;
-    uint64_t r9;
-    uint64_t r10;
-    uint64_t r11;
-    uint64_t r12;
-    uint64_t r13;
-    uint64_t r14;
-    uint64_t r15;
-    uint64_t rflags;
-    uint64_t dr7;
-    uint64_t rip;
-    uint64_t cr0;
-    uint64_t cr2;
-    uint64_t cr3;
-    uint64_t cr4;
-    uint64_t sysenter_cs;
-    uint64_t sysenter_esp;
-    uint64_t sysenter_eip;
-    uint64_t msr_efer;
-    uint64_t msr_star;
-    uint64_t msr_lstar;
-    uint64_t fs_base;
-    uint64_t gs_base;
-    uint32_t cs_arbytes;
-    uint32_t _pad;
-};
-
-typedef struct mem_event_st {
-    uint32_t flags;
-    uint32_t vcpu_id;
-
-    uint64_t gfn;
-    uint64_t offset;
-    uint64_t gla; /* if gla_valid */
-
-    uint32_t p2mt;
-
-    uint16_t access_r:1;
-    uint16_t access_w:1;
-    uint16_t access_x:1;
-    uint16_t gla_valid:1;
-    uint16_t fault_with_gla:1;
-    uint16_t fault_in_gpt:1;
-    uint16_t available:10;
-
-    uint16_t reason;
-    struct mem_event_regs_x86 x86_regs;
-} mem_event_request_t, mem_event_response_t;
-
-DEFINE_RING_TYPES(mem_event, mem_event_request_t, mem_event_response_t);
-
-#endif
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/memory.h
--- a/include/xen/interface/memory.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/memory.h	Fri Oct 16 16:24:14 2015 +0200
@@ -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
@@ -55,6 +56,8 @@
 /* Flag to request allocation only from the node specified */
 #define XENMEMF_exact_node_request  (1<<17)
 #define XENMEMF_exact_node(n) (XENMEMF_node(n) | XENMEMF_exact_node_request)
+/* Flag to indicate the node specified is virtual node */
+#define XENMEMF_vnode  (1<<18)
 #endif
 
 struct xen_memory_reservation {
@@ -372,23 +375,23 @@ typedef struct xen_pod_target xen_pod_ta
 #define XENMEM_paging_op_evict              1
 #define XENMEM_paging_op_prep               2
 
-struct xen_mem_event_op {
-    uint8_t     op;         /* XENMEM_*_op_* */
+struct xen_mem_paging_op {
+    uint8_t     op;         /* XENMEM_paging_op_* */
     domid_t     domain;
-    
 
     /* PAGING_PREP IN: buffer to immediately fill page in */
     uint64_aligned_t    buffer;
     /* Other OPs */
     uint64_aligned_t    gfn;           /* IN:  gfn of page being operated on */
 };
-typedef struct xen_mem_event_op xen_mem_event_op_t;
-DEFINE_XEN_GUEST_HANDLE(xen_mem_event_op_t);
+typedef struct xen_mem_paging_op xen_mem_paging_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_mem_paging_op_t);
 
 #define XENMEM_access_op                    21
-#define XENMEM_access_op_resume             0
-#define XENMEM_access_op_set_access         1
-#define XENMEM_access_op_get_access         2
+#define XENMEM_access_op_set_access         0
+#define XENMEM_access_op_get_access         1
+#define XENMEM_access_op_enable_emulate     2
+#define XENMEM_access_op_disable_emulate    3
 
 typedef enum {
     XENMEM_access_n,
@@ -439,12 +442,11 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_access_o
 #define XENMEM_sharing_op_nominate_gfn      0
 #define XENMEM_sharing_op_nominate_gref     1
 #define XENMEM_sharing_op_share             2
-#define XENMEM_sharing_op_resume            3
-#define XENMEM_sharing_op_debug_gfn         4
-#define XENMEM_sharing_op_debug_mfn         5
-#define XENMEM_sharing_op_debug_gref        6
-#define XENMEM_sharing_op_add_physmap       7
-#define XENMEM_sharing_op_audit             8
+#define XENMEM_sharing_op_debug_gfn         3
+#define XENMEM_sharing_op_debug_mfn         4
+#define XENMEM_sharing_op_debug_gref        5
+#define XENMEM_sharing_op_add_physmap       6
+#define XENMEM_sharing_op_audit             7
 
 #define XENMEM_SHARING_OP_S_HANDLE_INVALID  (-10)
 #define XENMEM_SHARING_OP_C_HANDLE_INVALID  (-9)
@@ -521,6 +523,40 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_
  * 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__) */
 
 /*
@@ -572,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 -r 3f51e783c26a -r 288d236ca763 include/xen/interface/physdev.h
--- a/include/xen/interface/physdev.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/physdev.h	Fri Oct 16 16:24:14 2015 +0200
@@ -16,6 +16,8 @@
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006, Keir Fraser
  */
 
 #ifndef __XEN_PUBLIC_PHYSDEV_H__
@@ -293,6 +295,11 @@ struct physdev_pci_device_add {
         uint8_t bus;
         uint8_t devfn;
     } physfn;
+    /*
+     * Optional parameters array.
+     * First element ([0]) is PXM domain associated with the device (if
+     * XEN_PCI_DEV_PXM is set)
+     */
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     uint32_t optarr[];
 #elif defined(__GNUC__)
@@ -344,9 +351,11 @@ DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_
  */
 #define PHYSDEVOP_IRQ_UNMASK_NOTIFY      4
 
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
 /*
  * These all-capitals physdev operation names are superceded by the new names
- * (defined above) since interface version 0x00030202.
+ * (defined above) since interface version 0x00030202. The guard above was
+ * added post-4.5 only though and hence shouldn't check for 0x00030202.
  */
 #define PHYSDEVOP_IRQ_STATUS_QUERY       PHYSDEVOP_irq_status_query
 #define PHYSDEVOP_SET_IOPL               PHYSDEVOP_set_iopl
@@ -357,6 +366,7 @@ DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_
 #define PHYSDEVOP_FREE_VECTOR            PHYSDEVOP_free_irq_vector
 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
 #define PHYSDEVOP_IRQ_SHARED             XENIRQSTAT_shared
+#endif
 
 #if __XEN_INTERFACE_VERSION__ < 0x00040200
 #define PHYSDEVOP_pirq_eoi_gmfn PHYSDEVOP_pirq_eoi_gmfn_v1
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/platform.h
--- a/include/xen/interface/platform.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/platform.h	Fri Oct 16 16:24:14 2015 +0200
@@ -35,13 +35,28 @@
  * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
  * 1 January, 1970 if the current system time was <system_time>.
  */
-#define XENPF_settime             17
-struct xenpf_settime {
+#define XENPF_settime32           17
+struct xenpf_settime32 {
     /* IN variables. */
     uint32_t secs;
     uint32_t nsecs;
     uint64_t system_time;
 };
+#define XENPF_settime64           62
+struct xenpf_settime64 {
+    /* IN variables. */
+    uint64_t secs;
+    uint32_t nsecs;
+    uint32_t mbz;
+    uint64_t system_time;
+};
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
+#define XENPF_settime XENPF_settime32
+#define xenpf_settime xenpf_settime32
+#else
+#define XENPF_settime XENPF_settime64
+#define xenpf_settime xenpf_settime64
+#endif
 typedef struct xenpf_settime xenpf_settime_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t);
 
@@ -126,6 +141,26 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_platform_q
 #define XEN_EFI_query_variable_info           9
 #define XEN_EFI_query_capsule_capabilities   10
 #define XEN_EFI_update_capsule               11
+
+struct xenpf_efi_time {
+    uint16_t year;
+    uint8_t month;
+    uint8_t day;
+    uint8_t hour;
+    uint8_t min;
+    uint8_t sec;
+    uint32_t ns;
+    int16_t tz;
+    uint8_t daylight;
+};
+
+struct xenpf_efi_guid {
+    uint32_t data1;
+    uint16_t data2;
+    uint16_t data3;
+    uint8_t data4[8];
+};
+
 struct xenpf_efi_runtime_call {
     uint32_t function;
     /*
@@ -138,17 +173,7 @@ struct xenpf_efi_runtime_call {
     union {
 #define XEN_EFI_GET_TIME_SET_CLEARS_NS 0x00000001
         struct {
-            struct xenpf_efi_time {
-                uint16_t year;
-                uint8_t month;
-                uint8_t day;
-                uint8_t hour;
-                uint8_t min;
-                uint8_t sec;
-                uint32_t ns;
-                int16_t tz;
-                uint8_t daylight;
-            } time;
+            struct xenpf_efi_time time;
             uint32_t resolution;
             uint32_t accuracy;
         } get_time;
@@ -170,12 +195,7 @@ struct xenpf_efi_runtime_call {
             XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
             xen_ulong_t size;
             XEN_GUEST_HANDLE(void) data;
-            struct xenpf_efi_guid {
-                uint32_t data1;
-                uint16_t data2;
-                uint16_t data3;
-                uint8_t data4[8];
-            } vendor_guid;
+            struct xenpf_efi_guid vendor_guid;
         } get_variable, set_variable;
 
         struct {
@@ -540,6 +560,16 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_core_parki
 #define XEN_RESOURCE_OP_MSR_READ  0
 #define XEN_RESOURCE_OP_MSR_WRITE 1
 
+/*
+ * Specially handled MSRs:
+ * - MSR_IA32_TSC
+ * READ: Returns the scaled system time(ns) instead of raw timestamp. In
+ *       multiple entry case, if other MSR read is followed by a MSR_IA32_TSC
+ *       read, then both reads are guaranteed to be performed atomically (with
+ *       IRQ disabled). The return time indicates the point of reading that MSR.
+ * WRITE: Not supported.
+ */
+
 struct xenpf_resource_entry {
     union {
         uint32_t cmd;   /* IN: XEN_RESOURCE_OP_* */
@@ -560,6 +590,24 @@ struct xenpf_resource_op {
 typedef struct xenpf_resource_op xenpf_resource_op_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_resource_op_t);
 
+#define XENPF_get_symbol   63
+struct xenpf_symdata {
+    /* IN/OUT variables */
+    uint32_t namelen; /* IN:  size of name buffer                       */
+                      /* OUT: strlen(name) of hypervisor symbol (may be */
+                      /*      larger than what's been copied to guest)  */
+    uint32_t symnum;  /* IN:  Symbol to read                            */
+                      /* OUT: Next available symbol. If same as IN then */
+                      /*      we reached the end                        */
+
+    /* OUT variables */
+    XEN_GUEST_HANDLE(char) name;
+    uint64_t address;
+    char type;
+};
+typedef struct xenpf_symdata xenpf_symdata_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t);
+
 /*
  * ` enum neg_errnoval
  * ` HYPERVISOR_platform_op(const struct xen_platform_op*);
@@ -569,6 +617,8 @@ struct xen_platform_op {
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
     union {
         struct xenpf_settime           settime;
+        struct xenpf_settime32         settime32;
+        struct xenpf_settime64         settime64;
         struct xenpf_add_memtype       add_memtype;
         struct xenpf_del_memtype       del_memtype;
         struct xenpf_read_memtype      read_memtype;
@@ -587,6 +637,7 @@ struct xen_platform_op {
         struct xenpf_mem_hotadd        mem_add;
         struct xenpf_core_parking      core_parking;
         struct xenpf_resource_op       resource_op;
+        struct xenpf_symdata           symdata;
         uint8_t                        pad[128];
     } u;
 };
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/pmu.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/pmu.h	Fri Oct 16 16:24:14 2015 +0200
@@ -0,0 +1,133 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ */
+
+#ifndef __XEN_PUBLIC_PMU_H__
+#define __XEN_PUBLIC_PMU_H__
+
+#include "xen.h"
+#if defined(__i386__) || defined(__x86_64__)
+#include "arch-x86/pmu.h"
+#elif defined (__arm__) || defined (__aarch64__)
+#include "arch-arm.h"
+#else
+#error "Unsupported architecture"
+#endif
+
+#define XENPMU_VER_MAJ    0
+#define XENPMU_VER_MIN    1
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_xenpmu_op(enum xenpmu_op cmd, struct xenpmu_params *args);
+ *
+ * @cmd  == XENPMU_* (PMU operation)
+ * @args == struct xenpmu_params
+ */
+/* ` enum xenpmu_op { */
+#define XENPMU_mode_get        0 /* Also used for getting PMU version */
+#define XENPMU_mode_set        1
+#define XENPMU_feature_get     2
+#define XENPMU_feature_set     3
+#define XENPMU_init            4
+#define XENPMU_finish          5
+#define XENPMU_lvtpc_set       6
+#define XENPMU_flush           7 /* Write cached MSR values to HW     */
+/* ` } */
+
+/* Parameters structure for HYPERVISOR_xenpmu_op call */
+struct xen_pmu_params {
+    /* IN/OUT parameters */
+    struct {
+        uint32_t maj;
+        uint32_t min;
+    } version;
+    uint64_t val;
+
+    /* IN parameters */
+    uint32_t vcpu;
+    uint32_t pad;
+};
+typedef struct xen_pmu_params xen_pmu_params_t;
+DEFINE_XEN_GUEST_HANDLE(xen_pmu_params_t);
+
+/* PMU modes:
+ * - XENPMU_MODE_OFF:   No PMU virtualization
+ * - XENPMU_MODE_SELF:  Guests can profile themselves
+ * - XENPMU_MODE_HV:    Guests can profile themselves, dom0 profiles
+ *                      itself and Xen
+ * - XENPMU_MODE_ALL:   Only dom0 has access to VPMU and it profiles
+ *                      everyone: itself, the hypervisor and the guests.
+ */
+#define XENPMU_MODE_OFF           0
+#define XENPMU_MODE_SELF          (1<<0)
+#define XENPMU_MODE_HV            (1<<1)
+#define XENPMU_MODE_ALL           (1<<2)
+
+/*
+ * PMU features:
+ * - XENPMU_FEATURE_INTEL_BTS: Intel BTS support (ignored on AMD)
+ */
+#define XENPMU_FEATURE_INTEL_BTS  1
+
+/*
+ * Shared PMU data between hypervisor and PV(H) domains.
+ *
+ * The hypervisor fills out this structure during PMU interrupt and sends an
+ * interrupt to appropriate VCPU.
+ * Architecture-independent fields of xen_pmu_data are WO for the hypervisor
+ * and RO for the guest but some fields in xen_pmu_arch can be writable
+ * by both the hypervisor and the guest (see arch-$arch/pmu.h).
+ */
+struct xen_pmu_data {
+    /* Interrupted VCPU */
+    uint32_t vcpu_id;
+
+    /*
+     * Physical processor on which the interrupt occurred. On non-privileged
+     * guests set to vcpu_id;
+     */
+    uint32_t pcpu_id;
+
+    /*
+     * Domain that was interrupted. On non-privileged guests set to DOMID_SELF.
+     * On privileged guests can be DOMID_SELF, DOMID_XEN, or, when in
+     * XENPMU_MODE_ALL mode, domain ID of another domain.
+     */
+    domid_t  domain_id;
+
+    uint8_t pad[6];
+
+    /* Architecture-specific information */
+    struct xen_pmu_arch pmu;
+};
+
+#endif /* __XEN_PUBLIC_PMU_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/sysctl.h
--- a/include/xen/interface/sysctl.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/sysctl.h	Fri Oct 16 16:24:14 2015 +0200
@@ -33,8 +33,10 @@
 
 #include "xen.h"
 #include "domctl.h"
+#include "physdev.h"
+#include "tmem.h"
 
-#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000B
+#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000C
 
 /*
  * Read console content from Xen buffer ring.
@@ -462,61 +464,76 @@ struct xen_sysctl_lockprof_op {
 typedef struct xen_sysctl_lockprof_op xen_sysctl_lockprof_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_op_t);
 
-/* XEN_SYSCTL_topologyinfo */
-#define INVALID_TOPOLOGY_ID  (~0U)
-struct xen_sysctl_topologyinfo {
-    /*
-     * IN: maximum addressable entry in the caller-provided arrays.
-     * OUT: largest cpu identifier in the system.
-     * If OUT is greater than IN then the arrays are truncated!
-     * If OUT is leass than IN then the array tails are not written by sysctl.
-     */
-    uint32_t max_cpu_index;
+/* XEN_SYSCTL_cputopoinfo */
+#define XEN_INVALID_CORE_ID     (~0U)
+#define XEN_INVALID_SOCKET_ID   (~0U)
+#define XEN_INVALID_NODE_ID     (~0U)
+
+struct xen_sysctl_cputopo {
+    uint32_t core;
+    uint32_t socket;
+    uint32_t node;
+};
+typedef struct xen_sysctl_cputopo xen_sysctl_cputopo_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cputopo_t);
+
+/*
+ * IN:
+ *  - a NULL 'cputopo' handle is a request for maximun 'num_cpus'.
+ *  - otherwise it's the number of entries in 'cputopo'
+ *
+ * OUT:
+ *  - If 'num_cpus' is less than the number Xen wants to write but the handle
+ *    handle is not a NULL one, partial data gets returned and 'num_cpus' gets
+ *    updated to reflect the intended number.
+ *  - Otherwise, 'num_cpus' shall indicate the number of entries written, which
+ *    may be less than the input value.
+ */
+struct xen_sysctl_cputopoinfo {
+    uint32_t num_cpus;
+    XEN_GUEST_HANDLE_64(xen_sysctl_cputopo_t) cputopo;
+};
+typedef struct xen_sysctl_cputopoinfo xen_sysctl_cputopoinfo_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cputopoinfo_t);
+
+/* XEN_SYSCTL_numainfo */
+#define XEN_INVALID_MEM_SZ     (~0U)
+#define XEN_INVALID_NODE_DIST  (~0U)
+
+struct xen_sysctl_meminfo {
+    uint64_t memsize;
+    uint64_t memfree;
+};
+typedef struct xen_sysctl_meminfo xen_sysctl_meminfo_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_meminfo_t);
+
+/*
+ * IN:
+ *  - Both 'meminfo' and 'distance' handles being null is a request
+ *    for maximum value of 'num_nodes'.
+ *  - Otherwise it's the number of entries in 'meminfo' and square root
+ *    of number of entries in 'distance' (when corresponding handle is
+ *    non-null)
+ *
+ * OUT:
+ *  - If 'num_nodes' is less than the number Xen wants to write but either
+ *    handle is not a NULL one, partial data gets returned and 'num_nodes'
+ *    gets updated to reflect the intended number.
+ *  - Otherwise, 'num_nodes' shall indicate the number of entries written, which
+ *    may be less than the input value.
+ */
+
+struct xen_sysctl_numainfo {
+    uint32_t num_nodes;
+
+    XEN_GUEST_HANDLE_64(xen_sysctl_meminfo_t) meminfo;
 
     /*
-     * If not NULL, these arrays are filled with core/socket/node identifier
-     * for each cpu.
-     * If a cpu has no core/socket/node information (e.g., cpu not present) 
-     * then the sentinel value ~0u is written to each array.
-     * The number of array elements written by the sysctl is:
-     *   min(@max_cpu_index_IN,@max_cpu_index_OUT)+1
+     * Distance between nodes 'i' and 'j' is stored in index 'i*N + j',
+     * where N is the number of nodes that will be returned in 'num_nodes'
+     * (i.e. not 'num_nodes' provided by the caller)
      */
-    XEN_GUEST_HANDLE_64(uint32) cpu_to_core;
-    XEN_GUEST_HANDLE_64(uint32) cpu_to_socket;
-    XEN_GUEST_HANDLE_64(uint32) cpu_to_node;
-};
-typedef struct xen_sysctl_topologyinfo xen_sysctl_topologyinfo_t;
-DEFINE_XEN_GUEST_HANDLE(xen_sysctl_topologyinfo_t);
-
-/* XEN_SYSCTL_numainfo */
-#define INVALID_NUMAINFO_ID (~0U)
-struct xen_sysctl_numainfo {
-    /*
-     * IN: maximum addressable entry in the caller-provided arrays.
-     * OUT: largest node identifier in the system.
-     * If OUT is greater than IN then the arrays are truncated!
-     */
-    uint32_t max_node_index;
-
-    /* NB. Entries are 0 if node is not present. */
-    XEN_GUEST_HANDLE_64(uint64) node_to_memsize;
-    XEN_GUEST_HANDLE_64(uint64) node_to_memfree;
-
-    /*
-     * Array, of size (max_node_index+1)^2, listing memory access distances
-     * between nodes. If an entry has no node distance information (e.g., node 
-     * not present) then the value ~0u is written.
-     * 
-     * Note that the array rows must be indexed by multiplying by the minimum 
-     * of the caller-provided max_node_index and the returned value of
-     * max_node_index. That is, if the largest node index in the system is
-     * smaller than the caller can handle, a smaller 2-d array is constructed
-     * within the space provided by the caller. When this occurs, trailing
-     * space provided by the caller is not modified. If the largest node index
-     * in the system is larger than the caller can handle, then a 2-d array of
-     * the maximum size handleable by the caller is constructed.
-     */
-    XEN_GUEST_HANDLE_64(uint32) node_to_node_distance;
+    XEN_GUEST_HANDLE_64(uint32) distance;
 };
 typedef struct xen_sysctl_numainfo xen_sysctl_numainfo_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_numainfo_t);
@@ -641,6 +658,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cover
 /* The L3 cache size is returned in KB unit */
 #define XEN_SYSCTL_PSR_CMT_get_l3_cache_size         2
 #define XEN_SYSCTL_PSR_CMT_enabled                   3
+#define XEN_SYSCTL_PSR_CMT_get_l3_event_mask         4
 struct xen_sysctl_psr_cmt_op {
     uint32_t cmd;       /* IN: XEN_SYSCTL_PSR_CMT_* */
     uint32_t flags;     /* padding variable, may be extended for future use */
@@ -655,6 +673,97 @@ struct xen_sysctl_psr_cmt_op {
 typedef struct xen_sysctl_psr_cmt_op xen_sysctl_psr_cmt_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_psr_cmt_op_t);
 
+/* XEN_SYSCTL_pcitopoinfo */
+#define XEN_INVALID_DEV (XEN_INVALID_NODE_ID - 1)
+struct xen_sysctl_pcitopoinfo {
+    /*
+     * IN: Number of elements in 'pcitopo' and 'nodes' arrays.
+     * OUT: Number of processed elements of those arrays.
+     */
+    uint32_t num_devs;
+
+    /* IN: list of devices for which node IDs are requested. */
+    XEN_GUEST_HANDLE_64(physdev_pci_device_t) devs;
+
+    /*
+     * OUT: node identifier for each device.
+     * If information for a particular device is not available then
+     * corresponding entry will be set to XEN_INVALID_NODE_ID. If
+     * device is not known to the hypervisor then XEN_INVALID_DEV
+     * will be provided.
+     */
+    XEN_GUEST_HANDLE_64(uint32) nodes;
+};
+typedef struct xen_sysctl_pcitopoinfo xen_sysctl_pcitopoinfo_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_pcitopoinfo_t);
+
+#define XEN_SYSCTL_PSR_CAT_get_l3_info               0
+struct xen_sysctl_psr_cat_op {
+    uint32_t cmd;       /* IN: XEN_SYSCTL_PSR_CAT_* */
+    uint32_t target;    /* IN */
+    union {
+        struct {
+            uint32_t cbm_len;   /* OUT: CBM length */
+            uint32_t cos_max;   /* OUT: Maximum COS */
+        } l3_info;
+    } u;
+};
+typedef struct xen_sysctl_psr_cat_op xen_sysctl_psr_cat_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_psr_cat_op_t);
+
+#define XEN_SYSCTL_TMEM_OP_ALL_CLIENTS 0xFFFFU
+
+#define XEN_SYSCTL_TMEM_OP_THAW                   0
+#define XEN_SYSCTL_TMEM_OP_FREEZE                 1
+#define XEN_SYSCTL_TMEM_OP_FLUSH                  2
+#define XEN_SYSCTL_TMEM_OP_DESTROY                3
+#define XEN_SYSCTL_TMEM_OP_LIST                   4
+#define XEN_SYSCTL_TMEM_OP_SET_WEIGHT             5
+#define XEN_SYSCTL_TMEM_OP_SET_CAP                6
+#define XEN_SYSCTL_TMEM_OP_SET_COMPRESS           7
+#define XEN_SYSCTL_TMEM_OP_QUERY_FREEABLE_MB      8
+#define XEN_SYSCTL_TMEM_OP_SAVE_BEGIN             10
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_VERSION       11
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_MAXPOOLS      12
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_WEIGHT 13
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_CAP    14
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_FLAGS  15
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_FLAGS    16
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_NPAGES   17
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_UUID     18
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_PAGE     19
+#define XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_INV      20
+#define XEN_SYSCTL_TMEM_OP_SAVE_END               21
+#define XEN_SYSCTL_TMEM_OP_RESTORE_BEGIN          30
+#define XEN_SYSCTL_TMEM_OP_RESTORE_PUT_PAGE       32
+#define XEN_SYSCTL_TMEM_OP_RESTORE_FLUSH_PAGE     33
+
+/*
+ * XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_[PAGE|INV] override the 'buf' in
+ * xen_sysctl_tmem_op with this structure - sometimes with an extra
+ * page tackled on.
+ */
+struct tmem_handle {
+    uint32_t pool_id;
+    uint32_t index;
+    xen_tmem_oid_t oid;
+};
+
+struct xen_sysctl_tmem_op {
+    uint32_t cmd;       /* IN: XEN_SYSCTL_TMEM_OP_* . */
+    int32_t pool_id;    /* IN: 0 by default unless _SAVE_*, RESTORE_* .*/
+    uint32_t cli_id;    /* IN: client id, 0 for XEN_SYSCTL_TMEM_QUERY_FREEABLE_MB
+                           for all others can be the domain id or
+                           XEN_SYSCTL_TMEM_OP_ALL_CLIENTS for all. */
+    uint32_t arg1;      /* IN: If not applicable to command use 0. */
+    uint32_t arg2;      /* IN: If not applicable to command use 0. */
+    uint32_t pad;       /* Padding so structure is the same under 32 and 64. */
+    xen_tmem_oid_t oid; /* IN: If not applicable to command use 0s. */
+    XEN_GUEST_HANDLE_64(char) buf; /* IN/OUT: Buffer to save and restore ops. */
+};
+typedef struct xen_sysctl_tmem_op xen_sysctl_tmem_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tmem_op_t);
+
 struct xen_sysctl {
     uint32_t cmd;
 #define XEN_SYSCTL_readconsole                    1
@@ -671,18 +780,22 @@ struct xen_sysctl {
 #define XEN_SYSCTL_pm_op                         12
 #define XEN_SYSCTL_page_offline_op               14
 #define XEN_SYSCTL_lockprof_op                   15
-#define XEN_SYSCTL_topologyinfo                  16 
+#define XEN_SYSCTL_cputopoinfo                   16
 #define XEN_SYSCTL_numainfo                      17
 #define XEN_SYSCTL_cpupool_op                    18
 #define XEN_SYSCTL_scheduler_op                  19
 #define XEN_SYSCTL_coverage_op                   20
 #define XEN_SYSCTL_psr_cmt_op                    21
+#define XEN_SYSCTL_pcitopoinfo                   22
+#define XEN_SYSCTL_psr_cat_op                    23
+#define XEN_SYSCTL_tmem_op                       24
     uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
     union {
         struct xen_sysctl_readconsole       readconsole;
         struct xen_sysctl_tbuf_op           tbuf_op;
         struct xen_sysctl_physinfo          physinfo;
-        struct xen_sysctl_topologyinfo      topologyinfo;
+        struct xen_sysctl_cputopoinfo       cputopoinfo;
+        struct xen_sysctl_pcitopoinfo       pcitopoinfo;
         struct xen_sysctl_numainfo          numainfo;
         struct xen_sysctl_sched_id          sched_id;
         struct xen_sysctl_perfc_op          perfc_op;
@@ -699,6 +812,8 @@ struct xen_sysctl {
         struct xen_sysctl_scheduler_op      scheduler_op;
         struct xen_sysctl_coverage_op       coverage_op;
         struct xen_sysctl_psr_cmt_op        psr_cmt_op;
+        struct xen_sysctl_psr_cat_op        psr_cat_op;
+        struct xen_sysctl_tmem_op           tmem_op;
         uint8_t                             pad[128];
     } u;
 };
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/tmem.h
--- a/include/xen/interface/tmem.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/tmem.h	Fri Oct 16 16:24:14 2015 +0200
@@ -33,7 +33,11 @@
 #define TMEM_SPEC_VERSION          1
 
 /* Commands to HYPERVISOR_tmem_op() */
-#define TMEM_CONTROL               0
+#ifdef __XEN__
+#define TMEM_CONTROL               0 /* Now called XEN_SYSCTL_tmem_op */
+#else
+#undef TMEM_CONTROL
+#endif
 #define TMEM_NEW_POOL              1
 #define TMEM_DESTROY_POOL          2
 #define TMEM_PUT_PAGE              4
@@ -48,35 +52,9 @@
 #endif
 
 /* Privileged commands to HYPERVISOR_tmem_op() */
-#define TMEM_AUTH                 101 
+#define TMEM_AUTH                 101
 #define TMEM_RESTORE_NEW          102
 
-/* Subops for HYPERVISOR_tmem_op(TMEM_CONTROL) */
-#define TMEMC_THAW                   0
-#define TMEMC_FREEZE                 1
-#define TMEMC_FLUSH                  2
-#define TMEMC_DESTROY                3
-#define TMEMC_LIST                   4
-#define TMEMC_SET_WEIGHT             5
-#define TMEMC_SET_CAP                6
-#define TMEMC_SET_COMPRESS           7
-#define TMEMC_QUERY_FREEABLE_MB      8
-#define TMEMC_SAVE_BEGIN             10
-#define TMEMC_SAVE_GET_VERSION       11
-#define TMEMC_SAVE_GET_MAXPOOLS      12
-#define TMEMC_SAVE_GET_CLIENT_WEIGHT 13
-#define TMEMC_SAVE_GET_CLIENT_CAP    14
-#define TMEMC_SAVE_GET_CLIENT_FLAGS  15
-#define TMEMC_SAVE_GET_POOL_FLAGS    16
-#define TMEMC_SAVE_GET_POOL_NPAGES   17
-#define TMEMC_SAVE_GET_POOL_UUID     18
-#define TMEMC_SAVE_GET_NEXT_PAGE     19
-#define TMEMC_SAVE_GET_NEXT_INV      20
-#define TMEMC_SAVE_END               21
-#define TMEMC_RESTORE_BEGIN          30
-#define TMEMC_RESTORE_PUT_PAGE       32
-#define TMEMC_RESTORE_FLUSH_PAGE     33
-
 /* Bits for HYPERVISOR_tmem_op(TMEM_NEW_POOL) */
 #define TMEM_POOL_PERSIST          1
 #define TMEM_POOL_SHARED           2
@@ -95,6 +73,11 @@
 #define EFROZEN                 1000
 #define EEMPTY                  1001
 
+struct xen_tmem_oid {
+    uint64_t oid[3];
+};
+typedef struct xen_tmem_oid xen_tmem_oid_t;
+DEFINE_XEN_GUEST_HANDLE(xen_tmem_oid_t);
 
 #ifndef __ASSEMBLY__
 #if __XEN_INTERFACE_VERSION__ < 0x00040400
@@ -110,17 +93,12 @@ struct tmem_op {
             uint32_t flags;
             uint32_t arg1;
         } creat; /* for cmd == TMEM_NEW_POOL, TMEM_AUTH, TMEM_RESTORE_NEW */
-        struct { 
-            uint32_t subop;
-            uint32_t cli_id;
-            uint32_t arg1;
-            uint32_t arg2;
+        struct {
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
             uint64_t oid[3];
-            tmem_cli_va_t buf;
-        } ctrl; /* for cmd == TMEM_CONTROL */
-        struct {
-            
-            uint64_t oid[3];
+#else
+            xen_tmem_oid_t oid;
+#endif
             uint32_t index;
             uint32_t tmem_offset;
             uint32_t pfn_offset;
@@ -131,12 +109,6 @@ struct tmem_op {
 };
 typedef struct tmem_op tmem_op_t;
 DEFINE_XEN_GUEST_HANDLE(tmem_op_t);
-
-struct tmem_handle {
-    uint32_t pool_id;
-    uint32_t index;
-    uint64_t oid[3];
-};
 #endif
 
 #endif /* __XEN_PUBLIC_TMEM_H__ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/trace.h
--- a/include/xen/interface/trace.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/trace.h	Fri Oct 16 16:24:14 2015 +0200
@@ -75,7 +75,7 @@
 /* Per-scheduler IDs, to identify scheduler specific events */
 #define TRC_SCHED_CSCHED   0
 #define TRC_SCHED_CSCHED2  1
-#define TRC_SCHED_SEDF     2
+/* #define XEN_SCHEDULER_SEDF 2 (Removed) */
 #define TRC_SCHED_ARINC653 3
 #define TRC_SCHED_RTDS     4
 
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/vcpu.h
--- a/include/xen/interface/vcpu.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/vcpu.h	Fri Oct 16 16:24:14 2015 +0200
@@ -31,7 +31,7 @@
 
 /*
  * Prototype for this hypercall is:
- *  int vcpu_op(int cmd, int vcpuid, void *extra_args)
+ *  long vcpu_op(int cmd, unsigned int vcpuid, void *extra_args)
  * @cmd        == VCPUOP_??? (VCPU operation).
  * @vcpuid     == VCPU to operate on.
  * @extra_args == Operation-specific extra arguments (NULL if none).
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/vm_event.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/vm_event.h	Fri Oct 16 16:24:14 2015 +0200
@@ -0,0 +1,269 @@
+/******************************************************************************
+ * vm_event.h
+ *
+ * Memory event common structures.
+ *
+ * Copyright (c) 2009 by Citrix Systems, Inc. (Patrick Colp)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _XEN_PUBLIC_VM_EVENT_H
+#define _XEN_PUBLIC_VM_EVENT_H
+
+#include "xen.h"
+
+#define VM_EVENT_INTERFACE_VERSION 0x00000001
+
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+
+#include "io/ring.h"
+
+/*
+ * Memory event flags
+ */
+
+/*
+ * VCPU_PAUSED in a request signals that the vCPU triggering the event has been
+ *  paused
+ * VCPU_PAUSED in a response signals to unpause the vCPU
+ */
+#define VM_EVENT_FLAG_VCPU_PAUSED        (1 << 0)
+/* Flags to aid debugging vm_event */
+#define VM_EVENT_FLAG_FOREIGN            (1 << 1)
+/*
+ * The following flags can be set in response to a mem_access event.
+ *
+ * Emulate the fault-causing instruction (if set in the event response flags).
+ * This will allow the guest to continue execution without lifting the page
+ * access restrictions.
+ */
+#define VM_EVENT_FLAG_EMULATE            (1 << 2)
+/*
+ * Same as VM_EVENT_FLAG_EMULATE, but with write operations or operations
+ * potentially having side effects (like memory mapped or port I/O) disabled.
+ */
+#define VM_EVENT_FLAG_EMULATE_NOWRITE    (1 << 3)
+/*
+ * Toggle singlestepping on vm_event response.
+ * Requires the vCPU to be paused already (synchronous events only).
+ */
+#define VM_EVENT_FLAG_TOGGLE_SINGLESTEP  (1 << 4)
+/*
+ * Data is being sent back to the hypervisor in the event response, to be
+ * returned by the read function when emulating an instruction.
+ * This flag is only useful when combined with VM_EVENT_FLAG_EMULATE
+ * and takes precedence if combined with VM_EVENT_FLAG_EMULATE_NOWRITE
+ * (i.e. if both VM_EVENT_FLAG_EMULATE_NOWRITE and
+ * VM_EVENT_FLAG_SET_EMUL_READ_DATA are set, only the latter will be honored).
+ */
+#define VM_EVENT_FLAG_SET_EMUL_READ_DATA (1 << 5)
+ /*
+  * Deny completion of the operation that triggered the event.
+  * 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
+ */
+
+/* Default case */
+#define VM_EVENT_REASON_UNKNOWN                 0
+/* Memory access violation */
+#define VM_EVENT_REASON_MEM_ACCESS              1
+/* Memory sharing event */
+#define VM_EVENT_REASON_MEM_SHARING             2
+/* Memory paging event */
+#define VM_EVENT_REASON_MEM_PAGING              3
+/* A control register was updated */
+#define VM_EVENT_REASON_WRITE_CTRLREG           4
+/* An MSR was updated. */
+#define VM_EVENT_REASON_MOV_TO_MSR              5
+/* Debug operation executed (e.g. int3) */
+#define VM_EVENT_REASON_SOFTWARE_BREAKPOINT     6
+/* Single-step (e.g. MTF) */
+#define VM_EVENT_REASON_SINGLESTEP              7
+/* An event has been requested via HVMOP_guest_request_vm_event. */
+#define VM_EVENT_REASON_GUEST_REQUEST           8
+
+/* Supported values for the vm_event_write_ctrlreg index. */
+#define VM_EVENT_X86_CR0    0
+#define VM_EVENT_X86_CR3    1
+#define VM_EVENT_X86_CR4    2
+#define VM_EVENT_X86_XCR0   3
+
+/*
+ * Using a custom struct (not hvm_hw_cpu) so as to not fill
+ * the vm_event ring buffer too quickly.
+ */
+struct vm_event_regs_x86 {
+    uint64_t rax;
+    uint64_t rcx;
+    uint64_t rdx;
+    uint64_t rbx;
+    uint64_t rsp;
+    uint64_t rbp;
+    uint64_t rsi;
+    uint64_t rdi;
+    uint64_t r8;
+    uint64_t r9;
+    uint64_t r10;
+    uint64_t r11;
+    uint64_t r12;
+    uint64_t r13;
+    uint64_t r14;
+    uint64_t r15;
+    uint64_t rflags;
+    uint64_t dr7;
+    uint64_t rip;
+    uint64_t cr0;
+    uint64_t cr2;
+    uint64_t cr3;
+    uint64_t cr4;
+    uint64_t sysenter_cs;
+    uint64_t sysenter_esp;
+    uint64_t sysenter_eip;
+    uint64_t msr_efer;
+    uint64_t msr_star;
+    uint64_t msr_lstar;
+    uint64_t fs_base;
+    uint64_t gs_base;
+    uint32_t cs_arbytes;
+    uint32_t _pad;
+};
+
+/*
+ * mem_access flag definitions
+ *
+ * These flags are set only as part of a mem_event request.
+ *
+ * R/W/X: Defines the type of violation that has triggered the event
+ *        Multiple types can be set in a single violation!
+ * GLA_VALID: If the gla field holds a guest VA associated with the event
+ * FAULT_WITH_GLA: If the violation was triggered by accessing gla
+ * FAULT_IN_GPT: If the violation was triggered during translating gla
+ */
+#define MEM_ACCESS_R                    (1 << 0)
+#define MEM_ACCESS_W                    (1 << 1)
+#define MEM_ACCESS_X                    (1 << 2)
+#define MEM_ACCESS_RWX                  (MEM_ACCESS_R | MEM_ACCESS_W | MEM_ACCESS_X)
+#define MEM_ACCESS_RW                   (MEM_ACCESS_R | MEM_ACCESS_W)
+#define MEM_ACCESS_RX                   (MEM_ACCESS_R | MEM_ACCESS_X)
+#define MEM_ACCESS_WX                   (MEM_ACCESS_W | MEM_ACCESS_X)
+#define MEM_ACCESS_GLA_VALID            (1 << 3)
+#define MEM_ACCESS_FAULT_WITH_GLA       (1 << 4)
+#define MEM_ACCESS_FAULT_IN_GPT         (1 << 5)
+
+struct vm_event_mem_access {
+    uint64_t gfn;
+    uint64_t offset;
+    uint64_t gla;   /* if flags has MEM_ACCESS_GLA_VALID set */
+    uint32_t flags; /* MEM_ACCESS_* */
+    uint32_t _pad;
+};
+
+struct vm_event_write_ctrlreg {
+    uint32_t index;
+    uint32_t _pad;
+    uint64_t new_value;
+    uint64_t old_value;
+};
+
+struct vm_event_debug {
+    uint64_t gfn;
+};
+
+struct vm_event_mov_to_msr {
+    uint64_t msr;
+    uint64_t value;
+};
+
+#define MEM_PAGING_DROP_PAGE       (1 << 0)
+#define MEM_PAGING_EVICT_FAIL      (1 << 1)
+
+struct vm_event_paging {
+    uint64_t gfn;
+    uint32_t p2mt;
+    uint32_t flags;
+};
+
+struct vm_event_sharing {
+    uint64_t gfn;
+    uint32_t p2mt;
+    uint32_t _pad;
+};
+
+struct vm_event_emul_read_data {
+    uint32_t size;
+    /* The struct is used in a union with vm_event_regs_x86. */
+    uint8_t  data[sizeof(struct vm_event_regs_x86) - sizeof(uint32_t)];
+};
+
+typedef struct vm_event_st {
+    uint32_t version;   /* VM_EVENT_INTERFACE_VERSION */
+    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;
+        struct vm_event_sharing               mem_sharing;
+        struct vm_event_mem_access            mem_access;
+        struct vm_event_write_ctrlreg         write_ctrlreg;
+        struct vm_event_mov_to_msr            mov_to_msr;
+        struct vm_event_debug                 software_breakpoint;
+        struct vm_event_debug                 singlestep;
+    } u;
+
+    union {
+        union {
+            struct vm_event_regs_x86 x86;
+        } regs;
+
+        struct vm_event_emul_read_data emul_read_data;
+    } data;
+} vm_event_request_t, vm_event_response_t;
+
+DEFINE_RING_TYPES(vm_event, vm_event_request_t, vm_event_response_t);
+
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+#endif /* _XEN_PUBLIC_VM_EVENT_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/xen-compat.h
--- a/include/xen/interface/xen-compat.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/xen-compat.h	Fri Oct 16 16:24:14 2015 +0200
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040500
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040600
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/xen.h
--- a/include/xen/interface/xen.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/xen.h	Fri Oct 16 16:24:14 2015 +0200
@@ -103,6 +103,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define __HYPERVISOR_kexec_op             37
 #define __HYPERVISOR_tmem_op              38
 #define __HYPERVISOR_xc_reserved_op       39 /* reserved for XenClient */
+#define __HYPERVISOR_xenpmu_op            40
 
 /* Architecture-specific hypercall definitions. */
 #define __HYPERVISOR_arch_0               48
@@ -162,6 +163,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define VIRQ_MEM_EVENT  10 /* G. (DOM0) A memory event has occured           */
 #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient                     */
 #define VIRQ_ENOMEM     12 /* G. (DOM0) Low on heap memory       */
+#define VIRQ_XENPMU     13 /* V.  PMC interrupt                              */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16
@@ -488,7 +490,21 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 /* x86/PAE guests: support PDPTs above 4GB. */
 #define VMASST_TYPE_pae_extended_cr3     3
 
+/*
+ * x86/64 guests: strictly hide M2P from user mode.
+ * This allows the guest to control respective hypervisor behavior:
+ * - when not set, L4 tables get created with the respective slot blank,
+ *   and whenever the L4 table gets used as a kernel one the missing
+ *   mapping gets inserted,
+ * - when set, L4 tables get created with the respective slot initialized
+ *   as before, and whenever the L4 table gets used as a user one the
+ *   mapping gets zapped.
+ */
+#define VMASST_TYPE_m2p_strict           32
+
+#if __XEN_INTERFACE_VERSION__ < 0x00040600
 #define MAX_VMASST_TYPE                  3
+#endif
 
 #ifndef __ASSEMBLY__
 
@@ -684,6 +700,12 @@ struct shared_info {
     uint32_t wc_version;      /* Version counter: see vcpu_time_info_t. */
     uint32_t wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
     uint32_t wc_nsec;         /* Nsecs 00:00:00 UTC, Jan 1, 1970.  */
+#if !defined(__i386__)
+    uint32_t wc_sec_hi;
+# define xen_wc_sec_hi wc_sec_hi
+#elif !defined(__XEN__) && !defined(__XEN_TOOLS__)
+# define xen_wc_sec_hi arch.wc_sec_hi
+#endif
 
     struct arch_shared_info arch;
 
@@ -700,24 +722,27 @@ typedef struct shared_info shared_info_t
  *  3. This the order of bootstrap elements in the initial virtual region:
  *      a. relocated kernel image
  *      b. initial ram disk              [mod_start, mod_len]
+ *         (may be omitted)
  *      c. list of allocated page frames [mfn_list, nr_pages]
  *         (unless relocated due to XEN_ELFNOTE_INIT_P2M)
  *      d. start_info_t structure        [register ESI (x86)]
- *      e. bootstrap page tables         [pt_base and CR3 (x86)]
- *      f. bootstrap stack               [register ESP (x86)]
+ *         in case of dom0 this page contains the console info, too
+ *      e. unless dom0: xenstore ring page
+ *      f. unless dom0: console ring page
+ *      g. bootstrap page tables         [pt_base and CR3 (x86)]
+ *      h. bootstrap stack               [register ESP (x86)]
  *  4. Bootstrap elements are packed together, but each is 4kB-aligned.
- *  5. The initial ram disk may be omitted.
- *  6. The list of page frames forms a contiguous 'pseudo-physical' memory
+ *  5. The list of page frames forms a contiguous 'pseudo-physical' memory
  *     layout for the domain. In particular, the bootstrap virtual-memory
  *     region is a 1:1 mapping to the first section of the pseudo-physical map.
- *  7. All bootstrap elements are mapped read-writable for the guest OS. The
+ *  6. All bootstrap elements are mapped read-writable for the guest OS. The
  *     only exception is the bootstrap page table, which is mapped read-only.
- *  8. There is guaranteed to be at least 512kB padding after the final
+ *  7. There is guaranteed to be at least 512kB padding after the final
  *     bootstrap element. If necessary, the bootstrap virtual region is
  *     extended by an extra 4MB to ensure this.
  *
  * Note: Prior to 25833:bb85bbccb1c9. ("x86/32-on-64 adjust Dom0 initial page
- * table layout") a bug caused the pt_base (3.e above) and cr3 to not point
+ * table layout") a bug caused the pt_base (3.g above) and cr3 to not point
  * to the start of the guest page tables (it was offset by two pages).
  * This only manifested itself on 32-on-64 dom0 kernels and not 32-on-64 domU
  * or 64-bit kernels of any colour. The page tables for a 32-on-64 dom0 got
@@ -773,6 +798,8 @@ typedef struct start_info start_info_t;
 #define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
 #define SIF_MULTIBOOT_MOD (1<<2)  /* Is mod_start a multiboot module? */
 #define SIF_MOD_START_PFN (1<<3)  /* Is mod_start a PFN? */
+#define SIF_VIRT_P2M_4TOOLS (1<<4) /* Do Xen tools understand a virt. mapped */
+                                   /* P->M making the 3 level tree obsolete? */
 #define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
 
 /*
@@ -872,6 +899,9 @@ __DEFINE_XEN_GUEST_HANDLE(uint64, uint64
 /* Default definitions for macros used by domctl/sysctl. */
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 
+#ifndef int64_aligned_t
+#define int64_aligned_t int64_t
+#endif
 #ifndef uint64_aligned_t
 #define uint64_aligned_t uint64_t
 #endif
diff -r 3f51e783c26a -r 288d236ca763 include/xen/interface/xsm/flask_op.h
--- a/include/xen/interface/xsm/flask_op.h	Fri Oct 16 15:57:20 2015 +0200
+++ b/include/xen/interface/xsm/flask_op.h	Fri Oct 16 16:24:14 2015 +0200
@@ -25,6 +25,8 @@
 #ifndef __FLASK_OP_H__
 #define __FLASK_OP_H__
 
+#include "../event_channel.h"
+
 #define XEN_FLASK_INTERFACE_VERSION 1
 
 struct xen_flask_load {
@@ -148,6 +150,13 @@ struct xen_flask_relabel {
     uint32_t sid;
 };
 
+struct xen_flask_devicetree_label {
+    /* IN */
+    uint32_t sid;
+    uint32_t length;
+    XEN_GUEST_HANDLE(char) path;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -174,6 +183,7 @@ struct xen_flask_op {
 #define FLASK_DEL_OCONTEXT      22
 #define FLASK_GET_PEER_SID      23
 #define FLASK_RELABEL_DOMAIN    24
+#define FLASK_DEVICETREE_LABEL  25
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -193,6 +203,7 @@ struct xen_flask_op {
         struct xen_flask_ocontext ocontext;
         struct xen_flask_peersid peersid;
         struct xen_flask_relabel relabel;
+        struct xen_flask_devicetree_label devicetree_label;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 15:11:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 15:11:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6ez-0000cQ-92; Fri, 16 Oct 2015 15:11:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6ey-0000cI-9Y
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 15:11:08 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	0B/90-01753-B8311265; Fri, 16 Oct 2015 15:11:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445008265!53913993!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 24679 invoked from network); 16 Oct 2015 15:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2015 15:11:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6eu-0005xy-JC
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 15:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6eu-0005Db-D4
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 15:11:04 +0000
Message-Id: <E1Zn6eu-0005Db-D4@xenbits.xen.org>
Date: Fri, 16 Oct 2015 15:11:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] split off 3.x interface version
	choice
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1445007865 -7200
# Node ID bdbb8212e3b1e7f67cd5ca552b5ddc0d94c6bd33
# Parent  9a50d064b249f630e9244f2da835f8ec74295521
split off 3.x interface version choice

The single one is getting unwieldy with its many entries.

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


diff -r 9a50d064b249 -r bdbb8212e3b1 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Fri Oct 16 16:49:26 2015 +0200
+++ b/drivers/xen/Kconfig	Fri Oct 16 17:04:25 2015 +0200
@@ -313,25 +313,10 @@ config XEN_SYSFS
 
 choice
 	prompt "Xen version compatibility"
-	default XEN_COMPAT_030002_AND_LATER
+	default XEN_COMPAT_040000_AND_LATER
 
-	config XEN_COMPAT_030002_AND_LATER
-		bool "3.0.2 and later"
-
-	config XEN_COMPAT_030004_AND_LATER
-		bool "3.0.4 and later"
-
-	config XEN_COMPAT_030100_AND_LATER
-		bool "3.1.0 and later"
-
-	config XEN_COMPAT_030200_AND_LATER
-		bool "3.2.0 and later"
-
-	config XEN_COMPAT_030300_AND_LATER
-		bool "3.3.0 and later"
-
-	config XEN_COMPAT_030400_AND_LATER
-		bool "3.4.0 and later"
+	config XEN_COMPAT_3x
+		bool "3.x and later"
 
 	config XEN_COMPAT_040000_AND_LATER
 		bool "4.0.0 and later"
@@ -356,7 +341,30 @@ choice
 
 	config XEN_COMPAT_LATEST_ONLY
 		bool "no compatibility code"
+endchoice
 
+choice
+	prompt "Xen 3.x version compatibility"
+	depends on XEN_COMPAT_3x
+	default XEN_COMPAT_030002_AND_LATER
+
+	config XEN_COMPAT_030002_AND_LATER
+		bool "3.0.2 and later"
+
+	config XEN_COMPAT_030004_AND_LATER
+		bool "3.0.4 and later"
+
+	config XEN_COMPAT_030100_AND_LATER
+		bool "3.1.0 and later"
+
+	config XEN_COMPAT_030200_AND_LATER
+		bool "3.2.0 and later"
+
+	config XEN_COMPAT_030300_AND_LATER
+		bool "3.3.0 and later"
+
+	config XEN_COMPAT_030400_AND_LATER
+		bool "3.4.0 and later"
 endchoice
 
 config XEN_COMPAT

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

From xen-changelog-bounces@lists.xen.org Fri Oct 16 15:11:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2015 15:11:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zn6ez-0000cQ-92; Fri, 16 Oct 2015 15:11:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6ey-0000cI-9Y
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 15:11:08 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	0B/90-01753-B8311265; Fri, 16 Oct 2015 15:11:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445008265!53913993!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 24679 invoked from network); 16 Oct 2015 15:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2015 15:11:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6eu-0005xy-JC
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 15:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Zn6eu-0005Db-D4
	for xen-changelog@lists.xensource.com; Fri, 16 Oct 2015 15:11:04 +0000
Message-Id: <E1Zn6eu-0005Db-D4@xenbits.xen.org>
Date: Fri, 16 Oct 2015 15:11:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] split off 3.x interface version
	choice
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1445007865 -7200
# Node ID bdbb8212e3b1e7f67cd5ca552b5ddc0d94c6bd33
# Parent  9a50d064b249f630e9244f2da835f8ec74295521
split off 3.x interface version choice

The single one is getting unwieldy with its many entries.

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


diff -r 9a50d064b249 -r bdbb8212e3b1 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Fri Oct 16 16:49:26 2015 +0200
+++ b/drivers/xen/Kconfig	Fri Oct 16 17:04:25 2015 +0200
@@ -313,25 +313,10 @@ config XEN_SYSFS
 
 choice
 	prompt "Xen version compatibility"
-	default XEN_COMPAT_030002_AND_LATER
+	default XEN_COMPAT_040000_AND_LATER
 
-	config XEN_COMPAT_030002_AND_LATER
-		bool "3.0.2 and later"
-
-	config XEN_COMPAT_030004_AND_LATER
-		bool "3.0.4 and later"
-
-	config XEN_COMPAT_030100_AND_LATER
-		bool "3.1.0 and later"
-
-	config XEN_COMPAT_030200_AND_LATER
-		bool "3.2.0 and later"
-
-	config XEN_COMPAT_030300_AND_LATER
-		bool "3.3.0 and later"
-
-	config XEN_COMPAT_030400_AND_LATER
-		bool "3.4.0 and later"
+	config XEN_COMPAT_3x
+		bool "3.x and later"
 
 	config XEN_COMPAT_040000_AND_LATER
 		bool "4.0.0 and later"
@@ -356,7 +341,30 @@ choice
 
 	config XEN_COMPAT_LATEST_ONLY
 		bool "no compatibility code"
+endchoice
 
+choice
+	prompt "Xen 3.x version compatibility"
+	depends on XEN_COMPAT_3x
+	default XEN_COMPAT_030002_AND_LATER
+
+	config XEN_COMPAT_030002_AND_LATER
+		bool "3.0.2 and later"
+
+	config XEN_COMPAT_030004_AND_LATER
+		bool "3.0.4 and later"
+
+	config XEN_COMPAT_030100_AND_LATER
+		bool "3.1.0 and later"
+
+	config XEN_COMPAT_030200_AND_LATER
+		bool "3.2.0 and later"
+
+	config XEN_COMPAT_030300_AND_LATER
+		bool "3.3.0 and later"
+
+	config XEN_COMPAT_030400_AND_LATER
+		bool "3.4.0 and later"
 endchoice
 
 config XEN_COMPAT

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03: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 1Zo1CC-000095-1M; Mon, 19 Oct 2015 03:33:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CA-000090-78
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:10 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	1F/5C-28221-57464265; Mon, 19 Oct 2015 03:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1445225587!47955617!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1844 invoked from network); 19 Oct 2015 03:33:08 -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;
	19 Oct 2015 03:33:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1C7-0005a8-6k
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1C6-0003zb-88
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:06 +0000
Date: Mon, 19 Oct 2015 03:33:06 +0000
Message-Id: <E1Zo1C6-0003zb-88@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gitignore: ignore extras/mini-os*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5dfa6eade5da0bccd3c901c0b4614c7c0d5b12b2
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 6 17:44:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:13:26 2015 +0100

    gitignore: ignore extras/mini-os*
    
    The original pattern doesn't handle mini-os-dir-remote.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9ead7c4..91e1430 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,8 +46,7 @@ docs/man5/
 docs/man8/
 docs/pdf/
 docs/txt/
-extras/mini-os
-extras/mini-os-remote
+extras/mini-os*
 install/*
 stubdom/autom4te.cache/
 stubdom/binutils-*
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03: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 1Zo1CC-000095-1M; Mon, 19 Oct 2015 03:33:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CA-000090-78
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:10 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	1F/5C-28221-57464265; Mon, 19 Oct 2015 03:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1445225587!47955617!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1844 invoked from network); 19 Oct 2015 03:33:08 -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;
	19 Oct 2015 03:33:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1C7-0005a8-6k
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1C6-0003zb-88
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:06 +0000
Date: Mon, 19 Oct 2015 03:33:06 +0000
Message-Id: <E1Zo1C6-0003zb-88@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gitignore: ignore extras/mini-os*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5dfa6eade5da0bccd3c901c0b4614c7c0d5b12b2
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 6 17:44:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:13:26 2015 +0100

    gitignore: ignore extras/mini-os*
    
    The original pattern doesn't handle mini-os-dir-remote.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9ead7c4..91e1430 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,8 +46,7 @@ docs/man5/
 docs/man8/
 docs/pdf/
 docs/txt/
-extras/mini-os
-extras/mini-os-remote
+extras/mini-os*
 install/*
 stubdom/autom4te.cache/
 stubdom/binutils-*
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:33:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1CM-00009X-4q; Mon, 19 Oct 2015 03:33:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CL-00009Q-4Z
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:21 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	3C/68-12946-08464265; Mon, 19 Oct 2015 03:33:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445225598!54304683!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29550 invoked from network); 19 Oct 2015 03:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:33:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CI-0005aC-Hf
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CH-000408-Go
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:17 +0000
Date: Mon, 19 Oct 2015 03:33:17 +0000
Message-Id: <E1Zo1CH-000408-Go@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: psci: use SMC64 function ID
	when available on ARM64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 75c7de56df16a5a77d655b9f3e32ea00b103a0e1
Author:     Brijesh Singh <brijeshkumar.singh@amd.com>
AuthorDate: Mon Oct 5 11:38:39 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:16:16 2015 +0100

    xen/arm: psci: use SMC64 function ID when available on ARM64
    
    As per PSCI 0.2 spec, if CPU_ON entry_point_address is 64-bit then SMC
    call function ID parameter should be set to SMC64 version.
    
    Signed-off-by: Brijesh Singh <brijeshkumar.singh@amd.com>
    Reviewed-by: Julien grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/psci.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 7ad6a43..172c6e7 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -23,6 +23,18 @@
 #include <xen/smp.h>
 #include <asm/psci.h>
 
+/*
+ * While a 64-bit OS can make calls with SMC32 calling conventions, for
+ * some calls it is necessary to use SMC64 to pass or return 64-bit values.
+ * For such calls PSCI_0_2_FN_NATIVE(x) will choose the appropriate
+ * (native-width) function ID.
+ */
+#ifdef CONFIG_ARM_64
+#define PSCI_0_2_FN_NATIVE(name)	PSCI_0_2_FN64_##name
+#else
+#define PSCI_0_2_FN_NATIVE(name)	PSCI_0_2_FN_##name
+#endif
+
 uint32_t psci_ver;
 
 static uint32_t psci_cpu_on_nr;
@@ -116,7 +128,7 @@ int __init psci_init_0_2(void)
         return -EOPNOTSUPP;
     }
 
-    psci_cpu_on_nr = PSCI_0_2_FN_CPU_ON;
+    psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(CPU_ON);
 
     printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:33:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1CM-00009X-4q; Mon, 19 Oct 2015 03:33:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CL-00009Q-4Z
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:21 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	3C/68-12946-08464265; Mon, 19 Oct 2015 03:33:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445225598!54304683!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29550 invoked from network); 19 Oct 2015 03:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:33:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CI-0005aC-Hf
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CH-000408-Go
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:17 +0000
Date: Mon, 19 Oct 2015 03:33:17 +0000
Message-Id: <E1Zo1CH-000408-Go@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: psci: use SMC64 function ID
	when available on ARM64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 75c7de56df16a5a77d655b9f3e32ea00b103a0e1
Author:     Brijesh Singh <brijeshkumar.singh@amd.com>
AuthorDate: Mon Oct 5 11:38:39 2015 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:16:16 2015 +0100

    xen/arm: psci: use SMC64 function ID when available on ARM64
    
    As per PSCI 0.2 spec, if CPU_ON entry_point_address is 64-bit then SMC
    call function ID parameter should be set to SMC64 version.
    
    Signed-off-by: Brijesh Singh <brijeshkumar.singh@amd.com>
    Reviewed-by: Julien grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/psci.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 7ad6a43..172c6e7 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -23,6 +23,18 @@
 #include <xen/smp.h>
 #include <asm/psci.h>
 
+/*
+ * While a 64-bit OS can make calls with SMC32 calling conventions, for
+ * some calls it is necessary to use SMC64 to pass or return 64-bit values.
+ * For such calls PSCI_0_2_FN_NATIVE(x) will choose the appropriate
+ * (native-width) function ID.
+ */
+#ifdef CONFIG_ARM_64
+#define PSCI_0_2_FN_NATIVE(name)	PSCI_0_2_FN64_##name
+#else
+#define PSCI_0_2_FN_NATIVE(name)	PSCI_0_2_FN_##name
+#endif
+
 uint32_t psci_ver;
 
 static uint32_t psci_cpu_on_nr;
@@ -116,7 +128,7 @@ int __init psci_init_0_2(void)
         return -EOPNOTSUPP;
     }
 
-    psci_cpu_on_nr = PSCI_0_2_FN_CPU_ON;
+    psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(CPU_ON);
 
     printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:33:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:33: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 1Zo1CX-0000Ap-8A; Mon, 19 Oct 2015 03:33:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CV-0000AY-KV
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:31 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	8A/78-12946-A8464265; Mon, 19 Oct 2015 03:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445225609!19684998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31104 invoked from network); 19 Oct 2015 03:33:29 -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;
	19 Oct 2015 03:33:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CS-0005aO-R5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CS-00040m-Nq
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:28 +0000
Date: Mon, 19 Oct 2015 03:33:28 +0000
Message-Id: <E1Zo1CS-00040m-Nq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MINIOS_UPSTREAM_REVISION Update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f9dfe68084a5e15cf8e5ea71e67e73f896e1101
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Oct 7 12:18:10 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:18:10 2015 +0100

    MINIOS_UPSTREAM_REVISION Update
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index a1d515f..0e5b51b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= b36bcb370d611ad7f41e8c21d061e6291e088c58
-# Fri Jun 26 11:58:40 2015 +0100
-# Correct printf formatting for tpm_tis message.
+MINIOS_UPSTREAM_REVISION ?= 256035e01a1aa5739e34f245f3b1e9e8ee204210
+# Thu Jul 23 11:08:38 2015 +0100
+# arm: interrupt controller
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 # Tue Mar 17 10:52:16 2015 -0400
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:33:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:33: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 1Zo1CX-0000Ap-8A; Mon, 19 Oct 2015 03:33:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CV-0000AY-KV
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:31 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	8A/78-12946-A8464265; Mon, 19 Oct 2015 03:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445225609!19684998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31104 invoked from network); 19 Oct 2015 03:33:29 -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;
	19 Oct 2015 03:33:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CS-0005aO-R5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1CS-00040m-Nq
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:28 +0000
Date: Mon, 19 Oct 2015 03:33:28 +0000
Message-Id: <E1Zo1CS-00040m-Nq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MINIOS_UPSTREAM_REVISION Update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f9dfe68084a5e15cf8e5ea71e67e73f896e1101
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Oct 7 12:18:10 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:18:10 2015 +0100

    MINIOS_UPSTREAM_REVISION Update
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index a1d515f..0e5b51b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= b36bcb370d611ad7f41e8c21d061e6291e088c58
-# Fri Jun 26 11:58:40 2015 +0100
-# Correct printf formatting for tpm_tis message.
+MINIOS_UPSTREAM_REVISION ?= 256035e01a1aa5739e34f245f3b1e9e8ee204210
+# Thu Jul 23 11:08:38 2015 +0100
+# arm: interrupt controller
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 # Tue Mar 17 10:52:16 2015 -0400
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:33:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1Cg-0000Cp-Pd; Mon, 19 Oct 2015 03:33:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cf-0000CV-RX
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:42 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	93/70-18744-59464265; Mon, 19 Oct 2015 03:33:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1445225619!59335475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14853 invoked from network); 19 Oct 2015 03:33:40 -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;
	19 Oct 2015 03:33:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cd-0005ab-6M
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cd-00041X-2V
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:39 +0000
Date: Mon, 19 Oct 2015 03:33:39 +0000
Message-Id: <E1Zo1Cd-00041X-2V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: Scan xenstore once when
	attaching shared images files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d76add5b4bf37dd5083e61cc40734d913cd6553f
Author:     Mike Latimer <mlatimer@suse.com>
AuthorDate: Fri Oct 2 08:09:32 2015 -0600
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:23:51 2015 +0100

    tools/hotplug: Scan xenstore once when attaching shared images files
    
    During the attachment of a loopback mounted image file, the mode of all
    curent instances of this device already attached to other domains must be
    checked. This requires finding all loopback devices pointing to the inode
    of the shared image file, and then comparing the major and minor number of
    these devices to the major and minor number of every vbd device found in the
    xenstore database.
    
    Prior to this patch, the entire xenstore database is walked for every instance
    of every loopback device pointing to the same shared image file. This process
    causes the block attachment process to becomes exponentially slower with every
    additional attachment of a shared image.
    
    Rather than scanning all of xenstore for every instance of a shared loopback
    device, this patch creates a list of the major and minor numbers from all
    matching loopback devices. After generating this list, Xenstore is walked
    once, and major and minor numbers from every vbd are checked against the list.
    If a match is found, the mode of that vbd is checked for compatibility with
    the mode of the device being attached.
    
    Signed-off-by: Mike Latimer <mlatimer@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/hotplug/Linux/block |   89 +++++++++++++++++++++++++++++----------------
 1 files changed, 57 insertions(+), 32 deletions(-)

diff --git a/tools/hotplug/Linux/block b/tools/hotplug/Linux/block
index 8d2ee9d..2691b56 100644
--- a/tools/hotplug/Linux/block
+++ b/tools/hotplug/Linux/block
@@ -38,7 +38,7 @@ find_free_loopback_dev() {
 }
 
 ##
-# check_sharing device mode
+# check_sharing devtype device mode [inode]
 #
 # Check whether the device requested is already in use.  To use the device in
 # read-only mode, it may be in use in read-only mode, but may not be in use in
@@ -47,19 +47,44 @@ find_free_loopback_dev() {
 #
 # Prints one of
 #
-#    'local': the device may not be used because it is mounted in the current
-#             (i.e. the privileged domain) in a way incompatible with the
-#             requested mode;
-#    'guest': the device may not be used because it already mounted by a guest
-#             in a way incompatible with the requested mode; or
-#    'ok':    the device may be used.
+#    'local $d': the device ($d) may not be used because it is mounted in the
+#                current (i.e. the privileged domain) in a way incompatible
+#                with the requested mode;
+#    'guest $d': the device may not be used because it is already mounted
+#                through device $d by a guest in a way incompatible with the
+#                requested mode; or
+#    'ok':       the device may be used.
 #
 check_sharing()
 {
-  local dev="$1"
-  local mode="$2"
+  local devtype=$1
+  local dev="$2"
+  local mode="$3"
+  local devmm=","
+
+  if [ "$devtype" = "file" ];
+  then
+    local inode="$4"
+
+    shared_list=$(losetup -a |
+          sed -n -e "s@^\([^:]\+\)\(:[[:blank:]]\[0*${dev}\]:${inode}[[:blank:]](.*)\)@\1@p" )
+    for dev in $shared_list
+    do
+      if [ -n "$dev" ]
+      then
+        devmm="${devmm}$(device_major_minor $dev),"
+      fi
+    done
+    # if $devmm is unchanged, file being checked is not a shared loopback device
+    if [ "$devmm" = "," ];
+    then
+      echo 'ok'
+      return
+    fi
+  else
+    devmm=${devmm}$(device_major_minor "$dev")","
+  fi
 
-  local devmm=$(device_major_minor "$dev")
   local file
 
   if [ "$mode" = 'w' ]
@@ -75,9 +100,10 @@ check_sharing()
     then
       local d=$(device_major_minor "$file")
 
-      if [ "$d" = "$devmm" ]
+      # checking for $d in $devmm is best through the [[...]] bashism
+      if [[ "$devmm" == *",$d,"* ]]
       then
-        echo 'local'
+        echo "local $d"
         return
       fi
     fi
@@ -90,13 +116,14 @@ check_sharing()
     do
       d=$(xenstore_read_default "$base_path/$dom/$dev/physical-device" "")
 
-      if [ "$d" = "$devmm" ]
+      # checking for $d in $devmm is best through the [[...]] bashism
+      if [ -n "$d" ] && [[ "$devmm" == *",$d,"* ]]
       then
         if [ "$mode" = 'w' ]
         then
           if ! same_vm $dom
           then
-            echo 'guest'
+            echo "guest $d"
             return
           fi
         else
@@ -107,7 +134,7 @@ check_sharing()
           then
             if ! same_vm $dom
             then
-              echo 'guest'
+              echo "guest $d"
               return
             fi
           fi
@@ -129,6 +156,7 @@ check_device_sharing()
 {
   local dev="$1"
   local mode=$(canonicalise_mode "$2")
+  local type="device"
   local result
 
   if [ "x$mode" = 'x!' ]
@@ -136,33 +164,38 @@ check_device_sharing()
     return 0
   fi
 
-  result=$(check_sharing "$dev" "$mode")
+  result=$(check_sharing "$type" "$dev" "$mode")
 
   if [ "$result" != 'ok' ]
   then
-    do_ebusy "Device $dev is mounted " "$mode" "$result"
+    do_ebusy "Device $dev is mounted " "$mode" "${result%% *}"
   fi
 }
 
 
 ##
-# check_device_sharing file dev mode
+# check_device_sharing file dev mode inode
 #
-# Perform the sharing check for the given file mounted through the given
-# loopback interface, in the given mode.
+# Perform the sharing check for the given file, with its corresponding
+# device, inode and mode. As the file can be mounted multiple times,
+# the inode is passed through to check_sharing for all instances to be
+# checked.
 #
 check_file_sharing()
 {
   local file="$1"
   local dev="$2"
   local mode="$3"
+  local inode="$4"
+  local type="file"
+  local result
 
-  result=$(check_sharing "$dev" "$mode")
+  result=$(check_sharing "$type" "$dev" "$mode" "$inode")
 
   if [ "$result" != 'ok' ]
   then
-    do_ebusy "File $file is loopback-mounted through $dev,
-which is mounted " "$mode" "$result"
+    do_ebusy "File $file is loopback-mounted through ${result#* },
+which is mounted " "$mode" "${result%% *}"
   fi
 }
 
@@ -281,15 +314,7 @@ mount it read-write in a guest domain."
             fatal "Unable to lookup $file: dev: $dev inode: $inode"
           fi
 
-          shared_list=$(losetup -a |
-                sed -n -e "s@^\([^:]\+\)\(:[[:blank:]]\[0*${dev}\]:${inode}[[:blank:]](.*)\)@\1@p" )
-          for dev in $shared_list
-          do
-            if [ -n "$dev" ]
-            then
-              check_file_sharing "$file" "$dev" "$mode"
-            fi
-          done
+          check_file_sharing "$file" "$dev" "$mode" "$inode"
         fi
 
         loopdev=$(losetup -f 2>/dev/null || find_free_loopback_dev)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:33:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1Cg-0000Cp-Pd; Mon, 19 Oct 2015 03:33:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cf-0000CV-RX
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:42 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	93/70-18744-59464265; Mon, 19 Oct 2015 03:33:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1445225619!59335475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14853 invoked from network); 19 Oct 2015 03:33:40 -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;
	19 Oct 2015 03:33:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cd-0005ab-6M
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cd-00041X-2V
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:39 +0000
Date: Mon, 19 Oct 2015 03:33:39 +0000
Message-Id: <E1Zo1Cd-00041X-2V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: Scan xenstore once when
	attaching shared images files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d76add5b4bf37dd5083e61cc40734d913cd6553f
Author:     Mike Latimer <mlatimer@suse.com>
AuthorDate: Fri Oct 2 08:09:32 2015 -0600
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:23:51 2015 +0100

    tools/hotplug: Scan xenstore once when attaching shared images files
    
    During the attachment of a loopback mounted image file, the mode of all
    curent instances of this device already attached to other domains must be
    checked. This requires finding all loopback devices pointing to the inode
    of the shared image file, and then comparing the major and minor number of
    these devices to the major and minor number of every vbd device found in the
    xenstore database.
    
    Prior to this patch, the entire xenstore database is walked for every instance
    of every loopback device pointing to the same shared image file. This process
    causes the block attachment process to becomes exponentially slower with every
    additional attachment of a shared image.
    
    Rather than scanning all of xenstore for every instance of a shared loopback
    device, this patch creates a list of the major and minor numbers from all
    matching loopback devices. After generating this list, Xenstore is walked
    once, and major and minor numbers from every vbd are checked against the list.
    If a match is found, the mode of that vbd is checked for compatibility with
    the mode of the device being attached.
    
    Signed-off-by: Mike Latimer <mlatimer@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/hotplug/Linux/block |   89 +++++++++++++++++++++++++++++----------------
 1 files changed, 57 insertions(+), 32 deletions(-)

diff --git a/tools/hotplug/Linux/block b/tools/hotplug/Linux/block
index 8d2ee9d..2691b56 100644
--- a/tools/hotplug/Linux/block
+++ b/tools/hotplug/Linux/block
@@ -38,7 +38,7 @@ find_free_loopback_dev() {
 }
 
 ##
-# check_sharing device mode
+# check_sharing devtype device mode [inode]
 #
 # Check whether the device requested is already in use.  To use the device in
 # read-only mode, it may be in use in read-only mode, but may not be in use in
@@ -47,19 +47,44 @@ find_free_loopback_dev() {
 #
 # Prints one of
 #
-#    'local': the device may not be used because it is mounted in the current
-#             (i.e. the privileged domain) in a way incompatible with the
-#             requested mode;
-#    'guest': the device may not be used because it already mounted by a guest
-#             in a way incompatible with the requested mode; or
-#    'ok':    the device may be used.
+#    'local $d': the device ($d) may not be used because it is mounted in the
+#                current (i.e. the privileged domain) in a way incompatible
+#                with the requested mode;
+#    'guest $d': the device may not be used because it is already mounted
+#                through device $d by a guest in a way incompatible with the
+#                requested mode; or
+#    'ok':       the device may be used.
 #
 check_sharing()
 {
-  local dev="$1"
-  local mode="$2"
+  local devtype=$1
+  local dev="$2"
+  local mode="$3"
+  local devmm=","
+
+  if [ "$devtype" = "file" ];
+  then
+    local inode="$4"
+
+    shared_list=$(losetup -a |
+          sed -n -e "s@^\([^:]\+\)\(:[[:blank:]]\[0*${dev}\]:${inode}[[:blank:]](.*)\)@\1@p" )
+    for dev in $shared_list
+    do
+      if [ -n "$dev" ]
+      then
+        devmm="${devmm}$(device_major_minor $dev),"
+      fi
+    done
+    # if $devmm is unchanged, file being checked is not a shared loopback device
+    if [ "$devmm" = "," ];
+    then
+      echo 'ok'
+      return
+    fi
+  else
+    devmm=${devmm}$(device_major_minor "$dev")","
+  fi
 
-  local devmm=$(device_major_minor "$dev")
   local file
 
   if [ "$mode" = 'w' ]
@@ -75,9 +100,10 @@ check_sharing()
     then
       local d=$(device_major_minor "$file")
 
-      if [ "$d" = "$devmm" ]
+      # checking for $d in $devmm is best through the [[...]] bashism
+      if [[ "$devmm" == *",$d,"* ]]
       then
-        echo 'local'
+        echo "local $d"
         return
       fi
     fi
@@ -90,13 +116,14 @@ check_sharing()
     do
       d=$(xenstore_read_default "$base_path/$dom/$dev/physical-device" "")
 
-      if [ "$d" = "$devmm" ]
+      # checking for $d in $devmm is best through the [[...]] bashism
+      if [ -n "$d" ] && [[ "$devmm" == *",$d,"* ]]
       then
         if [ "$mode" = 'w' ]
         then
           if ! same_vm $dom
           then
-            echo 'guest'
+            echo "guest $d"
             return
           fi
         else
@@ -107,7 +134,7 @@ check_sharing()
           then
             if ! same_vm $dom
             then
-              echo 'guest'
+              echo "guest $d"
               return
             fi
           fi
@@ -129,6 +156,7 @@ check_device_sharing()
 {
   local dev="$1"
   local mode=$(canonicalise_mode "$2")
+  local type="device"
   local result
 
   if [ "x$mode" = 'x!' ]
@@ -136,33 +164,38 @@ check_device_sharing()
     return 0
   fi
 
-  result=$(check_sharing "$dev" "$mode")
+  result=$(check_sharing "$type" "$dev" "$mode")
 
   if [ "$result" != 'ok' ]
   then
-    do_ebusy "Device $dev is mounted " "$mode" "$result"
+    do_ebusy "Device $dev is mounted " "$mode" "${result%% *}"
   fi
 }
 
 
 ##
-# check_device_sharing file dev mode
+# check_device_sharing file dev mode inode
 #
-# Perform the sharing check for the given file mounted through the given
-# loopback interface, in the given mode.
+# Perform the sharing check for the given file, with its corresponding
+# device, inode and mode. As the file can be mounted multiple times,
+# the inode is passed through to check_sharing for all instances to be
+# checked.
 #
 check_file_sharing()
 {
   local file="$1"
   local dev="$2"
   local mode="$3"
+  local inode="$4"
+  local type="file"
+  local result
 
-  result=$(check_sharing "$dev" "$mode")
+  result=$(check_sharing "$type" "$dev" "$mode" "$inode")
 
   if [ "$result" != 'ok' ]
   then
-    do_ebusy "File $file is loopback-mounted through $dev,
-which is mounted " "$mode" "$result"
+    do_ebusy "File $file is loopback-mounted through ${result#* },
+which is mounted " "$mode" "${result%% *}"
   fi
 }
 
@@ -281,15 +314,7 @@ mount it read-write in a guest domain."
             fatal "Unable to lookup $file: dev: $dev inode: $inode"
           fi
 
-          shared_list=$(losetup -a |
-                sed -n -e "s@^\([^:]\+\)\(:[[:blank:]]\[0*${dev}\]:${inode}[[:blank:]](.*)\)@\1@p" )
-          for dev in $shared_list
-          do
-            if [ -n "$dev" ]
-            then
-              check_file_sharing "$file" "$dev" "$mode"
-            fi
-          done
+          check_file_sharing "$file" "$dev" "$mode" "$inode"
         fi
 
         loopdev=$(losetup -f 2>/dev/null || find_free_loopback_dev)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:33:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1Cr-0000EY-SG; Mon, 19 Oct 2015 03:33:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cr-0000EL-8J
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:53 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	34/39-16965-0A464265; Mon, 19 Oct 2015 03:33:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445225629!54172075!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15891 invoked from network); 19 Oct 2015 03:33:50 -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;
	19 Oct 2015 03:33:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cn-0005aj-H7
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cn-000430-EV
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:49 +0000
Date: Mon, 19 Oct 2015 03:33:49 +0000
Message-Id: <E1Zo1Cn-000430-EV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: xl.cfg: permissive option is not
	PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f25baba1c0942e50757f4ecb233202dbbc057b9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:25:11 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index f8fa48f..b63846a 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -752,14 +752,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -798,9 +801,8 @@ Note this would override global B<rdm> option.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:33:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1Cr-0000EY-SG; Mon, 19 Oct 2015 03:33:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cr-0000EL-8J
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:53 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	34/39-16965-0A464265; Mon, 19 Oct 2015 03:33:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445225629!54172075!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15891 invoked from network); 19 Oct 2015 03:33:50 -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;
	19 Oct 2015 03:33:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cn-0005aj-H7
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cn-000430-EV
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:49 +0000
Date: Mon, 19 Oct 2015 03:33:49 +0000
Message-Id: <E1Zo1Cn-000430-EV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: xl.cfg: permissive option is not
	PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f25baba1c0942e50757f4ecb233202dbbc057b9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:25:11 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index f8fa48f..b63846a 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -752,14 +752,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -798,9 +801,8 @@ Note this would override global B<rdm> option.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:34:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34: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 1Zo1D1-0000H2-Uu; Mon, 19 Oct 2015 03:34: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 1Zo1D0-0000Gd-T4
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:03 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	24/61-00475-AA464265; Mon, 19 Oct 2015 03:34:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1445225640!59389886!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 16754 invoked from network); 19 Oct 2015 03:34:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:34:00 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cx-0005ar-SN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cx-000442-QM
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:59 +0000
Date: Mon, 19 Oct 2015 03:33:59 +0000
Message-Id: <E1Zo1Cx-000442-QM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Improve efficiency of
	xc_cpuid_apply_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 bf87f3a24f25eb3628dfb62a2d0ce3802a09783b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 5 14:12:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:26:25 2015 +0100

    tools/libxc: Improve efficiency of xc_cpuid_apply_policy()
    
    Having the internals of xc_cpuid_policy() make hypercalls to collect domain
    information causes xc_cpuid_apply_policy() to be very inefficient.
    
    Re-order operations to collect all information at once at the outermost layer,
    and pass a structure in to all cpuid policy generation functions.
    
    This removes several hypercalls (4 from HVM, 3 from PV) for each of the
    up-to 108 leaves processed.
    
    No change in the eventual policy provided, although all the information
    gathering how has (or has correct) error checking.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_cpuid_x86.c |  245 +++++++++++++++++++++++++-------------------
 1 files changed, 141 insertions(+), 104 deletions(-)

diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index e146a3e..031c848 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -33,6 +33,27 @@
 #define DEF_MAX_INTELEXT  0x80000008u
 #define DEF_MAX_AMDEXT    0x8000001cu
 
+struct cpuid_domain_info
+{
+    enum
+    {
+        VENDOR_UNKNOWN,
+        VENDOR_INTEL,
+        VENDOR_AMD,
+    } vendor;
+
+    bool hvm;
+    bool pvh;
+    uint64_t xfeature_mask;
+
+    /* PV-only information. */
+    bool pv64;
+
+    /* HVM-only information. */
+    bool pae;
+    bool nestedhvm;
+};
+
 static void cpuid(const unsigned int *input, unsigned int *regs)
 {
     unsigned int count = (input[1] == XEN_CPUID_INPUT_UNUSED) ? 0 : input[1];
@@ -55,24 +76,75 @@ static void cpuid(const unsigned int *input, unsigned int *regs)
 #endif
 }
 
-/* Get the manufacturer brand name of the host processor. */
-static void xc_cpuid_brand_get(char *str)
+static int get_cpuid_domain_info(xc_interface *xch, domid_t domid,
+                                 struct cpuid_domain_info *info)
 {
-    unsigned int input[2] = { 0, 0 };
-    unsigned int regs[4];
+    struct xen_domctl domctl = {};
+    xc_dominfo_t di;
+    unsigned int in[2] = { 0, ~0U }, regs[4];
+    int rc;
 
-    cpuid(input, regs);
+    cpuid(in, regs);
+    if ( regs[1] == 0x756e6547U &&      /* "GenuineIntel" */
+         regs[2] == 0x6c65746eU &&
+         regs[3] == 0x49656e69U )
+        info->vendor = VENDOR_INTEL;
+    else if ( regs[1] == 0x68747541U && /* "AuthenticAMD" */
+              regs[2] == 0x444d4163U &&
+              regs[3] == 0x69746e65U )
+        info->vendor = VENDOR_AMD;
+    else
+        info->vendor = VENDOR_UNKNOWN;
+
+    if ( xc_domain_getinfo(xch, domid, 1, &di) != 1 ||
+         di.domid != domid )
+        return -ESRCH;
+
+    info->hvm = di.hvm;
+    info->pvh = di.pvh;
+
+    /* Get xstate information. */
+    domctl.cmd = XEN_DOMCTL_getvcpuextstate;
+    domctl.domain = domid;
+    rc = do_domctl(xch, &domctl);
+    if ( rc )
+        return rc;
+
+    info->xfeature_mask = domctl.u.vcpuextstate.xfeature_mask;
+
+    if ( di.hvm )
+    {
+        uint64_t val;
+
+        rc = xc_hvm_param_get(xch, domid, HVM_PARAM_PAE_ENABLED, &val);
+        if ( rc )
+            return rc;
+
+        info->pae = !!val;
+
+        rc = xc_hvm_param_get(xch, domid, HVM_PARAM_NESTEDHVM, &val);
+        if ( rc )
+            return rc;
+
+        info->nestedhvm = !!val;
+    }
+    else
+    {
+        unsigned int width;
+
+        rc = xc_domain_get_guest_width(xch, domid, &width);
+        if ( rc )
+            return rc;
+
+        info->pv64 = (width == 8);
+    }
 
-    *(uint32_t *)(str + 0) = regs[1];
-    *(uint32_t *)(str + 4) = regs[3];
-    *(uint32_t *)(str + 8) = regs[2];
-    str[12] = '\0';
+    return 0;
 }
 
-static void amd_xc_cpuid_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs,
-    int is_pae, int is_nestedhvm)
+static void amd_xc_cpuid_policy(xc_interface *xch,
+                                const struct cpuid_domain_info *info,
+                                const unsigned int *input, unsigned int *regs)
 {
     switch ( input[0] )
     {
@@ -87,13 +159,13 @@ static void amd_xc_cpuid_policy(
         break;
 
     case 0x80000001: {
-        if ( !is_pae )
+        if ( !info->pae )
             clear_bit(X86_FEATURE_PAE, regs[3]);
 
         /* Filter all other features according to a whitelist. */
         regs[2] &= (bitmaskof(X86_FEATURE_LAHF_LM) |
                     bitmaskof(X86_FEATURE_CMP_LEGACY) |
-                    (is_nestedhvm ? bitmaskof(X86_FEATURE_SVM) : 0) |
+                    (info->nestedhvm ? bitmaskof(X86_FEATURE_SVM) : 0) |
                     bitmaskof(X86_FEATURE_CR8_LEGACY) |
                     bitmaskof(X86_FEATURE_ABM) |
                     bitmaskof(X86_FEATURE_SSE4A) |
@@ -127,7 +199,8 @@ static void amd_xc_cpuid_policy(
         break;
 
     case 0x8000000a: {
-        if (!is_nestedhvm) {
+        if ( !info->nestedhvm )
+        {
             regs[0] = regs[1] = regs[2] = regs[3] = 0;
             break;
         }
@@ -157,16 +230,15 @@ static void amd_xc_cpuid_policy(
     }
 }
 
-static void intel_xc_cpuid_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs,
-    int is_pae, int is_nestedhvm)
+static void intel_xc_cpuid_policy(xc_interface *xch,
+                                  const struct cpuid_domain_info *info,
+                                  const unsigned int *input, unsigned int *regs)
 {
     switch ( input[0] )
     {
     case 0x00000001:
         /* ECX[5] is availability of VMX */
-        if (is_nestedhvm)
+        if ( info->nestedhvm )
             set_bit(X86_FEATURE_VMXE, regs[2]);
         break;
 
@@ -211,11 +283,11 @@ static void intel_xc_cpuid_policy(
 
 #define XSAVEOPT        (1 << 0)
 /* Configure extended state enumeration leaves (0x0000000D for xsave) */
-static void xc_cpuid_config_xsave(
-    xc_interface *xch, domid_t domid, uint64_t xfeature_mask,
-    const unsigned int *input, unsigned int *regs)
+static void xc_cpuid_config_xsave(xc_interface *xch,
+                                  const struct cpuid_domain_info *info,
+                                  const unsigned int *input, unsigned int *regs)
 {
-    if ( xfeature_mask == 0 )
+    if ( info->xfeature_mask == 0 )
     {
         regs[0] = regs[1] = regs[2] = regs[3] = 0;
         return;
@@ -225,9 +297,9 @@ static void xc_cpuid_config_xsave(
     {
     case 0: 
         /* EAX: low 32bits of xfeature_enabled_mask */
-        regs[0] = xfeature_mask & 0xFFFFFFFF;
+        regs[0] = info->xfeature_mask & 0xFFFFFFFF;
         /* EDX: high 32bits of xfeature_enabled_mask */
-        regs[3] = (xfeature_mask >> 32) & 0xFFFFFFFF;
+        regs[3] = (info->xfeature_mask >> 32) & 0xFFFFFFFF;
         /* ECX: max size required by all HW features */
         {
             unsigned int _input[2] = {0xd, 0x0}, _regs[4];
@@ -250,7 +322,7 @@ static void xc_cpuid_config_xsave(
         regs[1] = regs[2] = regs[3] = 0;
         break;
     case 2 ... 63: /* sub-leaves */
-        if ( !(xfeature_mask & (1ULL << input[1])) )
+        if ( !(info->xfeature_mask & (1ULL << input[1])) )
         {
             regs[0] = regs[1] = regs[2] = regs[3] = 0;
             break;
@@ -261,29 +333,10 @@ static void xc_cpuid_config_xsave(
     }
 }
 
-static void xc_cpuid_hvm_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs)
+static void xc_cpuid_hvm_policy(xc_interface *xch,
+                                const struct cpuid_domain_info *info,
+                                const unsigned int *input, unsigned int *regs)
 {
-    DECLARE_DOMCTL;
-    char brand[13];
-    uint64_t val;
-    int is_pae, is_nestedhvm;
-    uint64_t xfeature_mask;
-
-    xc_hvm_param_get(xch, domid, HVM_PARAM_PAE_ENABLED, &val);
-    is_pae = !!val;
-
-    /* Detecting Xen's atitude towards XSAVE */
-    memset(&domctl, 0, sizeof(domctl));
-    domctl.cmd = XEN_DOMCTL_getvcpuextstate;
-    domctl.domain = domid;
-    do_domctl(xch, &domctl);
-    xfeature_mask = domctl.u.vcpuextstate.xfeature_mask;
-
-    xc_hvm_param_get(xch, domid, HVM_PARAM_NESTEDHVM, &val);
-    is_nestedhvm = !!val;
-
     switch ( input[0] )
     {
     case 0x00000000:
@@ -311,7 +364,7 @@ static void xc_cpuid_hvm_policy(
                     bitmaskof(X86_FEATURE_AES) |
                     bitmaskof(X86_FEATURE_F16C) |
                     bitmaskof(X86_FEATURE_RDRAND) |
-                    ((xfeature_mask != 0) ?
+                    ((info->xfeature_mask != 0) ?
                      (bitmaskof(X86_FEATURE_AVX) |
                       bitmaskof(X86_FEATURE_XSAVE)) : 0));
 
@@ -346,7 +399,8 @@ static void xc_cpuid_hvm_policy(
         /* We always support MTRR MSRs. */
         regs[3] |= bitmaskof(X86_FEATURE_MTRR);
 
-        if ( !is_pae ) {
+        if ( !info->pae )
+        {
             clear_bit(X86_FEATURE_PAE, regs[3]);
             clear_bit(X86_FEATURE_PSE36, regs[3]);
         }
@@ -373,7 +427,7 @@ static void xc_cpuid_hvm_policy(
         break;
 
     case 0x0000000d:
-        xc_cpuid_config_xsave(xch, domid, xfeature_mask, input, regs);
+        xc_cpuid_config_xsave(xch, info, input, regs);
         break;
 
     case 0x80000000:
@@ -381,7 +435,7 @@ static void xc_cpuid_hvm_policy(
         break;
 
     case 0x80000001:
-        if ( !is_pae )
+        if ( !info->pae )
         {
             clear_bit(X86_FEATURE_LAHF_LM, regs[2]);
             clear_bit(X86_FEATURE_LM, regs[3]);
@@ -422,40 +476,21 @@ static void xc_cpuid_hvm_policy(
         break;
     }
 
-    xc_cpuid_brand_get(brand);
-    if ( strstr(brand, "AMD") )
-        amd_xc_cpuid_policy(xch, domid, input, regs, is_pae, is_nestedhvm);
+    if ( info->vendor == VENDOR_AMD )
+        amd_xc_cpuid_policy(xch, info, input, regs);
     else
-        intel_xc_cpuid_policy(xch, domid, input, regs, is_pae, is_nestedhvm);
-
+        intel_xc_cpuid_policy(xch, info, input, regs);
 }
 
-static void xc_cpuid_pv_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs, bool pvh)
+static void xc_cpuid_pv_policy(xc_interface *xch,
+                               const struct cpuid_domain_info *info,
+                               const unsigned int *input, unsigned int *regs)
 {
-    DECLARE_DOMCTL;
-    unsigned int guest_width;
-    int guest_64bit;
-    char brand[13];
-    uint64_t xfeature_mask;
-
-    xc_cpuid_brand_get(brand);
-
-    xc_domain_get_guest_width(xch, domid, &guest_width);
-    guest_64bit = (guest_width == 8);
-
-    /* Detecting Xen's atitude towards XSAVE */
-    memset(&domctl, 0, sizeof(domctl));
-    domctl.cmd = XEN_DOMCTL_getvcpuextstate;
-    domctl.domain = domid;
-    do_domctl(xch, &domctl);
-    xfeature_mask = domctl.u.vcpuextstate.xfeature_mask;
-
     if ( (input[0] & 0x7fffffff) == 0x00000001 )
     {
         clear_bit(X86_FEATURE_VME, regs[3]);
-        if ( !pvh ) {
+        if ( !info->pvh )
+        {
             clear_bit(X86_FEATURE_PSE, regs[3]);
             clear_bit(X86_FEATURE_PGE, regs[3]);
         }
@@ -468,7 +503,7 @@ static void xc_cpuid_pv_policy(
     switch ( input[0] )
     {
     case 0x00000001:
-        if ( strstr(brand, "AMD") )
+        if ( info->vendor == VENDOR_AMD )
             clear_bit(X86_FEATURE_SEP, regs[3]);
         clear_bit(X86_FEATURE_DS, regs[3]);
         clear_bit(X86_FEATURE_ACC, regs[3]);
@@ -481,9 +516,9 @@ static void xc_cpuid_pv_policy(
         clear_bit(X86_FEATURE_SMXE, regs[2]);
         clear_bit(X86_FEATURE_EST, regs[2]);
         clear_bit(X86_FEATURE_TM2, regs[2]);
-        if ( !guest_64bit )
+        if ( !info->pv64 )
             clear_bit(X86_FEATURE_CX16, regs[2]);
-        if ( xfeature_mask == 0 )
+        if ( info->xfeature_mask == 0 )
         {
             clear_bit(X86_FEATURE_XSAVE, regs[2]);
             clear_bit(X86_FEATURE_AVX, regs[2]);
@@ -512,22 +547,22 @@ static void xc_cpuid_pv_policy(
         break;
 
     case 0x0000000d:
-        xc_cpuid_config_xsave(xch, domid, xfeature_mask, input, regs);
+        xc_cpuid_config_xsave(xch, info, input, regs);
         break;
 
     case 0x80000001:
-        if ( !guest_64bit )
+        if ( !info->pv64 )
         {
             clear_bit(X86_FEATURE_LM, regs[3]);
             clear_bit(X86_FEATURE_LAHF_LM, regs[2]);
-            if ( !strstr(brand, "AMD") )
+            if ( info->vendor != VENDOR_AMD )
                 clear_bit(X86_FEATURE_SYSCALL, regs[3]);
         }
         else
         {
             set_bit(X86_FEATURE_SYSCALL, regs[3]);
         }
-        if ( !pvh )
+        if ( !info->pvh )
             clear_bit(X86_FEATURE_PAGE1GB, regs[3]);
         clear_bit(X86_FEATURE_RDTSCP, regs[3]);
 
@@ -553,12 +588,10 @@ static void xc_cpuid_pv_policy(
     }
 }
 
-static int xc_cpuid_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs)
+static int xc_cpuid_policy(xc_interface *xch,
+                           const struct cpuid_domain_info *info,
+                           const unsigned int *input, unsigned int *regs)
 {
-    xc_dominfo_t        info;
-
     /*
      * For hypervisor leaves (0x4000XXXX) only 0x4000xx00.EAX[7:0] bits (max
      * number of leaves) can be set by user. Hypervisor will enforce this so
@@ -570,13 +603,10 @@ static int xc_cpuid_policy(
         return 0;
     }
 
-    if ( xc_domain_getinfo(xch, domid, 1, &info) == 0 )
-        return -EINVAL;
-
-    if ( info.hvm )
-        xc_cpuid_hvm_policy(xch, domid, input, regs);
+    if ( info->hvm )
+        xc_cpuid_hvm_policy(xch, info, input, regs);
     else
-        xc_cpuid_pv_policy(xch, domid, input, regs, info.pvh);
+        xc_cpuid_pv_policy(xch, info, input, regs);
 
     return 0;
 }
@@ -625,19 +655,21 @@ void xc_cpuid_to_str(const unsigned int *regs, char **strs)
 
 int xc_cpuid_apply_policy(xc_interface *xch, domid_t domid)
 {
+    struct cpuid_domain_info info = {};
     unsigned int input[2] = { 0, 0 }, regs[4];
     unsigned int base_max, ext_max;
-    char brand[13];
     int rc;
 
+    rc = get_cpuid_domain_info(xch, domid, &info);
+    if ( rc )
+        return rc;
 
     cpuid(input, regs);
     base_max = (regs[0] <= DEF_MAX_BASE) ? regs[0] : DEF_MAX_BASE;
     input[0] = 0x80000000;
     cpuid(input, regs);
 
-    xc_cpuid_brand_get(brand);
-    if ( strstr(brand, "AMD") )
+    if ( info.vendor == VENDOR_AMD )
         ext_max = (regs[0] <= DEF_MAX_AMDEXT) ? regs[0] : DEF_MAX_AMDEXT;
     else
         ext_max = (regs[0] <= DEF_MAX_INTELEXT) ? regs[0] : DEF_MAX_INTELEXT;
@@ -647,7 +679,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, domid_t domid)
     for ( ; ; )
     {
         cpuid(input, regs);
-        xc_cpuid_policy(xch, domid, input, regs);
+        xc_cpuid_policy(xch, &info, input, regs);
 
         if ( regs[0] || regs[1] || regs[2] || regs[3] )
         {
@@ -766,13 +798,18 @@ int xc_cpuid_set(
 {
     int rc;
     unsigned int i, j, regs[4], polregs[4];
+    struct cpuid_domain_info info = {};
 
     memset(config_transformed, 0, 4 * sizeof(*config_transformed));
 
+    rc = get_cpuid_domain_info(xch, domid, &info);
+    if ( rc )
+        return rc;
+
     cpuid(input, regs);
 
     memcpy(polregs, regs, sizeof(regs));
-    xc_cpuid_policy(xch, domid, input, polregs);
+    xc_cpuid_policy(xch, &info, input, polregs);
 
     for ( i = 0; i < 4; i++ )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:34:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34: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 1Zo1D1-0000H2-Uu; Mon, 19 Oct 2015 03:34: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 1Zo1D0-0000Gd-T4
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:03 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	24/61-00475-AA464265; Mon, 19 Oct 2015 03:34:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1445225640!59389886!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 16754 invoked from network); 19 Oct 2015 03:34:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:34:00 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cx-0005ar-SN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Cx-000442-QM
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:33:59 +0000
Date: Mon, 19 Oct 2015 03:33:59 +0000
Message-Id: <E1Zo1Cx-000442-QM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Improve efficiency of
	xc_cpuid_apply_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 bf87f3a24f25eb3628dfb62a2d0ce3802a09783b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 5 14:12:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:26:25 2015 +0100

    tools/libxc: Improve efficiency of xc_cpuid_apply_policy()
    
    Having the internals of xc_cpuid_policy() make hypercalls to collect domain
    information causes xc_cpuid_apply_policy() to be very inefficient.
    
    Re-order operations to collect all information at once at the outermost layer,
    and pass a structure in to all cpuid policy generation functions.
    
    This removes several hypercalls (4 from HVM, 3 from PV) for each of the
    up-to 108 leaves processed.
    
    No change in the eventual policy provided, although all the information
    gathering how has (or has correct) error checking.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_cpuid_x86.c |  245 +++++++++++++++++++++++++-------------------
 1 files changed, 141 insertions(+), 104 deletions(-)

diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index e146a3e..031c848 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -33,6 +33,27 @@
 #define DEF_MAX_INTELEXT  0x80000008u
 #define DEF_MAX_AMDEXT    0x8000001cu
 
+struct cpuid_domain_info
+{
+    enum
+    {
+        VENDOR_UNKNOWN,
+        VENDOR_INTEL,
+        VENDOR_AMD,
+    } vendor;
+
+    bool hvm;
+    bool pvh;
+    uint64_t xfeature_mask;
+
+    /* PV-only information. */
+    bool pv64;
+
+    /* HVM-only information. */
+    bool pae;
+    bool nestedhvm;
+};
+
 static void cpuid(const unsigned int *input, unsigned int *regs)
 {
     unsigned int count = (input[1] == XEN_CPUID_INPUT_UNUSED) ? 0 : input[1];
@@ -55,24 +76,75 @@ static void cpuid(const unsigned int *input, unsigned int *regs)
 #endif
 }
 
-/* Get the manufacturer brand name of the host processor. */
-static void xc_cpuid_brand_get(char *str)
+static int get_cpuid_domain_info(xc_interface *xch, domid_t domid,
+                                 struct cpuid_domain_info *info)
 {
-    unsigned int input[2] = { 0, 0 };
-    unsigned int regs[4];
+    struct xen_domctl domctl = {};
+    xc_dominfo_t di;
+    unsigned int in[2] = { 0, ~0U }, regs[4];
+    int rc;
 
-    cpuid(input, regs);
+    cpuid(in, regs);
+    if ( regs[1] == 0x756e6547U &&      /* "GenuineIntel" */
+         regs[2] == 0x6c65746eU &&
+         regs[3] == 0x49656e69U )
+        info->vendor = VENDOR_INTEL;
+    else if ( regs[1] == 0x68747541U && /* "AuthenticAMD" */
+              regs[2] == 0x444d4163U &&
+              regs[3] == 0x69746e65U )
+        info->vendor = VENDOR_AMD;
+    else
+        info->vendor = VENDOR_UNKNOWN;
+
+    if ( xc_domain_getinfo(xch, domid, 1, &di) != 1 ||
+         di.domid != domid )
+        return -ESRCH;
+
+    info->hvm = di.hvm;
+    info->pvh = di.pvh;
+
+    /* Get xstate information. */
+    domctl.cmd = XEN_DOMCTL_getvcpuextstate;
+    domctl.domain = domid;
+    rc = do_domctl(xch, &domctl);
+    if ( rc )
+        return rc;
+
+    info->xfeature_mask = domctl.u.vcpuextstate.xfeature_mask;
+
+    if ( di.hvm )
+    {
+        uint64_t val;
+
+        rc = xc_hvm_param_get(xch, domid, HVM_PARAM_PAE_ENABLED, &val);
+        if ( rc )
+            return rc;
+
+        info->pae = !!val;
+
+        rc = xc_hvm_param_get(xch, domid, HVM_PARAM_NESTEDHVM, &val);
+        if ( rc )
+            return rc;
+
+        info->nestedhvm = !!val;
+    }
+    else
+    {
+        unsigned int width;
+
+        rc = xc_domain_get_guest_width(xch, domid, &width);
+        if ( rc )
+            return rc;
+
+        info->pv64 = (width == 8);
+    }
 
-    *(uint32_t *)(str + 0) = regs[1];
-    *(uint32_t *)(str + 4) = regs[3];
-    *(uint32_t *)(str + 8) = regs[2];
-    str[12] = '\0';
+    return 0;
 }
 
-static void amd_xc_cpuid_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs,
-    int is_pae, int is_nestedhvm)
+static void amd_xc_cpuid_policy(xc_interface *xch,
+                                const struct cpuid_domain_info *info,
+                                const unsigned int *input, unsigned int *regs)
 {
     switch ( input[0] )
     {
@@ -87,13 +159,13 @@ static void amd_xc_cpuid_policy(
         break;
 
     case 0x80000001: {
-        if ( !is_pae )
+        if ( !info->pae )
             clear_bit(X86_FEATURE_PAE, regs[3]);
 
         /* Filter all other features according to a whitelist. */
         regs[2] &= (bitmaskof(X86_FEATURE_LAHF_LM) |
                     bitmaskof(X86_FEATURE_CMP_LEGACY) |
-                    (is_nestedhvm ? bitmaskof(X86_FEATURE_SVM) : 0) |
+                    (info->nestedhvm ? bitmaskof(X86_FEATURE_SVM) : 0) |
                     bitmaskof(X86_FEATURE_CR8_LEGACY) |
                     bitmaskof(X86_FEATURE_ABM) |
                     bitmaskof(X86_FEATURE_SSE4A) |
@@ -127,7 +199,8 @@ static void amd_xc_cpuid_policy(
         break;
 
     case 0x8000000a: {
-        if (!is_nestedhvm) {
+        if ( !info->nestedhvm )
+        {
             regs[0] = regs[1] = regs[2] = regs[3] = 0;
             break;
         }
@@ -157,16 +230,15 @@ static void amd_xc_cpuid_policy(
     }
 }
 
-static void intel_xc_cpuid_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs,
-    int is_pae, int is_nestedhvm)
+static void intel_xc_cpuid_policy(xc_interface *xch,
+                                  const struct cpuid_domain_info *info,
+                                  const unsigned int *input, unsigned int *regs)
 {
     switch ( input[0] )
     {
     case 0x00000001:
         /* ECX[5] is availability of VMX */
-        if (is_nestedhvm)
+        if ( info->nestedhvm )
             set_bit(X86_FEATURE_VMXE, regs[2]);
         break;
 
@@ -211,11 +283,11 @@ static void intel_xc_cpuid_policy(
 
 #define XSAVEOPT        (1 << 0)
 /* Configure extended state enumeration leaves (0x0000000D for xsave) */
-static void xc_cpuid_config_xsave(
-    xc_interface *xch, domid_t domid, uint64_t xfeature_mask,
-    const unsigned int *input, unsigned int *regs)
+static void xc_cpuid_config_xsave(xc_interface *xch,
+                                  const struct cpuid_domain_info *info,
+                                  const unsigned int *input, unsigned int *regs)
 {
-    if ( xfeature_mask == 0 )
+    if ( info->xfeature_mask == 0 )
     {
         regs[0] = regs[1] = regs[2] = regs[3] = 0;
         return;
@@ -225,9 +297,9 @@ static void xc_cpuid_config_xsave(
     {
     case 0: 
         /* EAX: low 32bits of xfeature_enabled_mask */
-        regs[0] = xfeature_mask & 0xFFFFFFFF;
+        regs[0] = info->xfeature_mask & 0xFFFFFFFF;
         /* EDX: high 32bits of xfeature_enabled_mask */
-        regs[3] = (xfeature_mask >> 32) & 0xFFFFFFFF;
+        regs[3] = (info->xfeature_mask >> 32) & 0xFFFFFFFF;
         /* ECX: max size required by all HW features */
         {
             unsigned int _input[2] = {0xd, 0x0}, _regs[4];
@@ -250,7 +322,7 @@ static void xc_cpuid_config_xsave(
         regs[1] = regs[2] = regs[3] = 0;
         break;
     case 2 ... 63: /* sub-leaves */
-        if ( !(xfeature_mask & (1ULL << input[1])) )
+        if ( !(info->xfeature_mask & (1ULL << input[1])) )
         {
             regs[0] = regs[1] = regs[2] = regs[3] = 0;
             break;
@@ -261,29 +333,10 @@ static void xc_cpuid_config_xsave(
     }
 }
 
-static void xc_cpuid_hvm_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs)
+static void xc_cpuid_hvm_policy(xc_interface *xch,
+                                const struct cpuid_domain_info *info,
+                                const unsigned int *input, unsigned int *regs)
 {
-    DECLARE_DOMCTL;
-    char brand[13];
-    uint64_t val;
-    int is_pae, is_nestedhvm;
-    uint64_t xfeature_mask;
-
-    xc_hvm_param_get(xch, domid, HVM_PARAM_PAE_ENABLED, &val);
-    is_pae = !!val;
-
-    /* Detecting Xen's atitude towards XSAVE */
-    memset(&domctl, 0, sizeof(domctl));
-    domctl.cmd = XEN_DOMCTL_getvcpuextstate;
-    domctl.domain = domid;
-    do_domctl(xch, &domctl);
-    xfeature_mask = domctl.u.vcpuextstate.xfeature_mask;
-
-    xc_hvm_param_get(xch, domid, HVM_PARAM_NESTEDHVM, &val);
-    is_nestedhvm = !!val;
-
     switch ( input[0] )
     {
     case 0x00000000:
@@ -311,7 +364,7 @@ static void xc_cpuid_hvm_policy(
                     bitmaskof(X86_FEATURE_AES) |
                     bitmaskof(X86_FEATURE_F16C) |
                     bitmaskof(X86_FEATURE_RDRAND) |
-                    ((xfeature_mask != 0) ?
+                    ((info->xfeature_mask != 0) ?
                      (bitmaskof(X86_FEATURE_AVX) |
                       bitmaskof(X86_FEATURE_XSAVE)) : 0));
 
@@ -346,7 +399,8 @@ static void xc_cpuid_hvm_policy(
         /* We always support MTRR MSRs. */
         regs[3] |= bitmaskof(X86_FEATURE_MTRR);
 
-        if ( !is_pae ) {
+        if ( !info->pae )
+        {
             clear_bit(X86_FEATURE_PAE, regs[3]);
             clear_bit(X86_FEATURE_PSE36, regs[3]);
         }
@@ -373,7 +427,7 @@ static void xc_cpuid_hvm_policy(
         break;
 
     case 0x0000000d:
-        xc_cpuid_config_xsave(xch, domid, xfeature_mask, input, regs);
+        xc_cpuid_config_xsave(xch, info, input, regs);
         break;
 
     case 0x80000000:
@@ -381,7 +435,7 @@ static void xc_cpuid_hvm_policy(
         break;
 
     case 0x80000001:
-        if ( !is_pae )
+        if ( !info->pae )
         {
             clear_bit(X86_FEATURE_LAHF_LM, regs[2]);
             clear_bit(X86_FEATURE_LM, regs[3]);
@@ -422,40 +476,21 @@ static void xc_cpuid_hvm_policy(
         break;
     }
 
-    xc_cpuid_brand_get(brand);
-    if ( strstr(brand, "AMD") )
-        amd_xc_cpuid_policy(xch, domid, input, regs, is_pae, is_nestedhvm);
+    if ( info->vendor == VENDOR_AMD )
+        amd_xc_cpuid_policy(xch, info, input, regs);
     else
-        intel_xc_cpuid_policy(xch, domid, input, regs, is_pae, is_nestedhvm);
-
+        intel_xc_cpuid_policy(xch, info, input, regs);
 }
 
-static void xc_cpuid_pv_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs, bool pvh)
+static void xc_cpuid_pv_policy(xc_interface *xch,
+                               const struct cpuid_domain_info *info,
+                               const unsigned int *input, unsigned int *regs)
 {
-    DECLARE_DOMCTL;
-    unsigned int guest_width;
-    int guest_64bit;
-    char brand[13];
-    uint64_t xfeature_mask;
-
-    xc_cpuid_brand_get(brand);
-
-    xc_domain_get_guest_width(xch, domid, &guest_width);
-    guest_64bit = (guest_width == 8);
-
-    /* Detecting Xen's atitude towards XSAVE */
-    memset(&domctl, 0, sizeof(domctl));
-    domctl.cmd = XEN_DOMCTL_getvcpuextstate;
-    domctl.domain = domid;
-    do_domctl(xch, &domctl);
-    xfeature_mask = domctl.u.vcpuextstate.xfeature_mask;
-
     if ( (input[0] & 0x7fffffff) == 0x00000001 )
     {
         clear_bit(X86_FEATURE_VME, regs[3]);
-        if ( !pvh ) {
+        if ( !info->pvh )
+        {
             clear_bit(X86_FEATURE_PSE, regs[3]);
             clear_bit(X86_FEATURE_PGE, regs[3]);
         }
@@ -468,7 +503,7 @@ static void xc_cpuid_pv_policy(
     switch ( input[0] )
     {
     case 0x00000001:
-        if ( strstr(brand, "AMD") )
+        if ( info->vendor == VENDOR_AMD )
             clear_bit(X86_FEATURE_SEP, regs[3]);
         clear_bit(X86_FEATURE_DS, regs[3]);
         clear_bit(X86_FEATURE_ACC, regs[3]);
@@ -481,9 +516,9 @@ static void xc_cpuid_pv_policy(
         clear_bit(X86_FEATURE_SMXE, regs[2]);
         clear_bit(X86_FEATURE_EST, regs[2]);
         clear_bit(X86_FEATURE_TM2, regs[2]);
-        if ( !guest_64bit )
+        if ( !info->pv64 )
             clear_bit(X86_FEATURE_CX16, regs[2]);
-        if ( xfeature_mask == 0 )
+        if ( info->xfeature_mask == 0 )
         {
             clear_bit(X86_FEATURE_XSAVE, regs[2]);
             clear_bit(X86_FEATURE_AVX, regs[2]);
@@ -512,22 +547,22 @@ static void xc_cpuid_pv_policy(
         break;
 
     case 0x0000000d:
-        xc_cpuid_config_xsave(xch, domid, xfeature_mask, input, regs);
+        xc_cpuid_config_xsave(xch, info, input, regs);
         break;
 
     case 0x80000001:
-        if ( !guest_64bit )
+        if ( !info->pv64 )
         {
             clear_bit(X86_FEATURE_LM, regs[3]);
             clear_bit(X86_FEATURE_LAHF_LM, regs[2]);
-            if ( !strstr(brand, "AMD") )
+            if ( info->vendor != VENDOR_AMD )
                 clear_bit(X86_FEATURE_SYSCALL, regs[3]);
         }
         else
         {
             set_bit(X86_FEATURE_SYSCALL, regs[3]);
         }
-        if ( !pvh )
+        if ( !info->pvh )
             clear_bit(X86_FEATURE_PAGE1GB, regs[3]);
         clear_bit(X86_FEATURE_RDTSCP, regs[3]);
 
@@ -553,12 +588,10 @@ static void xc_cpuid_pv_policy(
     }
 }
 
-static int xc_cpuid_policy(
-    xc_interface *xch, domid_t domid,
-    const unsigned int *input, unsigned int *regs)
+static int xc_cpuid_policy(xc_interface *xch,
+                           const struct cpuid_domain_info *info,
+                           const unsigned int *input, unsigned int *regs)
 {
-    xc_dominfo_t        info;
-
     /*
      * For hypervisor leaves (0x4000XXXX) only 0x4000xx00.EAX[7:0] bits (max
      * number of leaves) can be set by user. Hypervisor will enforce this so
@@ -570,13 +603,10 @@ static int xc_cpuid_policy(
         return 0;
     }
 
-    if ( xc_domain_getinfo(xch, domid, 1, &info) == 0 )
-        return -EINVAL;
-
-    if ( info.hvm )
-        xc_cpuid_hvm_policy(xch, domid, input, regs);
+    if ( info->hvm )
+        xc_cpuid_hvm_policy(xch, info, input, regs);
     else
-        xc_cpuid_pv_policy(xch, domid, input, regs, info.pvh);
+        xc_cpuid_pv_policy(xch, info, input, regs);
 
     return 0;
 }
@@ -625,19 +655,21 @@ void xc_cpuid_to_str(const unsigned int *regs, char **strs)
 
 int xc_cpuid_apply_policy(xc_interface *xch, domid_t domid)
 {
+    struct cpuid_domain_info info = {};
     unsigned int input[2] = { 0, 0 }, regs[4];
     unsigned int base_max, ext_max;
-    char brand[13];
     int rc;
 
+    rc = get_cpuid_domain_info(xch, domid, &info);
+    if ( rc )
+        return rc;
 
     cpuid(input, regs);
     base_max = (regs[0] <= DEF_MAX_BASE) ? regs[0] : DEF_MAX_BASE;
     input[0] = 0x80000000;
     cpuid(input, regs);
 
-    xc_cpuid_brand_get(brand);
-    if ( strstr(brand, "AMD") )
+    if ( info.vendor == VENDOR_AMD )
         ext_max = (regs[0] <= DEF_MAX_AMDEXT) ? regs[0] : DEF_MAX_AMDEXT;
     else
         ext_max = (regs[0] <= DEF_MAX_INTELEXT) ? regs[0] : DEF_MAX_INTELEXT;
@@ -647,7 +679,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, domid_t domid)
     for ( ; ; )
     {
         cpuid(input, regs);
-        xc_cpuid_policy(xch, domid, input, regs);
+        xc_cpuid_policy(xch, &info, input, regs);
 
         if ( regs[0] || regs[1] || regs[2] || regs[3] )
         {
@@ -766,13 +798,18 @@ int xc_cpuid_set(
 {
     int rc;
     unsigned int i, j, regs[4], polregs[4];
+    struct cpuid_domain_info info = {};
 
     memset(config_transformed, 0, 4 * sizeof(*config_transformed));
 
+    rc = get_cpuid_domain_info(xch, domid, &info);
+    if ( rc )
+        return rc;
+
     cpuid(input, regs);
 
     memcpy(polregs, regs, sizeof(regs));
-    xc_cpuid_policy(xch, domid, input, polregs);
+    xc_cpuid_policy(xch, &info, input, polregs);
 
     for ( i = 0; i < 4; i++ )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:34:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1DB-0000JY-4U; Mon, 19 Oct 2015 03:34:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DA-0000JI-Ek
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:12 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	3F/AA-06179-3B464265; Mon, 19 Oct 2015 03:34:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1445225650!43130508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4214 invoked from network); 19 Oct 2015 03:34:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:34:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1D8-0005bS-7x
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1D8-00044p-5s
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:10 +0000
Date: Mon, 19 Oct 2015 03:34:10 +0000
Message-Id: <E1Zo1D8-00044p-5s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Add Libc multiarch package as build
	prerequisites on 64-bit platforms to the README
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84b4f356db6a2181fda1a9cb17a876f6d773970b
Author:     Sander Eikelenboom <linux@eikelenboom.it>
AuthorDate: Tue Oct 6 18:58:25 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:29:10 2015 +0100

    Add Libc multiarch package as build prerequisites on 64-bit platforms to the README
    
    When building on 64-bit platforms this prevents  build errors for
    32-bit components which are enabled on a default build.
    
    Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 README |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/README b/README
index a7d0033..1324c7c 100644
--- a/README
+++ b/README
@@ -56,6 +56,9 @@ provided by your OS distributor:
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
     * ACPI ASL compiler (iasl)
+    * Libc multiarch package (e.g. libc6-dev-i386 / glibc-devel.i686).
+      Required when building on a 64-bit platform to build
+      32-bit components which are enabled on a default build.
 
 In addition to the above there are a number of optional build
 prerequisites. Omitting these will cause the related features to be
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:34:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1DB-0000JY-4U; Mon, 19 Oct 2015 03:34:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DA-0000JI-Ek
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:12 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	3F/AA-06179-3B464265; Mon, 19 Oct 2015 03:34:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1445225650!43130508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4214 invoked from network); 19 Oct 2015 03:34:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:34:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1D8-0005bS-7x
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1D8-00044p-5s
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:10 +0000
Date: Mon, 19 Oct 2015 03:34:10 +0000
Message-Id: <E1Zo1D8-00044p-5s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Add Libc multiarch package as build
	prerequisites on 64-bit platforms to the README
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84b4f356db6a2181fda1a9cb17a876f6d773970b
Author:     Sander Eikelenboom <linux@eikelenboom.it>
AuthorDate: Tue Oct 6 18:58:25 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:29:10 2015 +0100

    Add Libc multiarch package as build prerequisites on 64-bit platforms to the README
    
    When building on 64-bit platforms this prevents  build errors for
    32-bit components which are enabled on a default build.
    
    Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 README |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/README b/README
index a7d0033..1324c7c 100644
--- a/README
+++ b/README
@@ -56,6 +56,9 @@ provided by your OS distributor:
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
     * ACPI ASL compiler (iasl)
+    * Libc multiarch package (e.g. libc6-dev-i386 / glibc-devel.i686).
+      Required when building on a 64-bit platform to build
+      32-bit components which are enabled on a default build.
 
 In addition to the above there are a number of optional build
 prerequisites. Omitting these will cause the related features to be
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:34:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34: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 1Zo1DR-0000MY-7l; Mon, 19 Oct 2015 03:34: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 1Zo1DP-0000MB-Ge
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:28 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	15/03-30270-2C464265; Mon, 19 Oct 2015 03:34:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1445225660!11027139!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 10973 invoked from network); 19 Oct 2015 03:34:21 -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;
	19 Oct 2015 03:34:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DI-0005ba-O9
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DI-00045d-KF
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:20 +0000
Date: Mon, 19 Oct 2015 03:34:20 +0000
Message-Id: <E1Zo1DI-00045d-KF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: convert to use LOG() macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db82cd9251eb55a55242d6a713f710cd72d18fb0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 2 15:56:38 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:30:36 2015 +0100

    libxl: convert to use LOG() macro
    
    This patch converts most LIBXL__LOG* macros to LOG macro. It's done with
    spatch plus some hand coding.
    
    Using spatch rune:
    
        spatch --in-place --no-includes --include-headers \
            --sp-file libxl.spatch \
            tools/libxl/libxl*.c
    
    with some exceptions.
    
    libxl_json.c is untouched because the notion of ctx is in fact referring
    to yajl context.
    
    libxl_qmp.c is untouched because libxl ctx is buried in qmp context.
    
    libxl_fork.c is untouched because it's clearer to just use original
    code.
    
    Some fallouts are dealt with manually. There are three categories.
    
    Functions that don't have gc defined. Add gc definition with GC_INIT.
    Also try my best to make them conform with libxl coding style.
    
     * libxl_list_domain
     * libxl_domain_info
     * libxl_domain_pause
     * libxl_get_physinfo
     * libxl_domain_set_nodeaffinity
     * libxl_domain_get_nodeaffinity
     * libxl_get_scheduler
     * libxl_sched_credit_params_get
     * libxl_sched_credit_params_set
     * libxl_send_debug_keys
     * libxl_xen_console_read_line
     * libxl_tmem_list
     * libxl_tmem_freeze
     * libxl_tmem_thaw
     * libxl_tmem_set
     * libxl_tmem_shared_auth
     * libxl_tmem_freeable
     * libxl_fd_set_cloexec
     * libxl_fd_set_nonblock
     * libxl__init_recursive_mutex
     * READ_WRITE_EXACTLY
     * libxl__ao_complete_check_progress_reports
    
    Functions don't need ctx variable anymore after conversion. Delete that
    variable.
    
     * libxl__device_from_disk
     * domcreate_rebuild_done
     * domcreate_devmodel_started
     * domcreate_attach_pci
     * libxl__domain_device_model
     * libxl__build_device_model_args_new
     * libxl__build_device_model_args
     * libxl__create_pci_backend
     * libxl__device_pci_add_xenstore
     * sysfs_write_bdf
     * sysfs_dev_unbind
     * pciback_dev_has_slot
     * pciback_dev_is_assigned
     * pciback_dev_assign
     * pciback_dev_unassign
     * pci_assignable_driver_path_write
     * libxl__device_pci_assignable_remove
     * libxl__xenstore_child_wait_deprecated
     * libxl__xs_libxl_path
     * libxl__device_model_version_running
    
    Special handling for some functions.
    
     * ao__abort: easier to just use original code.
     * e820_sanitize: should have taken gc instead of ctx
    
    =====
    virtual patch
    virtual context
    virtual org
    virtual report
    
    @level1@
    identifier FN =~ "LIBXL__LOG|LIBXL__LOG_ERRNO|LIBXL__LOG_ERRNOVAL";
    constant l1 =~ "(LIBXL__LOG|XTL)_(DEBUG|INFO|WARNING|ERROR)";
    expression ctx;
    @@
    FN(ctx, l1, ...);
    
    @script:python level2@
    l1 << level1.l1;
    l2;
    @@
    
    import re
    coccinelle.l2 = re.sub("LIBXL__LOG_|XTL_", "", l1);
    if coccinelle.l2 == "WARNING": coccinelle.l2 = "WARN"
    
    @log10@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    @@
    -LIBXL__LOG(ctx, l1, fmt);
    +LOG(l2, fmt);
    
    @log11@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression arg1;
    @@
    -LIBXL__LOG(ctx, l1, fmt, arg1);
    +LOG(l2, fmt, arg1);
    
    @log12@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression arg1, arg2;
    @@
    -LIBXL__LOG(ctx, l1, fmt, arg1, arg2);
    +LOG(l2, fmt, arg1, arg2);
    
    @log13@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression arg1, arg2, arg3;
    @@
    -LIBXL__LOG(ctx, l1, fmt, arg1, arg2, arg3);
    +LOG(l2, fmt, arg1, arg2, arg3);
    
    @log20@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    @@
    -LIBXL__LOG_ERRNO(ctx, l1, fmt);
    +LOGE(l2, fmt);
    
    @log21@
    expression ctx;
    expression fmt;
    constant level1.l1;
    identifier level2.l2;
    expression arg1;
    @@
    -LIBXL__LOG_ERRNO(ctx, l1, fmt, arg1);
    +LOGE(l2, fmt, arg1);
    
    @log22@
    expression ctx;
    expression fmt;
    constant level1.l1;
    identifier level2.l2;
    expression arg1, arg2;
    @@
    -LIBXL__LOG_ERRNO(ctx, l1, fmt, arg1, arg2);
    +LOGE(l2, fmt, arg1, arg2);
    
    @log23@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression arg1, arg2, arg3;
    @@
    -LIBXL__LOG_ERRNO(ctx, l1, fmt, arg1, arg2, arg3);
    +LOGE(l2, fmt, arg1, arg2, arg3);
    
    @log30@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression errnoval;
    @@
    -LIBXL__LOG_ERRNOVAL(ctx, l1, errnoval, fmt);
    +LOGEV(l2, errnoval, fmt);
    
    @log31@
    expression fmt;
    expression arg1;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression errnoval;
    @@
    -LIBXL__LOG_ERRNOVAL(ctx, l1, errnoval, fmt, arg1);
    +LOGEV(l2, errnoval, fmt, arg1);
    
    @log32@
    expression fmt;
    expression arg1, arg2;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression errnoval;
    @@
    -LIBXL__LOG_ERRNOVAL(ctx, l1, errnoval, fmt, arg1, arg2);
    +LOGEV(l2, errnoval, fmt, arg1, arg2);
    =====
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c          |  386 +++++++++++++++++++++++-------------------
 tools/libxl/libxl_create.c   |   37 ++---
 tools/libxl/libxl_dm.c       |   50 +++---
 tools/libxl/libxl_dom.c      |   17 +-
 tools/libxl/libxl_event.c    |   48 +++---
 tools/libxl/libxl_exec.c     |    5 +-
 tools/libxl/libxl_internal.c |   17 +-
 tools/libxl/libxl_pci.c      |  158 ++++++++----------
 tools/libxl/libxl_utils.c    |   17 +-
 tools/libxl/libxl_x86.c      |   18 +-
 tools/libxl/libxl_xshelp.c   |    6 +-
 11 files changed, 372 insertions(+), 387 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index e4ea476..1b754c8 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -90,7 +90,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
     /* The mutex is special because we can't idempotently destroy it */
 
     if (libxl__init_recursive_mutex(ctx, &ctx->lock) < 0) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to initialize mutex");
+        LOG(ERROR, "Failed to initialize mutex");
         free(ctx);
         ctx = 0;
         rc = ERROR_FAIL;
@@ -402,15 +402,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     if (!trans) {
         trans = our_trans = xs_transaction_start(ctx->xsh);
         if (!our_trans) {
-            LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
-                            "create xs transaction for domain (re)name");
+            LOGEV(ERROR, errno, "create xs transaction for domain (re)name");
             goto x_fail;
         }
     }
 
     if (!new_name) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                        "new domain name not specified");
+        LOG(ERROR, "new domain name not specified");
         rc = ERROR_INVAL;
         goto x_rc;
     }
@@ -422,16 +420,14 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         if (rc == ERROR_INVAL) {
             /* no such domain, good */
         } else if (rc != 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "unexpected error"
-                       "checking for existing domain");
+            LOG(ERROR, "unexpected error""checking for existing domain");
             goto x_rc;
         } else if (domid_e == domid) {
             /* domain already has this name, ok (but we do still
              * need the rest of the code as we may need to check
              * old_name, for example). */
         } else {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "domain with name \"%s\""
-                       " already exists.", new_name);
+            LOG(ERROR, "domain with name \"%s\""" already exists.", new_name);
             rc = ERROR_INVAL;
             goto x_rc;
         }
@@ -440,15 +436,18 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     if (old_name) {
         got_old_name = xs_read(ctx->xsh, trans, name_path, &got_old_len);
         if (!got_old_name) {
-            LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno, "check old name"
-                            " for domain %"PRIu32" allegedly named `%s'",
-                            domid, old_name);
+            LOGEV(ERROR, errno,
+                  "check old name"" for domain %"PRIu32" allegedly named `%s'",
+                  domid,
+                  old_name);
             goto x_fail;
         }
         if (strcmp(old_name, got_old_name)) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "domain %"PRIu32" allegedly named "
-                   "`%s' is actually named `%s' - racing ?",
-                   domid, old_name, got_old_name);
+            LOG(ERROR,
+                "domain %"PRIu32" allegedly named ""`%s' is actually named `%s' - racing ?",
+                domid,
+                old_name,
+                got_old_name);
             free(got_old_name);
             goto x_fail;
         }
@@ -456,9 +455,11 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     }
     if (!xs_write(ctx->xsh, trans, name_path,
                   new_name, strlen(new_name))) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "failed to write new name `%s'"
-               " for domain %"PRIu32" previously named `%s'",
-               new_name, domid, old_name);
+        LOG(ERROR,
+            "failed to write new name `%s'"" for domain %"PRIu32" previously named `%s'",
+            new_name,
+            domid,
+            old_name);
         goto x_fail;
     }
 
@@ -487,14 +488,18 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         if (!xs_transaction_end(ctx->xsh, our_trans, 0)) {
             trans = our_trans = 0;
             if (errno != EAGAIN) {
-                LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "failed to commit new name `%s'"
-                       " for domain %"PRIu32" previously named `%s'",
-                       new_name, domid, old_name);
+                LOG(ERROR,
+                    "failed to commit new name `%s'"" for domain %"PRIu32" previously named `%s'",
+                    new_name,
+                    domid,
+                    old_name);
                 goto x_fail;
             }
-            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "need to retry rename transaction"
-                   " for domain %"PRIu32" (name_path=\"%s\", new_name=\"%s\")",
-                   domid, name_path, new_name);
+            LOG(DEBUG,
+                "need to retry rename transaction"" for domain %"PRIu32" (name_path=\"%s\", new_name=\"%s\")",
+                domid,
+                name_path,
+                new_name);
             goto retry_transaction;
         }
         our_trans = 0;
@@ -644,17 +649,20 @@ libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out)
     int i, ret;
     xc_domaininfo_t info[1024];
     int size = 1024;
+    GC_INIT(ctx);
 
     ptr = calloc(size, sizeof(libxl_dominfo));
     if (!ptr) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating domain info");
+        LOGE(ERROR, "allocating domain info");
+        GC_FREE;
         return NULL;
     }
 
     ret = xc_domain_getinfolist(ctx->xch, 0, 1024, info);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        LOGE(ERROR, "getting domain info list");
         free(ptr);
+        GC_FREE;
         return NULL;
     }
 
@@ -662,6 +670,7 @@ libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out)
         xcinfo2xlinfo(ctx, &info[i], &ptr[i]);
     }
     *nb_domain_out = ret;
+    GC_FREE;
     return ptr;
 }
 
@@ -669,16 +678,22 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r,
                       uint32_t domid) {
     xc_domaininfo_t xcinfo;
     int ret;
+    GC_INIT(ctx);
 
     ret = xc_domain_getinfolist(ctx->xch, domid, 1, &xcinfo);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        LOGE(ERROR, "getting domain info list");
+        GC_FREE;
         return ERROR_FAIL;
     }
-    if (ret==0 || xcinfo.domain != domid) return ERROR_DOMAIN_NOTFOUND;
+    if (ret==0 || xcinfo.domain != domid) {
+        GC_FREE;
+        return ERROR_DOMAIN_NOTFOUND;
+    }
 
     if (info_r)
         xcinfo2xlinfo(ctx, &xcinfo, info_r);
+    GC_FREE;
     return 0;
 }
 
@@ -787,7 +802,7 @@ libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
 
     ret = xc_domain_getinfolist(ctx->xch, 1, ARRAY_SIZE(info), info);
     if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        LOGE(ERROR, "getting domain info list");
         goto out;
     }
 
@@ -1001,11 +1016,14 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
 int libxl_domain_pause(libxl_ctx *ctx, uint32_t domid)
 {
     int ret;
+    GC_INIT(ctx);
     ret = xc_domain_pause(ctx->xch, domid);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "pausing domain %d", domid);
+        LOGE(ERROR, "pausing domain %d", domid);
+        GC_FREE;
         return ERROR_FAIL;
     }
+    GC_FREE;
     return 0;
 }
 
@@ -1018,8 +1036,7 @@ int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid,
 
     ret = xc_domain_dumpcore(ctx->xch, domid, filename);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "core dumping domain %d to %s",
-                     domid, filename);
+        LOGE(ERROR, "core dumping domain %d to %s", domid, filename);
         rc = ERROR_FAIL;
         goto out;
     }
@@ -1053,7 +1070,7 @@ int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid)
     }
     ret = xc_domain_unpause(ctx->xch, domid);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unpausing domain %d", domid);
+        LOGE(ERROR, "unpausing domain %d", domid);
         rc = ERROR_FAIL;
     }
  out:
@@ -1077,7 +1094,7 @@ int libxl__domain_pvcontrol_available(libxl__gc *gc, uint32_t domid)
 
     ret = xc_hvm_param_get(ctx->xch, domid, HVM_PARAM_CALLBACK_IRQ, &pvdriver);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting HVM callback IRQ");
+        LOGE(ERROR, "getting HVM callback IRQ");
         return ERROR_FAIL;
     }
     return !!pvdriver;
@@ -1160,7 +1177,7 @@ static void domain_death_occurred(libxl__egc *egc,
     EGC_GC;
     libxl_evgen_domain_death *const evg = *evg_upd;
 
-    LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "%s", why);
+    LOG(DEBUG, "%s", why);
 
     libxl_evgen_domain_death *evg_next = LIBXL_TAILQ_NEXT(evg, entry);
     *evg_upd = evg_next;
@@ -1208,7 +1225,7 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
 
         for (;;) {
             if (!evg) {
-                LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "[evg=0] all reported");
+                LOG(DEBUG, "[evg=0] all reported");
                 goto all_reported;
             }
 
@@ -1223,7 +1240,7 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
             }
 
             if (got == gotend) {
-                LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " got==gotend");
+                LOG(DEBUG, " got==gotend");
                 break;
             }
 
@@ -1240,9 +1257,8 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
             }
 
             assert(evg->domid == got->domain);
-            LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " exists shutdown_reported=%d"
-                       " dominf.flags=%x",
-                       evg->shutdown_reported, got->flags);
+            LOG(DEBUG, " exists shutdown_reported=%d"" dominf.flags=%x",
+                evg->shutdown_reported, got->flags);
 
             if (got->flags & XEN_DOMINF_dying) {
                 domain_death_occurred(egc, &evg, "dying");
@@ -1254,7 +1270,7 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
                 libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN,
                                             got->domain, evg->user);
 
-                LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " shutdown reporting");
+                LOG(DEBUG, " shutdown reporting");
 
                 ev->u.domain_shutdown.shutdown_reason =
                     (got->flags >> XEN_DOMINF_shutdownshift) &
@@ -1271,7 +1287,7 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
  all_reported:
  out:
 
-    LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "domain death search done");
+    LOG(DEBUG, "domain death search done");
 
     CTX_UNLOCK;
 }
@@ -1590,7 +1606,7 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
     case 0:
         break;
     case ERROR_DOMAIN_NOTFOUND:
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "non-existant domain %d", domid);
+        LOG(ERROR, "non-existant domain %d", domid);
     default:
         goto out;
     }
@@ -1620,14 +1636,14 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
     }
 
     if (libxl__device_pci_destroy_all(gc, domid) < 0)
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "pci shutdown failed for domid %d", domid);
+        LOG(ERROR, "pci shutdown failed for domid %d", domid);
     rc = xc_domain_pause(ctx->xch, domid);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc, "xc_domain_pause failed for %d", domid);
+        LOGEV(ERROR, rc, "xc_domain_pause failed for %d", domid);
     }
     if (dm_present) {
         if (libxl__destroy_device_model(gc, domid) < 0)
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "libxl__destroy_device_model failed for %d", domid);
+            LOG(ERROR, "libxl__destroy_device_model failed for %d", domid);
 
         libxl__qmp_cleanup(gc, domid);
     }
@@ -1663,16 +1679,15 @@ static void devices_destroy_cb(libxl__egc *egc,
     }
 
     if (rc < 0)
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, 
-                   "libxl__devices_destroy failed for %d", domid);
+        LOG(ERROR, "libxl__devices_destroy failed for %d", domid);
 
     vm_path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/vm", dom_path));
     if (vm_path)
         if (!xs_rm(ctx->xsh, XBT_NULL, vm_path))
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xs_rm failed for %s", vm_path);
+            LOGE(ERROR, "xs_rm failed for %s", vm_path);
 
     if (!xs_rm(ctx->xsh, XBT_NULL, dom_path))
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xs_rm failed for %s", dom_path);
+        LOGE(ERROR, "xs_rm failed for %s", dom_path);
 
     xs_rm(ctx->xsh, XBT_NULL, libxl__xs_libxl_path(gc, domid));
     xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc,
@@ -1942,15 +1957,13 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
         char tmpname[] = "/tmp/vncautopass.XXXXXX";
         autopass_fd = mkstemp(tmpname);
         if ( autopass_fd < 0 ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "mkstemp %s failed", tmpname);
+            LOGE(ERROR, "mkstemp %s failed", tmpname);
             goto x_fail;
         }
 
         if ( unlink(tmpname) ) {
             /* should never happen */
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "unlink %s failed", tmpname);
+            LOGE(ERROR, "unlink %s failed", tmpname);
             goto x_fail;
         }
 
@@ -1959,8 +1972,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
             goto x_fail;
 
         if ( lseek(autopass_fd, SEEK_SET, 0) ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "rewind %s (autopass) failed", tmpname);
+            LOGE(ERROR, "rewind %s (autopass) failed", tmpname);
             goto x_fail;
         }
 
@@ -2353,13 +2365,12 @@ int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
                                    libxl_device_disk *disk,
                                    libxl__device *device)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int devid;
 
     devid = libxl__device_disk_dev_number(disk->vdev, NULL, NULL);
     if (devid==-1) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Invalid or unsupported"
-               " virtual disk identifier %s", disk->vdev);
+        LOG(ERROR, "Invalid or unsupported"" virtual disk identifier %s",
+            disk->vdev);
         return ERROR_INVAL;
     }
 
@@ -2377,8 +2388,7 @@ int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
             device->backend_kind = LIBXL__DEVICE_KIND_QDISK;
             break;
         default:
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "unrecognized disk backend type: %d", disk->backend);
+            LOG(ERROR, "unrecognized disk backend type: %d", disk->backend);
             return ERROR_INVAL;
     }
 
@@ -2471,8 +2481,8 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
         GCNEW(device);
         rc = libxl__device_from_disk(gc, domid, disk, device);
         if (rc != 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Invalid or unsupported"
-                   " virtual disk identifier %s", disk->vdev);
+            LOG(ERROR, "Invalid or unsupported"" virtual disk identifier %s",
+                disk->vdev);
             goto out;
         }
 
@@ -2544,9 +2554,8 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                 assert(device->backend_kind == LIBXL__DEVICE_KIND_QDISK);
                 break;
             default:
-                LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                           "unrecognized disk backend type: %d",
-                           disk->backend);
+                LOG(ERROR, "unrecognized disk backend type: %d",
+                    disk->backend);
                 rc = ERROR_INVAL;
                 goto out;
         }
@@ -2805,7 +2814,7 @@ libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *n
     return disks;
 
 out_err:
-    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unable to list disks");
+    LOG(ERROR, "Unable to list disks");
     while (disks && *num) {
         (*num)--;
         libxl_device_disk_dispose(&disks[*num]);
@@ -2909,7 +2918,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         }
     }
     if (i == num) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
+        LOG(ERROR, "Virtual device not found");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -2968,8 +2977,8 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/frontend", path));
         if (!tmp)
         {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
-                       libxl__sprintf(gc, "%s/frontend", path));
+            LOG(ERROR, "Internal error: %s does not exist",
+                libxl__sprintf(gc, "%s/frontend", path));
             rc = ERROR_FAIL;
             goto out;
         }
@@ -3000,8 +3009,8 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/frontend", path));
         if (!tmp)
         {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
-                       libxl__sprintf(gc, "%s/frontend", path));
+            LOG(ERROR, "Internal error: %s does not exist",
+                libxl__sprintf(gc, "%s/frontend", path));
             rc = ERROR_FAIL;
             goto out;
         }
@@ -3572,7 +3581,7 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num
     return nics;
 
 out_err:
-    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unable to list nics");
+    LOG(ERROR, "Unable to list nics");
     while (*num) {
         (*num)--;
         libxl_device_nic_dispose(&nics[*num]);
@@ -4604,27 +4613,24 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t max_memkb)
 
     mem = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/memory/target", dompath));
     if (!mem) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "cannot get memory info from %s/memory/target",
-                         dompath);
+        LOGE(ERROR, "cannot get memory info from %s/memory/target", dompath);
         goto out;
     }
     memorykb = strtoul(mem, &endptr, 10);
     if (*endptr != '\0') {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "invalid memory %s from %s/memory/target\n", mem, dompath);
+        LOGE(ERROR, "invalid memory %s from %s/memory/target\n", mem, dompath);
         goto out;
     }
 
     if (max_memkb < memorykb) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "memory_static_max must be greater than or or equal to memory_dynamic_max");
+        LOGE(ERROR,
+             "memory_static_max must be greater than or or equal to memory_dynamic_max");
         goto out;
     }
     rc = xc_domain_setmaxmem(ctx->xch, domid, max_memkb + LIBXL_MAXMEM_CONSTANT);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                "xc_domain_setmaxmem domid=%d memkb=%d failed "
-                "rc=%d\n", domid, max_memkb + LIBXL_MAXMEM_CONSTANT, rc);
+        LOGE(ERROR, "xc_domain_setmaxmem domid=%d memkb=%d failed ""rc=%d\n",
+             domid, max_memkb + LIBXL_MAXMEM_CONSTANT, rc);
         goto out;
     }
 
@@ -4663,8 +4669,8 @@ retry_transaction:
     if (target) {
         *target_memkb = strtoul(target, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s\n", target, target_path);
+            LOGE(ERROR, "invalid memory target %s from %s\n", target,
+                 target_path);
             rc = ERROR_FAIL;
             goto out;
         }
@@ -4673,9 +4679,8 @@ retry_transaction:
     if (staticmax) {
         *max_memkb = strtoul(staticmax, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "invalid memory static-max %s from %s\n",
-                             staticmax, max_path);
+            LOGE(ERROR, "invalid memory static-max %s from %s\n", staticmax,
+                 max_path);
             rc = ERROR_FAIL;
             goto out;
         }
@@ -4755,17 +4760,15 @@ retry_transaction:
             goto out_no_transaction;
         goto retry_transaction;
     } else if (!target) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "cannot get target memory info from %s/memory/target",
-                         dompath);
+        LOGE(ERROR, "cannot get target memory info from %s/memory/target",
+             dompath);
         abort_transaction = 1;
         goto out;
     } else {
         current_target_memkb = strtoul(target, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s/memory/target\n",
-                    target, dompath);
+            LOGE(ERROR, "invalid memory target %s from %s/memory/target\n",
+                 target, dompath);
             abort_transaction = 1;
             goto out;
         }
@@ -4773,17 +4776,15 @@ retry_transaction:
     memmax = libxl__xs_read(gc, t, libxl__sprintf(gc,
                 "%s/memory/static-max", dompath));
     if (!memmax) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "cannot get memory info from %s/memory/static-max",
-                         dompath);
+        LOGE(ERROR, "cannot get memory info from %s/memory/static-max",
+             dompath);
         abort_transaction = 1;
         goto out;
     }
     memorykb = strtoul(memmax, &endptr, 10);
     if (*endptr != '\0') {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                "invalid max memory %s from %s/memory/static-max\n",
-                memmax, dompath);
+        LOGE(ERROR, "invalid max memory %s from %s/memory/static-max\n",
+             memmax, dompath);
         abort_transaction = 1;
         goto out;
     }
@@ -4800,17 +4801,15 @@ retry_transaction:
     } else
         new_target_memkb = target_memkb - videoram;
     if (new_target_memkb > memorykb) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                "memory_dynamic_max must be less than or equal to"
-                " memory_static_max\n");
+        LOG(ERROR,
+            "memory_dynamic_max must be less than or equal to"" memory_static_max\n");
         abort_transaction = 1;
         goto out;
     }
 
     if (!domid && new_target_memkb < LIBXL_MIN_DOM0_MEM) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "new target %d for dom0 is below the minimum threshold",
-                   new_target_memkb);
+        LOG(ERROR, "new target %d for dom0 is below the minimum threshold",
+            new_target_memkb);
         abort_transaction = 1;
         goto out;
     }
@@ -4820,9 +4819,11 @@ retry_transaction:
         rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb +
                 LIBXL_MAXMEM_CONSTANT);
         if (rc != 0) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                    "xc_domain_setmaxmem domid=%u memkb=%"PRIu64" failed "
-                    "rc=%d\n", domid, memorykb + LIBXL_MAXMEM_CONSTANT, rc);
+            LOGE(ERROR,
+                 "xc_domain_setmaxmem domid=%u memkb=%"PRIu64" failed ""rc=%d\n",
+                 domid,
+                 memorykb + LIBXL_MAXMEM_CONSTANT,
+                 rc);
             abort_transaction = 1;
             goto out;
         }
@@ -4831,10 +4832,11 @@ retry_transaction:
     rc = xc_domain_set_pod_target(ctx->xch, domid,
             new_target_memkb / 4, NULL, NULL, NULL);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                "xc_domain_set_pod_target domid=%d, memkb=%d "
-                "failed rc=%d\n", domid, new_target_memkb / 4,
-                rc);
+        LOGE(ERROR,
+             "xc_domain_set_pod_target domid=%d, memkb=%d ""failed rc=%d\n",
+             domid,
+             new_target_memkb / 4,
+             rc);
         abort_transaction = 1;
         goto out;
     }
@@ -4889,28 +4891,27 @@ static int libxl__get_memory_target(libxl__gc *gc, uint32_t domid,
         if (rc < 0)
             goto out;
     } else if (!target) {
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                         "cannot get target memory info from %s/memory/target",
-                         dompath);
+        LOGE(ERROR, "cannot get target memory info from %s/memory/target",
+             dompath);
         goto out;
     } else if (!static_max) {
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                "cannot get target memory info from %s/memory/static-max",
-                dompath);
+        LOGE(ERROR,
+             "cannot get target memory info from %s/memory/static-max",
+             dompath);
         goto out;
     } else {
         target_memkb = strtoul(target, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s/memory/target\n",
-                    target, dompath);
+            LOGE(ERROR, "invalid memory target %s from %s/memory/target\n",
+                 target, dompath);
             goto out;
         }
         max_memkb = strtoul(static_max, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s/memory/static-max\n",
-                    static_max, dompath);
+            LOGE(ERROR,
+                 "invalid memory target %s from %s/memory/static-max\n",
+                 static_max,
+                 dompath);
             goto out;
         }
 
@@ -5067,10 +5068,12 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     xc_physinfo_t xcphysinfo = { 0 };
     int rc;
     long l;
+    GC_INIT(ctx);
 
     rc = xc_physinfo(ctx->xch, &xcphysinfo);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting physinfo");
+        LOGE(ERROR, "getting physinfo");
+        GC_FREE;
         return ERROR_FAIL;
     }
     physinfo->threads_per_core = xcphysinfo.threads_per_core;
@@ -5086,8 +5089,8 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     if (l < 0 && errno == ENOSYS) {
         l = 0;
     } else if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
-                            "getting sharing freed pages");
+        LOGEV(ERROR, l, "getting sharing freed pages");
+        GC_FREE;
         return ERROR_FAIL;
     }
     physinfo->sharing_freed_pages = l;
@@ -5095,8 +5098,8 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     if (l < 0 && errno == ENOSYS) {
         l = 0;
     } else if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
-                            "getting sharing used frames");
+        LOGEV(ERROR, l, "getting sharing used frames");
+        GC_FREE;
         return ERROR_FAIL;
     }
     physinfo->sharing_used_frames = l;
@@ -5107,6 +5110,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     physinfo->cap_hvm_directio =
         !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm_directio);
 
+    GC_FREE;
     return 0;
 }
 
@@ -5447,20 +5451,26 @@ int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid,
 int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
                                   libxl_bitmap *nodemap)
 {
+    GC_INIT(ctx);
     if (xc_domain_node_setaffinity(ctx->xch, domid, nodemap->map)) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting node affinity");
+        LOGE(ERROR, "setting node affinity");
+        GC_FREE;
         return ERROR_FAIL;
     }
+    GC_FREE;
     return 0;
 }
 
 int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
                                   libxl_bitmap *nodemap)
 {
+    GC_INIT(ctx);
     if (xc_domain_node_getaffinity(ctx->xch, domid, nodemap->map)) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting node affinity");
+        LOGE(ERROR, "getting node affinity");
+        GC_FREE;
         return ERROR_FAIL;
     }
+    GC_FREE;
     return 0;
 }
 
@@ -5560,11 +5570,13 @@ out:
 libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
 {
     libxl_scheduler sched, ret;
-
+    GC_INIT(ctx);
     if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        LOGE(ERROR, "getting domain info list");
         return ERROR_FAIL;
+        GC_FREE;
     }
+    GC_FREE;
     return sched;
 }
 
@@ -5651,16 +5663,19 @@ int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
 {
     struct xen_sysctl_credit_schedule sparam;
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_sched_credit_params_get(ctx->xch, poolid, &sparam);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting sched credit param");
+        LOGE(ERROR, "getting sched credit param");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
     scinfo->tslice_ms = sparam.tslice_ms;
     scinfo->ratelimit_us = sparam.ratelimit_us;
 
+    GC_FREE;
     return 0;
 }
 
@@ -5669,26 +5684,25 @@ int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
 {
     struct xen_sysctl_credit_schedule sparam;
     int rc=0;
+    GC_INIT(ctx);
 
     if (scinfo->tslice_ms <  XEN_SYSCTL_CSCHED_TSLICE_MIN
         || scinfo->tslice_ms > XEN_SYSCTL_CSCHED_TSLICE_MAX) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-            "Time slice out of range, valid range is from %d to %d",
-                            XEN_SYSCTL_CSCHED_TSLICE_MIN,
-                            XEN_SYSCTL_CSCHED_TSLICE_MAX);
+        LOG(ERROR, "Time slice out of range, valid range is from %d to %d",
+            XEN_SYSCTL_CSCHED_TSLICE_MIN, XEN_SYSCTL_CSCHED_TSLICE_MAX);
+        GC_FREE;
         return ERROR_INVAL;
     }
     if (scinfo->ratelimit_us <  XEN_SYSCTL_SCHED_RATELIMIT_MIN
         || scinfo->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-            "Ratelimit out of range, valid range is from %d to %d",
-                            XEN_SYSCTL_SCHED_RATELIMIT_MIN,
-                            XEN_SYSCTL_SCHED_RATELIMIT_MAX);
+        LOG(ERROR, "Ratelimit out of range, valid range is from %d to %d",
+            XEN_SYSCTL_SCHED_RATELIMIT_MIN, XEN_SYSCTL_SCHED_RATELIMIT_MAX);
+        GC_FREE;
         return ERROR_INVAL;
     }
     if (scinfo->ratelimit_us > scinfo->tslice_ms*1000) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "Ratelimit cannot be greater than timeslice");
+        LOG(ERROR, "Ratelimit cannot be greater than timeslice");
+        GC_FREE;
         return ERROR_INVAL;
     }
 
@@ -5697,13 +5711,15 @@ int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
 
     rc = xc_sched_credit_params_set(ctx->xch, poolid, &sparam);
     if ( rc < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting sched credit param");
+        LOGE(ERROR, "setting sched credit param");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
     scinfo->tslice_ms = sparam.tslice_ms;
     scinfo->ratelimit_us = sparam.ratelimit_us;
 
+    GC_FREE;
     return 0;
 }
 
@@ -5956,9 +5972,8 @@ int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
     }
 
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Send trigger '%s' failed",
-                         libxl_trigger_to_string(trigger));
+        LOGE(ERROR, "Send trigger '%s' failed",
+             libxl_trigger_to_string(trigger));
         rc = ERROR_FAIL;
     }
 
@@ -5980,11 +5995,14 @@ int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq)
 int libxl_send_debug_keys(libxl_ctx *ctx, char *keys)
 {
     int ret;
+    GC_INIT(ctx);
     ret = xc_send_debug_keys(ctx->xch, keys);
     if ( ret < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "sending debug keys");
+        LOGE(ERROR, "sending debug keys");
+        GC_FREE;
         return ERROR_FAIL;
     }
+    GC_FREE;
     return 0;
 }
 
@@ -6019,12 +6037,14 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
                                 char **line_r)
 {
     int ret;
+    GC_INIT(ctx);
 
     memset(cr->buffer, 0, cr->size);
     ret = xc_readconsolering(ctx->xch, cr->buffer, &cr->count,
                              cr->clear, cr->incremental, &cr->index);
     if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "reading console ring buffer");
+        LOGE(ERROR, "reading console ring buffer");
+        GC_FREE;
         return ERROR_FAIL;
     }
     if (!ret) {
@@ -6037,6 +6057,7 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
         }
     }
 
+    GC_FREE;
     return ret;
 }
 
@@ -6059,8 +6080,7 @@ uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid)
     start_time = libxl__xs_read(
         gc, XBT_NULL, libxl__sprintf(gc, "%s/start_time", vm_path));
     if (start_time == NULL) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, -1,
-                        "Can't get start time of domain '%d'", domid);
+        LOGEV(ERROR, -1, "Can't get start time of domain '%d'", domid);
         ret = -1;
     }else{
         ret = strtoul(start_time, NULL, 10);
@@ -6073,45 +6093,51 @@ char *libxl_tmem_list(libxl_ctx *ctx, uint32_t domid, int use_long)
 {
     int rc;
     char _buf[32768];
+    GC_INIT(ctx);
 
     rc = xc_tmem_control(ctx->xch, -1, XEN_SYSCTL_TMEM_OP_LIST, domid, 32768, use_long,
                          _buf);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not get tmem list");
+        LOGEV(ERROR, rc, "Can not get tmem list");
+        GC_FREE;
         return NULL;
     }
 
+    GC_FREE;
     return strdup(_buf);
 }
 
 int libxl_tmem_freeze(libxl_ctx *ctx, uint32_t domid)
 {
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_tmem_control(ctx->xch, -1, XEN_SYSCTL_TMEM_OP_FREEZE, domid, 0, 0,
                          NULL);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not freeze tmem pools");
+        LOGEV(ERROR, rc, "Can not freeze tmem pools");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
 int libxl_tmem_thaw(libxl_ctx *ctx, uint32_t domid)
 {
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_tmem_control(ctx->xch, -1, XEN_SYSCTL_TMEM_OP_THAW, domid, 0, 0,
                          NULL);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not thaw tmem pools");
+        LOGEV(ERROR, rc, "Can not thaw tmem pools");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
@@ -6131,19 +6157,21 @@ int libxl_tmem_set(libxl_ctx *ctx, uint32_t domid, char* name, uint32_t set)
 {
     int rc;
     int32_t subop = tmem_setop_from_string(name);
+    GC_INIT(ctx);
 
     if (subop == -1) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, -1,
-            "Invalid set, valid sets are <weight|cap|compress>");
+        LOGEV(ERROR, -1, "Invalid set, valid sets are <weight|cap|compress>");
+        GC_FREE;
         return ERROR_INVAL;
     }
     rc = xc_tmem_control(ctx->xch, -1, subop, domid, set, 0, NULL);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not set tmem %s", name);
+        LOGEV(ERROR, rc, "Can not set tmem %s", name);
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
@@ -6151,28 +6179,32 @@ int libxl_tmem_shared_auth(libxl_ctx *ctx, uint32_t domid,
                            char* uuid, int auth)
 {
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_tmem_auth(ctx->xch, domid, uuid, auth);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not set tmem shared auth");
+        LOGEV(ERROR, rc, "Can not set tmem shared auth");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
 int libxl_tmem_freeable(libxl_ctx *ctx)
 {
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_tmem_control(ctx->xch, -1, XEN_SYSCTL_TMEM_OP_QUERY_FREEABLE_MB, -1, 0, 0, 0);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not get tmem freeable memory");
+        LOGEV(ERROR, rc, "Can not get tmem freeable memory");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
@@ -6212,8 +6244,7 @@ int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
 
     rc = xc_cpupool_create(ctx->xch, poolid, sched);
     if (rc) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-           "Could not create cpupool");
+        LOGEV(ERROR, rc, "Could not create cpupool");
         GC_FREE;
         return ERROR_FAIL;
     }
@@ -6222,8 +6253,7 @@ int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
         if (libxl_bitmap_test(&cpumap, i)) {
             rc = xc_cpupool_addcpu(ctx->xch, *poolid, i);
             if (rc) {
-                LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-                    "Error moving cpu to cpupool");
+                LOGEV(ERROR, rc, "Error moving cpu to cpupool");
                 libxl_cpupool_destroy(ctx, *poolid);
                 GC_FREE;
                 return ERROR_FAIL;
@@ -6275,8 +6305,7 @@ int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid)
         if (libxl_bitmap_test(&cpumap, i)) {
             rc = xc_cpupool_removecpu(ctx->xch, poolid, i);
             if (rc) {
-                LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-                    "Error removing cpu from cpupool");
+                LOGEV(ERROR, rc, "Error removing cpu from cpupool");
                 rc = ERROR_FAIL;
                 goto out1;
             }
@@ -6284,7 +6313,7 @@ int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid)
 
     rc = xc_cpupool_destroy(ctx->xch, poolid);
     if (rc) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc, "Could not destroy cpupool");
+        LOGEV(ERROR, rc, "Could not destroy cpupool");
         rc = ERROR_FAIL;
         goto out1;
     }
@@ -6494,8 +6523,7 @@ int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid)
 
     rc = xc_cpupool_movedomain(ctx->xch, poolid, domid);
     if (rc) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Error moving domain to cpupool");
+        LOGEV(ERROR, rc, "Error moving domain to cpupool");
         GC_FREE;
         return ERROR_FAIL;
     }
@@ -6509,10 +6537,12 @@ static int fd_set_flags(libxl_ctx *ctx, int fd,
                         int flagmask, int set_p)
 {
     int flags, r;
+    GC_INIT(ctx);
 
     flags = fcntl(fd, fcntlgetop);
     if (flags == -1) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "fcntl(,F_GET%s) failed",fl);
+        LOGE(ERROR, "fcntl(,F_GET%s) failed", fl);
+        GC_FREE;
         return ERROR_FAIL;
     }
 
@@ -6523,10 +6553,12 @@ static int fd_set_flags(libxl_ctx *ctx, int fd,
 
     r = fcntl(fd, fcntlsetop, flags);
     if (r == -1) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "fcntl(,F_SET%s) failed",fl);
+        LOGE(ERROR, "fcntl(,F_SET%s) failed", fl);
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return 0;
 }
 
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index bf2099b..30380ec 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -102,7 +102,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
                     b_info->device_model_version =
                         LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
                 } else {
-                    LIBXL__LOG_ERRNO(CTX, XTL_ERROR, "qemu-xen access error");
+                    LOGE(ERROR, "qemu-xen access error");
                     return ERROR_FAIL;
                 }
             }
@@ -148,7 +148,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         b_info->device_model_version !=
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
         libxl_defbool_val(b_info->device_model_stubdomain)) {
-        LIBXL__LOG(CTX, XTL_ERROR,
+        LOG(ERROR,
             "device model stubdomains require \"qemu-xen-traditional\"");
         return ERROR_INVAL;
     }
@@ -374,9 +374,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         }
         break;
     default:
-        LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                   "invalid domain type %s in create info",
-                   libxl_domain_type_to_string(b_info->type));
+        LOG(ERROR, "invalid domain type %s in create info",
+            libxl_domain_type_to_string(b_info->type));
         return ERROR_INVAL;
     }
     return 0;
@@ -522,7 +521,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
     ret = libxl__arch_domain_prepare_config(gc, d_config, xc_config);
     if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "fail to get domain config");
+        LOGE(ERROR, "fail to get domain config");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -533,8 +532,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
                                       handle, flags, domid,
                                       xc_config);
         if (ret < 0) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "domain creation fail");
+            LOGE(ERROR, "domain creation fail");
             rc = ERROR_FAIL;
             goto out;
         }
@@ -546,7 +544,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
     ret = xc_cpupool_movedomain(ctx->xch, info->poolid, *domid);
     if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain move fail");
+        LOGE(ERROR, "domain move fail");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -559,7 +557,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
     vm_path = libxl__sprintf(gc, "/vm/%s", uuid_string);
     if (!vm_path) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot allocate create paths");
+        LOG(ERROR, "cannot allocate create paths");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -661,8 +659,7 @@ retry_transaction:
             t = 0;
             goto retry_transaction;
         }
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain creation "
-                         "xenstore transaction commit failed");
+        LOGE(ERROR, "domain creation ""xenstore transaction commit failed");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -878,7 +875,7 @@ static void initiate_domain_create(libxl__egc *egc,
 
     ret = libxl__domain_make(gc, d_config, &domid, &state->config);
     if (ret) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
+        LOG(ERROR, "cannot make domain: %d", ret);
         dcs->guest_domid = domid;
         ret = ERROR_FAIL;
         goto error_out;
@@ -1141,10 +1138,9 @@ static void domcreate_rebuild_done(libxl__egc *egc,
     /* convenience aliases */
     const uint32_t domid = dcs->guest_domid;
     libxl_domain_config *const d_config = dcs->guest_config;
-    libxl_ctx *const ctx = CTX;
 
     if (ret) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot (re-)build domain: %d", ret);
+        LOG(ERROR, "cannot (re-)build domain: %d", ret);
         ret = ERROR_FAIL;
         goto error_out;
     }
@@ -1335,15 +1331,13 @@ static void domcreate_devmodel_started(libxl__egc *egc,
 {
     libxl__domain_create_state *dcs = CONTAINER_OF(dmss, *dcs, dmss.dm);
     STATE_AO_GC(dmss->spawn.ao);
-    libxl_ctx *ctx = CTX;
     int domid = dcs->guest_domid;
 
     /* convenience aliases */
     libxl_domain_config *const d_config = dcs->guest_config;
 
     if (ret) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "device model did not start: %d", ret);
+        LOG(ERROR, "device model did not start: %d", ret);
         goto error_out;
     }
 
@@ -1411,7 +1405,6 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
     libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev);
     STATE_AO_GC(dcs->ao);
     int i;
-    libxl_ctx *ctx = CTX;
     int domid = dcs->guest_domid;
 
     /* convenience aliases */
@@ -1425,8 +1418,7 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
     for (i = 0; i < d_config->num_pcidevs; i++) {
         ret = libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], 1);
         if (ret < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "libxl_device_pci_add failed: %d", ret);
+            LOG(ERROR, "libxl_device_pci_add failed: %d", ret);
             goto error_out;
         }
     }
@@ -1435,8 +1427,7 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
         ret = libxl__create_pci_backend(gc, domid, d_config->pcidevs,
             d_config->num_pcidevs);
         if (ret < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                "libxl_create_pci_backend failed: %d", ret);
+            LOG(ERROR, "libxl_create_pci_backend failed: %d", ret);
             goto error_out;
         }
     }
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 71a1a3e..cf8b535 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -61,7 +61,6 @@ static int libxl__create_qemu_logfile(libxl__gc *gc, char *name)
 const char *libxl__domain_device_model(libxl__gc *gc,
                                        const libxl_domain_build_info *info)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     const char *dm;
 
     if (libxl_defbool_val(info->device_model_stubdomain))
@@ -78,9 +77,8 @@ const char *libxl__domain_device_model(libxl__gc *gc,
             dm = qemu_xen_path(gc);
             break;
         default:
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "invalid device model version %d",
-                       info->device_model_version);
+            LOG(ERROR, "invalid device model version %d",
+                info->device_model_version);
             dm = NULL;
             break;
         }
@@ -666,20 +664,18 @@ static char *dm_spice_options(libxl__gc *gc,
     char *opt;
 
     if (!spice->port && !spice->tls_port) {
-        LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                   "at least one of the spiceport or tls_port must be provided");
+        LOG(ERROR,
+            "at least one of the spiceport or tls_port must be provided");
         return NULL;
     }
 
     if (!libxl_defbool_val(spice->disable_ticketing)) {
         if (!spice->passwd) {
-            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                       "spice ticketing is enabled but missing password");
+            LOG(ERROR, "spice ticketing is enabled but missing password");
             return NULL;
         }
         else if (!spice->passwd[0]) {
-            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                               "spice password can't be empty");
+            LOG(ERROR, "spice password can't be empty");
             return NULL;
         }
     }
@@ -731,7 +727,6 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                         const libxl__domain_build_state *state,
                                         int *dm_state_fd)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     const libxl_domain_create_info *c_info = &guest_config->c_info;
     const libxl_domain_build_info *b_info = &guest_config->b_info;
     const libxl_device_disk *disks = guest_config->disks;
@@ -1140,8 +1135,8 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             const char *pdev_path;
 
             if (dev_number == -1) {
-                LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "unable to determine"
-                           " disk number for %s", disks[i].vdev);
+                LOG(WARN, "unable to determine"" disk number for %s",
+                    disks[i].vdev);
                 continue;
             }
 
@@ -1156,19 +1151,21 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                          disks[i].pdev_path, disk, disks[i].readwrite ? "off" : "on", format, dev_number);
             } else {
                 if (!disks[i].readwrite) {
-                    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "qemu-xen doesn't support read-only disk drivers");
+                    LOG(ERROR,
+                        "qemu-xen doesn't support read-only disk drivers");
                     return ERROR_INVAL;
                 }
 
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
-                    LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "cannot support"
-                               " empty disk format for %s", disks[i].vdev);
+                    LOG(WARN, "cannot support"" empty disk format for %s",
+                        disks[i].vdev);
                     continue;
                 }
 
                 if (format == NULL) {
-                    LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "unable to determine"
-                               " disk image format %s", disks[i].vdev);
+                    LOG(WARN,
+                        "unable to determine"" disk image format %s",
+                        disks[i].vdev);
                     continue;
                 }
 
@@ -1235,8 +1232,6 @@ static int libxl__build_device_model_args(libxl__gc *gc,
 /* dm_state_fd may be NULL iff caller knows we are using old stubdom
  * and therefore will be passing a filename rather than a fd. */
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-
     switch (guest_config->b_info.device_model_version) {
     case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
         return libxl__build_device_model_args_old(gc, dm,
@@ -1251,8 +1246,8 @@ static int libxl__build_device_model_args(libxl__gc *gc,
                                                   args, envs,
                                                   state, dm_state_fd);
     default:
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model version %d",
-                         guest_config->b_info.device_model_version);
+        LOGE(ERROR, "unknown device model version %d",
+             guest_config->b_info.device_model_version);
         return ERROR_INVAL;
     }
 }
@@ -1479,9 +1474,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
                    "%d", guest_domid);
     ret = xc_domain_set_target(ctx->xch, dm_domid, guest_domid);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "setting target domain %d -> %d",
-                         dm_domid, guest_domid);
+        LOGE(ERROR, "setting target domain %d -> %d", dm_domid, guest_domid);
         ret = ERROR_FAIL;
         goto out;
     }
@@ -1740,8 +1733,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
         goto out;
     }
     if (access(dm, X_OK) < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "device model %s is not executable", dm);
+        LOGE(ERROR, "device model %s is not executable", dm);
         rc = ERROR_FAIL;
         goto out;
     }
@@ -1813,9 +1805,9 @@ retry_transaction:
         }
     }
 
-    LIBXL__LOG(CTX, XTL_DEBUG, "Spawning device-model %s with arguments:", dm);
+    LOG(DEBUG, "Spawning device-model %s with arguments:", dm);
     for (arg = args; *arg; arg++)
-        LIBXL__LOG(CTX, XTL_DEBUG, "  %s", *arg);
+        LOG(DEBUG, "  %s", *arg);
     if (*envs) {
         LOG(DEBUG, "Spawning device-model %s with additional environment:", dm);
         for (arg = envs; *arg; arg += 2)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b514377..b26ce57 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -216,8 +216,8 @@ static int hvm_set_viridian_features(libxl__gc *gc, uint32_t domid,
 
     libxl_for_each_set_bit(v, info->u.hvm.viridian_enable) {
         if (libxl_bitmap_test(&info->u.hvm.viridian_disable, v)) {
-            LIBXL__LOG(CTX, LIBXL__LOG_ERROR, "%s group both enabled and disabled",
-                       libxl_viridian_enlightenment_to_string(v));
+            LOG(ERROR, "%s group both enabled and disabled",
+                libxl_viridian_enlightenment_to_string(v));
             goto err;
         }
         if (libxl_viridian_enlightenment_to_string(v)) /* check validity */
@@ -231,7 +231,7 @@ static int hvm_set_viridian_features(libxl__gc *gc, uint32_t domid,
     /* The base set is a pre-requisite for all others */
     if (!libxl_bitmap_is_empty(&enlightenments) &&
         !libxl_bitmap_test(&enlightenments, LIBXL_VIRIDIAN_ENLIGHTENMENT_BASE)) {
-        LIBXL__LOG(CTX, LIBXL__LOG_ERROR, "base group not enabled");
+        LOG(ERROR, "base group not enabled");
         goto err;
     }
 
@@ -256,9 +256,7 @@ static int hvm_set_viridian_features(libxl__gc *gc, uint32_t domid,
                          domid,
                          HVM_PARAM_VIRIDIAN,
                          mask) != 0) {
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                         "Couldn't set viridian feature mask (0x%"PRIx64")",
-                         mask);
+        LOGE(ERROR, "Couldn't set viridian feature mask (0x%"PRIx64")", mask);
         goto err;
     }
 
@@ -404,7 +402,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
 
     if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
         LIBXL_MAXMEM_CONSTANT) < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't set max memory");
+        LOGE(ERROR, "Couldn't set max memory");
         return ERROR_FAIL;
     }
 
@@ -1992,8 +1990,7 @@ err:
     }
 
     if (rc)
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR, "cannot write/rename %s for %s",
-                 newfilename, filename);
+        LOGE(ERROR, "cannot write/rename %s for %s", newfilename, filename);
 out:
     return rc;
 }
@@ -2045,7 +2042,7 @@ int libxl__userdata_retrieve(libxl__gc *gc, uint32_t domid,
         goto out;
     }
     if (!e && !datalen) {
-        LIBXL__LOG(CTX, LIBXL__LOG_ERROR, "userdata file %s is empty", filename);
+        LOG(ERROR, "userdata file %s is empty", filename);
         if (data_r) assert(!*data_r);
         rc = ERROR_FAIL;
         goto out;
diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index bfb6b31..7d549ad 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -277,7 +277,7 @@ int libxl__gettimeofday(libxl__gc *gc, struct timeval *now_r)
 {
     int rc = gettimeofday(now_r, 0);
     if (rc) {
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR, "gettimeofday failed");
+        LOGE(ERROR, "gettimeofday failed");
         return ERROR_FAIL;
     }
     return 0;
@@ -523,9 +523,8 @@ static void watchfd_callback(libxl__egc *egc, libxl__ev_fd *ev,
         uint32_t counterval;
         int rc = sscanf(token, "%d/%"SCNx32, &slotnum, &counterval);
         if (rc != 2) {
-            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                       "watch epath=%s token=%s: failed to parse token",
-                       epath, token);
+            LOG(ERROR, "watch epath=%s token=%s: failed to parse token",
+                epath, token);
             /* oh well */
             goto ignore;
         }
@@ -540,9 +539,7 @@ static void watchfd_callback(libxl__egc *egc, libxl__ev_fd *ev,
         libxl__ev_xswatch *w = libxl__watch_slot_contents(gc, slotnum);
 
         if (!w) {
-            LIBXL__LOG(CTX, LIBXL__LOG_DEBUG,
-                       "watch epath=%s token=%s: empty slot",
-                       epath, token);
+            LOG(DEBUG, "watch epath=%s token=%s: empty slot", epath, token);
             goto ignore;
         }
 
@@ -639,8 +636,7 @@ int libxl__ev_xswatch_register(libxl__gc *gc, libxl__ev_xswatch *w,
         w, path, token, slotnum);
 
     if (!xs_watch(CTX->xsh, path, token)) {
-        LIBXL__LOG_ERRNOVAL(CTX, LIBXL__LOG_ERROR, errno,
-                            "create watch for path %s", path);
+        LOGEV(ERROR, errno, "create watch for path %s", path);
         rc = ERROR_FAIL;
         goto out_rc;
     }
@@ -679,8 +675,7 @@ void libxl__ev_xswatch_deregister(libxl__gc *gc, libxl__ev_xswatch *w)
         if (!xs_unwatch(CTX->xsh, w->path, token))
             /* Oh well, we will just get watch events forever more
              * and ignore them.  But we should complain to the log. */
-            LIBXL__LOG_ERRNOVAL(CTX, LIBXL__LOG_ERROR, errno,
-                                "remove watch for path %s", w->path);
+            LOGEV(ERROR, errno, "remove watch for path %s", w->path);
 
         libxl__ev_watch_slot *slot = &CTX->watch_slots[w->slotnum];
         LIBXL_SLIST_INSERT_HEAD(&CTX->watch_freeslots, slot, empty);
@@ -863,25 +858,24 @@ static void devstate_callback(libxl__egc *egc, libxl__xswait_state *xsw,
 
     if (rc) {
         if (rc == ERROR_TIMEDOUT)
-            LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "backend %s wanted state %d "
-                       " timed out", ds->w.path, ds->wanted);
+            LOG(DEBUG, "backend %s wanted state %d "" timed out", ds->w.path,
+                ds->wanted);
         goto out;
     }
     if (!sstate) {
-        LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "backend %s wanted state %d"
-                   " but it was removed", ds->w.path, ds->wanted);
+        LOG(DEBUG, "backend %s wanted state %d"" but it was removed",
+            ds->w.path, ds->wanted);
         rc = ERROR_INVAL;
         goto out;
     }
 
     int got = atoi(sstate);
     if (got == ds->wanted) {
-        LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "backend %s wanted state %d ok",
-                   ds->w.path, ds->wanted);
+        LOG(DEBUG, "backend %s wanted state %d ok", ds->w.path, ds->wanted);
         rc = 0;
     } else {
-        LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "backend %s wanted state %d"
-                   " still waiting state %d", ds->w.path, ds->wanted, got);
+        LOG(DEBUG, "backend %s wanted state %d"" still waiting state %d",
+            ds->w.path, ds->wanted, got);
         return;
     }
 
@@ -1705,7 +1699,7 @@ static int eventloop_iteration(libxl__egc *egc, libxl__poller *poller) {
         if (errno == EINTR)
             return 0; /* will go round again if caller requires */
 
-        LIBXL__LOG_ERRNOVAL(CTX, LIBXL__LOG_ERROR, errno, "poll failed");
+        LOGEV(ERROR, errno, "poll failed");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -1897,6 +1891,7 @@ static bool ao_work_outstanding(libxl__ao *ao)
 
 void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
 {
+    EGC_GC;
     libxl_ctx *ctx = libxl__gc_owner(&egc->gc);
     assert(ao->progress_reports_outstanding >= 0);
 
@@ -1909,7 +1904,7 @@ void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
             /* don't bother with this if we're not in the event loop */
             libxl__poller_wakeup(egc, ao->poller);
     } else if (ao->how.callback) {
-        LIBXL__LOG(ctx, XTL_DEBUG, "ao %p: complete for callback",ao);
+        LOG(DEBUG, "ao %p: complete for callback", ao);
         LIBXL_TAILQ_INSERT_TAIL(&egc->aos_for_callback, ao, entry_for_callback);
     } else {
         libxl_event *ev;
@@ -2001,8 +1996,9 @@ int libxl__ao_inprogress(libxl__ao *ao,
             rc = eventloop_iteration(&egc,ao->poller);
             if (rc) {
                 /* Oh dear, this is quite unfortunate. */
-                LIBXL__LOG(CTX, LIBXL__LOG_ERROR, "Error waiting for"
-                           " event during long-running operation (rc=%d)", rc);
+                LOG(ERROR,
+                    "Error waiting for"" event during long-running operation (rc=%d)",
+                    rc);
                 sleep(1);
                 /* It's either this or return ERROR_I_DONT_KNOW_WHETHER
                  * _THE_THING_YOU_ASKED_FOR_WILL_BE_DONE_LATER_WHEN
@@ -2041,7 +2037,7 @@ static int ao__abort(libxl_ctx *ctx, libxl__ao *parent)
     parent->aborting = 1;
 
     if (LIBXL_LIST_EMPTY(&parent->abortables)) {
-        LIBXL__LOG(ctx, XTL_DEBUG,
+        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG,
                    "ao %p: abort requested and noted, but no-one interested",
                    parent);
         rc = 0;
@@ -2061,8 +2057,8 @@ static int ao__abort(libxl_ctx *ctx, libxl__ao *parent)
         LIBXL_LIST_REMOVE(abrt, entry);
         abrt->registered = 0;
 
-        LIBXL__LOG(ctx, XTL_DEBUG, "ao %p: abrt=%p: aborting",
-                   parent, abrt->ao);
+        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG,
+                   "ao %p: abrt=%p: aborting", parent, abrt->ao);
         abrt->callback(&egc, abrt, ERROR_ABORTED);
 
         libxl__ctx_unlock(ctx);
diff --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c
index ecb30cf..df4aead 100644
--- a/tools/libxl/libxl_exec.c
+++ b/tools/libxl/libxl_exec.c
@@ -168,7 +168,6 @@ int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
                                                        void *userdata),
                                  void *check_callback_userdata)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char *p;
     unsigned int len;
     int rc = 0;
@@ -181,7 +180,7 @@ int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
 
     xsh = xs_daemon_open();
     if (xsh == NULL) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unable to open xenstore connection");
+        LOG(ERROR, "Unable to open xenstore connection");
         goto err;
     }
 
@@ -224,7 +223,7 @@ again:
             }
         }
     }
-    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "%s not ready", what);
+    LOG(ERROR, "%s not ready", what);
 
     xs_unwatch(xsh, path, path);
     xs_daemon_close(xsh);
diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index 366ea05..c69d6f9 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -336,27 +336,28 @@ _hidden int libxl__mac_is_default(libxl_mac *mac)
 
 _hidden int libxl__init_recursive_mutex(libxl_ctx *ctx, pthread_mutex_t *lock)
 {
+    GC_INIT(ctx);
     pthread_mutexattr_t attr;
     int rc = 0;
 
     if (pthread_mutexattr_init(&attr) != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Failed to init mutex attributes");
-        return ERROR_FAIL;
+        LOGE(ERROR, "Failed to init mutex attributes");
+        rc = ERROR_FAIL;
+        goto out;
     }
     if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Failed to set mutex attributes");
+        LOGE(ERROR, "Failed to set mutex attributes");
         rc = ERROR_FAIL;
         goto out;
     }
     if (pthread_mutex_init(lock, &attr) != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to init mutex");
+        LOGE(ERROR, "Failed to init mutex");
         rc = ERROR_FAIL;
         goto out;
     }
 out:
     pthread_mutexattr_destroy(&attr);
+    GC_FREE;
     return rc;
 }
 
@@ -374,9 +375,7 @@ int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid)
     }
 
     if (libxl_device_model_version_from_string(dm_version, &value) < 0) {
-        libxl_ctx *ctx = libxl__gc_owner(gc);
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "fatal: %s contain a wrong value (%s)", path, dm_version);
+        LOG(ERROR, "fatal: %s contain a wrong value (%s)", path, dm_version);
         return -1;
     }
     return value;
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 8434ec8..378f6b0 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -81,7 +81,6 @@ static int libxl__device_from_pcidev(libxl__gc *gc, uint32_t domid,
 int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
                               libxl_device_pci *pcidev, int num)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     flexarray_t *front = NULL;
     flexarray_t *back = NULL;
     libxl__device device;
@@ -92,7 +91,7 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
 
     ret = 0;
 
-    LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Creating pci backend");
+    LOG(DEBUG, "Creating pci backend");
 
     /* add pci device */
     libxl__device_from_pcidev(gc, domid, pcidev, &device);
@@ -119,7 +118,6 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
 
 static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int starting)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     flexarray_t *back;
     char *num_devs, *be_path;
     int num = 0;
@@ -150,7 +148,7 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d
 
     back = flexarray_make(gc, 16, 1);
 
-    LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Adding new pci device to xenstore");
+    LOG(DEBUG, "Adding new pci device to xenstore");
     num = atoi(num_devs);
     libxl_create_pci_backend_device(gc, back, num, pcidev);
     flexarray_append_pair(back, "num_devs", libxl__sprintf(gc, "%d", num + 1));
@@ -214,7 +212,7 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
 
     if (domtype == LIBXL_DOMAIN_TYPE_PV) {
         if (libxl__wait_for_backend(gc, be_path, GCSPRINTF("%d", XenbusStateConnected)) < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "pci backend at %s is not ready", be_path);
+            LOG(DEBUG, "pci backend at %s is not ready", be_path);
             return ERROR_FAIL;
         }
     }
@@ -229,7 +227,7 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
         }
     }
     if (i == num) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Couldn't find the device on xenstore");
+        LOG(ERROR, "Couldn't find the device on xenstore");
         return ERROR_INVAL;
     }
 
@@ -243,7 +241,7 @@ retry_transaction:
 
     if (domtype == LIBXL_DOMAIN_TYPE_PV) {
         if (libxl__wait_for_backend(gc, be_path, GCSPRINTF("%d", XenbusStateConnected)) < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "pci backend at %s is not ready", be_path);
+            LOG(DEBUG, "pci backend at %s is not ready", be_path);
             return ERROR_FAIL;
         }
     }
@@ -374,14 +372,12 @@ static int is_pcidev_in_array(libxl_device_pci *assigned, int num_assigned,
 static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
                            libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int rc, fd;
     char *buf;
 
     fd = open(sysfs_path, O_WRONLY);
     if (fd < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s",
-                         sysfs_path);
+        LOGE(ERROR, "Couldn't open %s", sysfs_path);
         return ERROR_FAIL;
     }
 
@@ -390,8 +386,7 @@ static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
     rc = write(fd, buf, strlen(buf));
     /* Annoying to have two if's, but we need the errno */
     if (rc < 0)
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "write to %s returned %d", sysfs_path, rc);
+        LOGE(ERROR, "write to %s returned %d", sysfs_path, rc);
     close(fd);
 
     if (rc < 0)
@@ -417,9 +412,9 @@ libxl_device_pci *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *num)
     dir = opendir(SYSFS_PCIBACK_DRIVER);
     if ( NULL == dir ) {
         if ( errno == ENOENT ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Looks like pciback driver not loaded");
+            LOG(ERROR, "Looks like pciback driver not loaded");
         }else{
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", SYSFS_PCIBACK_DRIVER);
+            LOGE(ERROR, "Couldn't open %s", SYSFS_PCIBACK_DRIVER);
         }
         goto out_closedir;
     }
@@ -456,7 +451,6 @@ out:
 static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
                             char **driver_path)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char * spath, *dp = NULL;
     struct stat st;
 
@@ -470,17 +464,16 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
         dp = libxl__zalloc(gc, PATH_MAX);
         dp = realpath(spath, dp);
         if ( !dp ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "realpath() failed");
+            LOGE(ERROR, "realpath() failed");
             return -1;
         }
 
-        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Driver re-plug path: %s",
-                   dp);
+        LOG(DEBUG, "Driver re-plug path: %s", dp);
 
         /* Unbind from the old driver */
         spath = libxl__sprintf(gc, "%s/unbind", dp);
         if ( sysfs_write_bdf(gc, spath, pcidev) < 0 ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't unbind device");
+            LOGE(ERROR, "Couldn't unbind device");
             return -1;
         }
     }
@@ -633,7 +626,6 @@ bool libxl__is_igd_vga_passthru(libxl__gc *gc,
 /* Scan through /sys/.../pciback/slots looking for pcidev's BDF */
 static int pciback_dev_has_slot(libxl__gc *gc, libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     FILE *f;
     int rc = 0;
     unsigned dom, bus, dev, func;
@@ -641,8 +633,7 @@ static int pciback_dev_has_slot(libxl__gc *gc, libxl_device_pci *pcidev)
     f = fopen(SYSFS_PCIBACK_DRIVER"/slots", "r");
 
     if (f == NULL) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s",
-                         SYSFS_PCIBACK_DRIVER"/slots");
+        LOGE(ERROR, "Couldn't open %s", SYSFS_PCIBACK_DRIVER"/slots");
         return ERROR_FAIL;
     }
 
@@ -662,18 +653,15 @@ out:
 
 static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char * spath;
     int rc;
     struct stat st;
 
     if ( access(SYSFS_PCIBACK_DRIVER, F_OK) < 0 ) {
         if ( errno == ENOENT ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "Looks like pciback driver is not loaded");
+            LOG(ERROR, "Looks like pciback driver is not loaded");
         } else {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "Can't access "SYSFS_PCIBACK_DRIVER);
+            LOGE(ERROR, "Can't access "SYSFS_PCIBACK_DRIVER);
         }
         return -1;
     }
@@ -687,31 +675,27 @@ static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pcidev)
         return 1;
     if ( rc < 0 && errno == ENOENT )
         return 0;
-    LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Accessing %s", spath);
+    LOGE(ERROR, "Accessing %s", spath);
     return -1;
 }
 
 static int pciback_dev_assign(libxl__gc *gc, libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int rc;
 
     if ( (rc=pciback_dev_has_slot(gc, pcidev)) < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Error checking for pciback slot");
+        LOGE(ERROR, "Error checking for pciback slot");
         return ERROR_FAIL;
     } else if (rc == 0) {
         if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/new_slot",
                              pcidev) < 0 ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                       "Couldn't bind device to pciback!");
+            LOGE(ERROR, "Couldn't bind device to pciback!");
             return ERROR_FAIL;
         }
     }
 
     if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/bind", pcidev) < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Couldn't bind device to pciback!");
+        LOGE(ERROR, "Couldn't bind device to pciback!");
         return ERROR_FAIL;
     }
     return 0;
@@ -719,11 +703,9 @@ static int pciback_dev_assign(libxl__gc *gc, libxl_device_pci *pcidev)
 
 static int pciback_dev_unassign(libxl__gc *gc, libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-
     /* Remove from pciback */
     if ( sysfs_dev_unbind(gc, pcidev, NULL) < 0 ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Couldn't unbind device!");
+        LOG(ERROR, "Couldn't unbind device!");
         return ERROR_FAIL;
     }
 
@@ -731,8 +713,7 @@ static int pciback_dev_unassign(libxl__gc *gc, libxl_device_pci *pcidev)
     if ( pciback_dev_has_slot(gc, pcidev) > 0 ) {
         if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/remove_slot",
                              pcidev) < 0 ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "Couldn't remove pciback slot");
+            LOGE(ERROR, "Couldn't remove pciback slot");
             return ERROR_FAIL;
         }
     }
@@ -745,7 +726,6 @@ static void pci_assignable_driver_path_write(libxl__gc *gc,
                                             libxl_device_pci *pcidev,
                                             char *driver_path)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char *path;
 
     path = libxl__sprintf(gc, PCIBACK_INFO_PATH"/"PCI_BDF_XSPATH"/driver_path",
@@ -754,9 +734,7 @@ static void pci_assignable_driver_path_write(libxl__gc *gc,
                           pcidev->dev,
                           pcidev->func);
     if ( libxl__xs_write(gc, XBT_NULL, path, "%s", driver_path) < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_WARNING,
-                         "Write of %s to node %s failed.",
-                         driver_path, path);
+        LOGE(WARN, "Write of %s to node %s failed.", driver_path, path);
     }
 }
 
@@ -805,7 +783,7 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
     /* See if the device exists */
     spath = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF, dom, bus, dev, func);
     if ( lstat(spath, &st) ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't lstat %s", spath);
+        LOGE(ERROR, "Couldn't lstat %s", spath);
         return ERROR_FAIL;
     }
 
@@ -847,7 +825,7 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
     }
 
     if ( pciback_dev_assign(gc, pcidev) ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Couldn't bind device to pciback!");
+        LOG(ERROR, "Couldn't bind device to pciback!");
         return ERROR_FAIL;
     }
 
@@ -858,7 +836,6 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
                                                libxl_device_pci *pcidev,
                                                int rebind)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int rc;
     char *driver_path;
 
@@ -868,8 +845,7 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
     } else if ( rc ) {
         pciback_dev_unassign(gc, pcidev);
     } else {
-        LIBXL__LOG(ctx, LIBXL__LOG_WARNING,
-                   "Not bound to pciback");
+        LOG(WARN, "Not bound to pciback");
     }
 
     /* Rebind if necessary */
@@ -877,14 +853,12 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
 
     if ( driver_path ) {
         if ( rebind ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_INFO, "Rebinding to driver at %s",
-                       driver_path);
+            LOG(INFO, "Rebinding to driver at %s", driver_path);
 
             if ( sysfs_write_bdf(gc,
                                  libxl__sprintf(gc, "%s/bind", driver_path),
                                  pcidev) < 0 ) {
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                                 "Couldn't bind device to %s", driver_path);
+                LOGE(ERROR, "Couldn't bind device to %s", driver_path);
                 return -1;
             }
 
@@ -892,8 +866,8 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
         }
     } else {
         if ( rebind ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_WARNING,
-                       "Couldn't find path for original driver; not rebinding");
+            LOG(WARN,
+                "Couldn't find path for original driver; not rebinding");
         }
     }
 
@@ -940,7 +914,7 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi
 
     dir = opendir(SYSFS_PCI_DEV);
     if ( NULL == dir ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", SYSFS_PCI_DEV);
+        LOGE(ERROR, "Couldn't open %s", SYSFS_PCI_DEV);
         return -1;
     }
 
@@ -964,7 +938,7 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi
                 LIBXL__LOG(ctx, LIBXL__LOG_ERROR, PCI_BDF " is not assigned to pciback driver",
                        dom, bus, dev, func);
             else
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't lstat %s", path);
+                LOGE(ERROR, "Couldn't lstat %s", path);
             closedir(dir);
             return -1;
         }
@@ -1020,11 +994,9 @@ static int qemu_pci_add_xenstore(libxl__gc *gc, uint32_t domid,
     vdevfn = libxl__xs_read(gc, XBT_NULL, path);
     path = libxl__device_model_xs_path(gc, dm_domid, domid, "/state");
     if ( rc < 0 )
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "qemu refused to add device: %s", vdevfn);
+        LOG(ERROR, "qemu refused to add device: %s", vdevfn);
     else if ( sscanf(vdevfn, "0x%x", &pcidev->vdevfn) != 1 ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "wrong format for the vdevfn: '%s'", vdevfn);
+        LOG(ERROR, "wrong format for the vdevfn: '%s'", vdevfn);
         rc = -1;
     }
     xs_write(ctx->xsh, XBT_NULL, path, state, strlen(state));
@@ -1072,7 +1044,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     irq = 0;
 
     if (f == NULL) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", sysfs_path);
+        LOGE(ERROR, "Couldn't open %s", sysfs_path);
         return ERROR_FAIL;
     }
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
@@ -1083,7 +1055,10 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
             if (flags & PCI_BAR_IO) {
                 rc = xc_domain_ioport_permission(ctx->xch, domid, start, size, 1);
                 if (rc < 0) {
-                    LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Error: xc_domain_ioport_permission error 0x%llx/0x%llx", start, size);
+                    LOGE(ERROR,
+                         "Error: xc_domain_ioport_permission error 0x%llx/0x%llx",
+                         start,
+                         size);
                     fclose(f);
                     return ERROR_FAIL;
                 }
@@ -1091,7 +1066,10 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
                 rc = xc_domain_iomem_permission(ctx->xch, domid, start>>XC_PAGE_SHIFT,
                                                 (size+(XC_PAGE_SIZE-1))>>XC_PAGE_SHIFT, 1);
                 if (rc < 0) {
-                    LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Error: xc_domain_iomem_permission error 0x%llx/0x%llx", start, size);
+                    LOGE(ERROR,
+                         "Error: xc_domain_iomem_permission error 0x%llx/0x%llx",
+                         start,
+                         size);
                     fclose(f);
                     return ERROR_FAIL;
                 }
@@ -1103,19 +1081,19 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
                                 pcidev->bus, pcidev->dev, pcidev->func);
     f = fopen(sysfs_path, "r");
     if (f == NULL) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", sysfs_path);
+        LOGE(ERROR, "Couldn't open %s", sysfs_path);
         goto out;
     }
     if ((fscanf(f, "%u", &irq) == 1) && irq) {
         rc = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
         if (rc < 0) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Error: xc_physdev_map_pirq irq=%d", irq);
+            LOGE(ERROR, "Error: xc_physdev_map_pirq irq=%d", irq);
             fclose(f);
             return ERROR_FAIL;
         }
         rc = xc_domain_irq_permission(ctx->xch, domid, irq, 1);
         if (rc < 0) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Error: xc_domain_irq_permission irq=%d", irq);
+            LOGE(ERROR, "Error: xc_domain_irq_permission irq=%d", irq);
             fclose(f);
             return ERROR_FAIL;
         }
@@ -1126,8 +1104,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     if (pcidev->permissive) {
         if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/permissive",
                              pcidev) < 0 ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "Setting permissive for device");
+            LOG(ERROR, "Setting permissive for device");
             return ERROR_FAIL;
         }
     }
@@ -1137,12 +1114,12 @@ out:
         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.");
+            LOGE(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");
+            LOGE(ERROR, "xc_assign_device failed");
             return ERROR_FAIL;
         }
     }
@@ -1167,25 +1144,25 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
         char *buf = libxl__sprintf(gc, PCI_BDF, domain, bus, dev, func);
         rc = write(fd, buf, strlen(buf));
         if (rc < 0)
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "write to %s returned %d", reset, rc);
+            LOG(ERROR, "write to %s returned %d", reset, rc);
         close(fd);
         return rc < 0 ? rc : 0;
     }
     if (errno != ENOENT)
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to access pciback path %s", reset);
+        LOGE(ERROR, "Failed to access pciback path %s", reset);
     reset = libxl__sprintf(gc, "%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func);
     fd = open(reset, O_WRONLY);
     if (fd >= 0) {
         rc = write(fd, "1", 1);
         if (rc < 0)
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "write to %s returned %d", reset, rc);
+            LOGE(ERROR, "write to %s returned %d", reset, rc);
         close(fd);
         return rc < 0 ? rc : 0;
     }
     if (errno == ENOENT) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF, domain, bus, dev, func);
     } else {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to access reset path %s", reset);
+        LOGE(ERROR, "Failed to access reset path %s", reset);
     }
     return -1;
 }
@@ -1264,12 +1241,13 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
 
     rc = get_all_assigned_devices(gc, &assigned, &num_assigned);
     if ( rc ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
+        LOG(ERROR,
+            "cannot determine if device is assigned, refusing to continue");
         goto out;
     }
     if ( is_pcidev_in_array(assigned, num_assigned, pcidev->domain,
                      pcidev->bus, pcidev->dev, pcidev->func) ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device already attached to a domain");
+        LOG(ERROR, "PCI device already attached to a domain");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -1289,7 +1267,7 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
 
     if ( pcidev->vfunc_mask == LIBXL_PCI_FUNC_ALL ) {
         if ( !(pcidev->vdevfn >> 3) ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Must specify a v-slot for multi-function devices");
+            LOG(ERROR, "Must specify a v-slot for multi-function devices");
             rc = ERROR_INVAL;
             goto out;
         }
@@ -1346,7 +1324,7 @@ static int qemu_pci_remove_xenstore(libxl__gc *gc, uint32_t domid,
         libxl__qemu_traditional_cmd(gc, domid, "pci-rem");
         if (libxl__wait_for_device_model_deprecated(gc, domid, "pci-removed",
                                          NULL, NULL, NULL) < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model didn't respond in time");
+            LOG(ERROR, "Device Model didn't respond in time");
             /* This depends on guest operating system acknowledging the
              * SCI, if it doesn't respond in time then we may wish to
              * force the removal.
@@ -1379,7 +1357,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
     rc = ERROR_INVAL;
     if ( !is_pcidev_in_array(assigned, num, pcidev->domain,
                       pcidev->bus, pcidev->dev, pcidev->func) ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device not attached to this domain");
+        LOG(ERROR, "PCI device not attached to this domain");
         goto out_fail;
     }
 
@@ -1416,7 +1394,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
         int i;
 
         if (f == NULL) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", sysfs_path);
+            LOGE(ERROR, "Couldn't open %s", sysfs_path);
             goto skip1;
         }
         for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
@@ -1427,12 +1405,18 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
                 if (flags & PCI_BAR_IO) {
                     rc = xc_domain_ioport_permission(ctx->xch, domid, start, size, 0);
                     if (rc < 0)
-                        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_domain_ioport_permission error 0x%x/0x%x", start, size);
+                        LOGE(ERROR,
+                             "xc_domain_ioport_permission error 0x%x/0x%x",
+                             start,
+                             size);
                 } else {
                     rc = xc_domain_iomem_permission(ctx->xch, domid, start>>XC_PAGE_SHIFT,
                                                     (size+(XC_PAGE_SIZE-1))>>XC_PAGE_SHIFT, 0);
                     if (rc < 0)
-                        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_domain_iomem_permission error 0x%x/0x%x", start, size);
+                        LOGE(ERROR,
+                             "xc_domain_iomem_permission error 0x%x/0x%x",
+                             start,
+                             size);
                 }
             }
         }
@@ -1442,17 +1426,17 @@ skip1:
                                    pcidev->bus, pcidev->dev, pcidev->func);
         f = fopen(sysfs_path, "r");
         if (f == NULL) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", sysfs_path);
+            LOGE(ERROR, "Couldn't open %s", sysfs_path);
             goto out;
         }
         if ((fscanf(f, "%u", &irq) == 1) && irq) {
             rc = xc_physdev_unmap_pirq(ctx->xch, domid, irq);
             if (rc < 0) {
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_physdev_unmap_pirq irq=%d", irq);
+                LOGE(ERROR, "xc_physdev_unmap_pirq irq=%d", irq);
             }
             rc = xc_domain_irq_permission(ctx->xch, domid, irq, 0);
             if (rc < 0) {
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_domain_irq_permission irq=%d", irq);
+                LOGE(ERROR, "xc_domain_irq_permission irq=%d", irq);
             }
         }
         fclose(f);
@@ -1466,7 +1450,7 @@ out:
     if (!libxl_is_stubdom(ctx, domid, NULL)) {
         rc = xc_deassign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev));
         if (rc < 0 && (hvm || errno != ENOSYS))
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_deassign_device failed");
+            LOGE(ERROR, "xc_deassign_device failed");
     }
 
     stubdomid = libxl_get_stubdom_id(ctx, domid);
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 408ec85..2eba584 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -402,28 +402,27 @@ int libxl_read_file_contents(libxl_ctx *ctx, const char *filename,
                            constdata void *data, ssize_t sz,              \
                            const char *source, const char *what) {        \
       ssize_t got;                                                        \
+      GC_INIT(ctx);                                                       \
                                                                           \
       while (sz > 0) {                                                    \
           got = rw(fd, data, sz);                                         \
           if (got == -1) {                                                \
               if (errno == EINTR) continue;                               \
-              if (!ctx) return errno;                                     \
-              LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "failed to " #rw " %s%s%s", \
-                           what?what:"", what?" from ":"", source);       \
+              if (!ctx) { GC_FREE; return errno; }                        \
+              LOGE(ERROR, "failed to "#rw" %s%s%s", what ? what : "", what ? " from " : "", source);       \
+              GC_FREE;                                                    \
               return errno;                                               \
           }                                                               \
           if (got == 0) {                                                 \
-              if (!ctx) return EPROTO;                                    \
-              LIBXL__LOG(ctx, LIBXL__LOG_ERROR,                                   \
-                     zero_is_eof                                          \
-                     ? "file/stream truncated reading %s%s%s"             \
-                     : "file/stream write returned 0! writing %s%s%s",    \
-                     what?what:"", what?" from ":"", source);             \
+              if (!ctx) { GC_FREE; return  EPROTO; }                      \
+              LOG(ERROR, zero_is_eof ? "file/stream truncated reading %s%s%s" : "file/stream write returned 0! writing %s%s%s", what ? what : "", what ? " from " : "", source);             \
+              GC_FREE;                                                    \
               return EPROTO;                                              \
           }                                                               \
           sz -= got;                                                      \
           data = (char*)data + got;                                       \
       }                                                                   \
+      GC_FREE;                                                            \
       return 0;                                                           \
   }
 
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 896f34c..a3e50df 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -30,7 +30,7 @@ static const char *e820_names(int type)
     return "Unknown";
 }
 
-static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
+static int e820_sanitize(libxl__gc *gc, struct e820entry src[],
                          uint32_t *nr_entries,
                          unsigned long map_limitkb,
                          unsigned long balloon_kb)
@@ -91,7 +91,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
     ram_end = e820[idx].addr + e820[idx].size;
     idx ++;
 
-    LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Memory: %"PRIu64"kB End of RAM: " \
+    LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "Memory: %"PRIu64"kB End of RAM: " \
                "0x%"PRIx64" (PFN) Delta: %"PRIu64"kB, PCI start: %"PRIu64"kB " \
                "(0x%"PRIx64" PFN), Balloon %"PRIu64"kB\n", (uint64_t)map_limitkb,
                ram_end >> 12, delta_kb, start_kb ,start >> 12,
@@ -150,7 +150,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
             if (src[i].addr + src[i].size != end) {
                 /* We messed up somewhere */
                 src[i].type = 0;
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Computed E820 wrongly. Continuing on.");
+                LOGE(ERROR, "Computed E820 wrongly. Continuing on.");
             }
         }
         /* Lastly, convert the RAM to UNSUABLE. Look in the Linux kernel
@@ -212,9 +212,8 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
     nr = idx;
 
     for (i = 0; i < nr; i++) {
-      LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, ":\t[%"PRIx64" -> %"PRIx64"] %s",
-                 e820[i].addr >> 12, (e820[i].addr + e820[i].size) >> 12,
-                 e820_names(e820[i].type));
+      LOG(DEBUG, ":\t[%"PRIx64" -> %"PRIx64"] %s", e820[i].addr >> 12,
+          (e820[i].addr + e820[i].size) >> 12, e820_names(e820[i].type));
     }
 
     /* Done: copy the sanitized version. */
@@ -236,7 +235,7 @@ static int e820_host_sanitize(libxl__gc *gc,
 
     *nr = rc;
 
-    rc = e820_sanitize(CTX, map, nr, b_info->target_memkb,
+    rc = e820_sanitize(gc, map, nr, b_info->target_memkb,
                        (b_info->max_memkb - b_info->target_memkb) +
                        b_info->u.pv.slack_memkb);
     return rc;
@@ -335,9 +334,8 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
             libxl_defbool_val(d_config->b_info.u.pv.e820_host)) {
         ret = libxl__e820_alloc(gc, domid, d_config);
         if (ret) {
-            LIBXL__LOG_ERRNO(gc->owner, LIBXL__LOG_ERROR,
-                    "Failed while collecting E820 with: %d (errno:%d)\n",
-                    ret, errno);
+            LOGE(ERROR, "Failed while collecting E820 with: %d (errno:%d)\n",
+                 ret, errno);
         }
     }
 
diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c
index d7eaa66..b0db062 100644
--- a/tools/libxl/libxl_xshelp.c
+++ b/tools/libxl/libxl_xshelp.c
@@ -130,8 +130,7 @@ char *libxl__xs_get_dompath(libxl__gc *gc, uint32_t domid)
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char *s = xs_get_domain_path(ctx->xsh, domid);
     if (!s) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "failed to get dompath for %" PRIu32,
-                     domid);
+        LOGE(ERROR, "failed to get dompath for %"PRIu32, domid);
         return NULL;
     }
     libxl__ptr_add(gc, s);
@@ -160,10 +159,9 @@ bool libxl__xs_mkdir(libxl__gc *gc, xs_transaction_t t,
 
 char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char *s = libxl__sprintf(gc, "/libxl/%i", domid);
     if (!s)
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot allocate create paths");
+        LOG(ERROR, "cannot allocate create paths");
     return s;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:34:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34: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 1Zo1DR-0000MY-7l; Mon, 19 Oct 2015 03:34: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 1Zo1DP-0000MB-Ge
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:28 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	15/03-30270-2C464265; Mon, 19 Oct 2015 03:34:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1445225660!11027139!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 10973 invoked from network); 19 Oct 2015 03:34:21 -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;
	19 Oct 2015 03:34:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DI-0005ba-O9
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DI-00045d-KF
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:20 +0000
Date: Mon, 19 Oct 2015 03:34:20 +0000
Message-Id: <E1Zo1DI-00045d-KF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: convert to use LOG() macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db82cd9251eb55a55242d6a713f710cd72d18fb0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 2 15:56:38 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:30:36 2015 +0100

    libxl: convert to use LOG() macro
    
    This patch converts most LIBXL__LOG* macros to LOG macro. It's done with
    spatch plus some hand coding.
    
    Using spatch rune:
    
        spatch --in-place --no-includes --include-headers \
            --sp-file libxl.spatch \
            tools/libxl/libxl*.c
    
    with some exceptions.
    
    libxl_json.c is untouched because the notion of ctx is in fact referring
    to yajl context.
    
    libxl_qmp.c is untouched because libxl ctx is buried in qmp context.
    
    libxl_fork.c is untouched because it's clearer to just use original
    code.
    
    Some fallouts are dealt with manually. There are three categories.
    
    Functions that don't have gc defined. Add gc definition with GC_INIT.
    Also try my best to make them conform with libxl coding style.
    
     * libxl_list_domain
     * libxl_domain_info
     * libxl_domain_pause
     * libxl_get_physinfo
     * libxl_domain_set_nodeaffinity
     * libxl_domain_get_nodeaffinity
     * libxl_get_scheduler
     * libxl_sched_credit_params_get
     * libxl_sched_credit_params_set
     * libxl_send_debug_keys
     * libxl_xen_console_read_line
     * libxl_tmem_list
     * libxl_tmem_freeze
     * libxl_tmem_thaw
     * libxl_tmem_set
     * libxl_tmem_shared_auth
     * libxl_tmem_freeable
     * libxl_fd_set_cloexec
     * libxl_fd_set_nonblock
     * libxl__init_recursive_mutex
     * READ_WRITE_EXACTLY
     * libxl__ao_complete_check_progress_reports
    
    Functions don't need ctx variable anymore after conversion. Delete that
    variable.
    
     * libxl__device_from_disk
     * domcreate_rebuild_done
     * domcreate_devmodel_started
     * domcreate_attach_pci
     * libxl__domain_device_model
     * libxl__build_device_model_args_new
     * libxl__build_device_model_args
     * libxl__create_pci_backend
     * libxl__device_pci_add_xenstore
     * sysfs_write_bdf
     * sysfs_dev_unbind
     * pciback_dev_has_slot
     * pciback_dev_is_assigned
     * pciback_dev_assign
     * pciback_dev_unassign
     * pci_assignable_driver_path_write
     * libxl__device_pci_assignable_remove
     * libxl__xenstore_child_wait_deprecated
     * libxl__xs_libxl_path
     * libxl__device_model_version_running
    
    Special handling for some functions.
    
     * ao__abort: easier to just use original code.
     * e820_sanitize: should have taken gc instead of ctx
    
    =====
    virtual patch
    virtual context
    virtual org
    virtual report
    
    @level1@
    identifier FN =~ "LIBXL__LOG|LIBXL__LOG_ERRNO|LIBXL__LOG_ERRNOVAL";
    constant l1 =~ "(LIBXL__LOG|XTL)_(DEBUG|INFO|WARNING|ERROR)";
    expression ctx;
    @@
    FN(ctx, l1, ...);
    
    @script:python level2@
    l1 << level1.l1;
    l2;
    @@
    
    import re
    coccinelle.l2 = re.sub("LIBXL__LOG_|XTL_", "", l1);
    if coccinelle.l2 == "WARNING": coccinelle.l2 = "WARN"
    
    @log10@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    @@
    -LIBXL__LOG(ctx, l1, fmt);
    +LOG(l2, fmt);
    
    @log11@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression arg1;
    @@
    -LIBXL__LOG(ctx, l1, fmt, arg1);
    +LOG(l2, fmt, arg1);
    
    @log12@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression arg1, arg2;
    @@
    -LIBXL__LOG(ctx, l1, fmt, arg1, arg2);
    +LOG(l2, fmt, arg1, arg2);
    
    @log13@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression arg1, arg2, arg3;
    @@
    -LIBXL__LOG(ctx, l1, fmt, arg1, arg2, arg3);
    +LOG(l2, fmt, arg1, arg2, arg3);
    
    @log20@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    @@
    -LIBXL__LOG_ERRNO(ctx, l1, fmt);
    +LOGE(l2, fmt);
    
    @log21@
    expression ctx;
    expression fmt;
    constant level1.l1;
    identifier level2.l2;
    expression arg1;
    @@
    -LIBXL__LOG_ERRNO(ctx, l1, fmt, arg1);
    +LOGE(l2, fmt, arg1);
    
    @log22@
    expression ctx;
    expression fmt;
    constant level1.l1;
    identifier level2.l2;
    expression arg1, arg2;
    @@
    -LIBXL__LOG_ERRNO(ctx, l1, fmt, arg1, arg2);
    +LOGE(l2, fmt, arg1, arg2);
    
    @log23@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression arg1, arg2, arg3;
    @@
    -LIBXL__LOG_ERRNO(ctx, l1, fmt, arg1, arg2, arg3);
    +LOGE(l2, fmt, arg1, arg2, arg3);
    
    @log30@
    expression fmt;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression errnoval;
    @@
    -LIBXL__LOG_ERRNOVAL(ctx, l1, errnoval, fmt);
    +LOGEV(l2, errnoval, fmt);
    
    @log31@
    expression fmt;
    expression arg1;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression errnoval;
    @@
    -LIBXL__LOG_ERRNOVAL(ctx, l1, errnoval, fmt, arg1);
    +LOGEV(l2, errnoval, fmt, arg1);
    
    @log32@
    expression fmt;
    expression arg1, arg2;
    expression ctx;
    constant level1.l1;
    identifier level2.l2;
    expression errnoval;
    @@
    -LIBXL__LOG_ERRNOVAL(ctx, l1, errnoval, fmt, arg1, arg2);
    +LOGEV(l2, errnoval, fmt, arg1, arg2);
    =====
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c          |  386 +++++++++++++++++++++++-------------------
 tools/libxl/libxl_create.c   |   37 ++---
 tools/libxl/libxl_dm.c       |   50 +++---
 tools/libxl/libxl_dom.c      |   17 +-
 tools/libxl/libxl_event.c    |   48 +++---
 tools/libxl/libxl_exec.c     |    5 +-
 tools/libxl/libxl_internal.c |   17 +-
 tools/libxl/libxl_pci.c      |  158 ++++++++----------
 tools/libxl/libxl_utils.c    |   17 +-
 tools/libxl/libxl_x86.c      |   18 +-
 tools/libxl/libxl_xshelp.c   |    6 +-
 11 files changed, 372 insertions(+), 387 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index e4ea476..1b754c8 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -90,7 +90,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
     /* The mutex is special because we can't idempotently destroy it */
 
     if (libxl__init_recursive_mutex(ctx, &ctx->lock) < 0) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to initialize mutex");
+        LOG(ERROR, "Failed to initialize mutex");
         free(ctx);
         ctx = 0;
         rc = ERROR_FAIL;
@@ -402,15 +402,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     if (!trans) {
         trans = our_trans = xs_transaction_start(ctx->xsh);
         if (!our_trans) {
-            LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
-                            "create xs transaction for domain (re)name");
+            LOGEV(ERROR, errno, "create xs transaction for domain (re)name");
             goto x_fail;
         }
     }
 
     if (!new_name) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                        "new domain name not specified");
+        LOG(ERROR, "new domain name not specified");
         rc = ERROR_INVAL;
         goto x_rc;
     }
@@ -422,16 +420,14 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         if (rc == ERROR_INVAL) {
             /* no such domain, good */
         } else if (rc != 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "unexpected error"
-                       "checking for existing domain");
+            LOG(ERROR, "unexpected error""checking for existing domain");
             goto x_rc;
         } else if (domid_e == domid) {
             /* domain already has this name, ok (but we do still
              * need the rest of the code as we may need to check
              * old_name, for example). */
         } else {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "domain with name \"%s\""
-                       " already exists.", new_name);
+            LOG(ERROR, "domain with name \"%s\""" already exists.", new_name);
             rc = ERROR_INVAL;
             goto x_rc;
         }
@@ -440,15 +436,18 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     if (old_name) {
         got_old_name = xs_read(ctx->xsh, trans, name_path, &got_old_len);
         if (!got_old_name) {
-            LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno, "check old name"
-                            " for domain %"PRIu32" allegedly named `%s'",
-                            domid, old_name);
+            LOGEV(ERROR, errno,
+                  "check old name"" for domain %"PRIu32" allegedly named `%s'",
+                  domid,
+                  old_name);
             goto x_fail;
         }
         if (strcmp(old_name, got_old_name)) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "domain %"PRIu32" allegedly named "
-                   "`%s' is actually named `%s' - racing ?",
-                   domid, old_name, got_old_name);
+            LOG(ERROR,
+                "domain %"PRIu32" allegedly named ""`%s' is actually named `%s' - racing ?",
+                domid,
+                old_name,
+                got_old_name);
             free(got_old_name);
             goto x_fail;
         }
@@ -456,9 +455,11 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     }
     if (!xs_write(ctx->xsh, trans, name_path,
                   new_name, strlen(new_name))) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "failed to write new name `%s'"
-               " for domain %"PRIu32" previously named `%s'",
-               new_name, domid, old_name);
+        LOG(ERROR,
+            "failed to write new name `%s'"" for domain %"PRIu32" previously named `%s'",
+            new_name,
+            domid,
+            old_name);
         goto x_fail;
     }
 
@@ -487,14 +488,18 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         if (!xs_transaction_end(ctx->xsh, our_trans, 0)) {
             trans = our_trans = 0;
             if (errno != EAGAIN) {
-                LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "failed to commit new name `%s'"
-                       " for domain %"PRIu32" previously named `%s'",
-                       new_name, domid, old_name);
+                LOG(ERROR,
+                    "failed to commit new name `%s'"" for domain %"PRIu32" previously named `%s'",
+                    new_name,
+                    domid,
+                    old_name);
                 goto x_fail;
             }
-            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "need to retry rename transaction"
-                   " for domain %"PRIu32" (name_path=\"%s\", new_name=\"%s\")",
-                   domid, name_path, new_name);
+            LOG(DEBUG,
+                "need to retry rename transaction"" for domain %"PRIu32" (name_path=\"%s\", new_name=\"%s\")",
+                domid,
+                name_path,
+                new_name);
             goto retry_transaction;
         }
         our_trans = 0;
@@ -644,17 +649,20 @@ libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out)
     int i, ret;
     xc_domaininfo_t info[1024];
     int size = 1024;
+    GC_INIT(ctx);
 
     ptr = calloc(size, sizeof(libxl_dominfo));
     if (!ptr) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating domain info");
+        LOGE(ERROR, "allocating domain info");
+        GC_FREE;
         return NULL;
     }
 
     ret = xc_domain_getinfolist(ctx->xch, 0, 1024, info);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        LOGE(ERROR, "getting domain info list");
         free(ptr);
+        GC_FREE;
         return NULL;
     }
 
@@ -662,6 +670,7 @@ libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out)
         xcinfo2xlinfo(ctx, &info[i], &ptr[i]);
     }
     *nb_domain_out = ret;
+    GC_FREE;
     return ptr;
 }
 
@@ -669,16 +678,22 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r,
                       uint32_t domid) {
     xc_domaininfo_t xcinfo;
     int ret;
+    GC_INIT(ctx);
 
     ret = xc_domain_getinfolist(ctx->xch, domid, 1, &xcinfo);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        LOGE(ERROR, "getting domain info list");
+        GC_FREE;
         return ERROR_FAIL;
     }
-    if (ret==0 || xcinfo.domain != domid) return ERROR_DOMAIN_NOTFOUND;
+    if (ret==0 || xcinfo.domain != domid) {
+        GC_FREE;
+        return ERROR_DOMAIN_NOTFOUND;
+    }
 
     if (info_r)
         xcinfo2xlinfo(ctx, &xcinfo, info_r);
+    GC_FREE;
     return 0;
 }
 
@@ -787,7 +802,7 @@ libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
 
     ret = xc_domain_getinfolist(ctx->xch, 1, ARRAY_SIZE(info), info);
     if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        LOGE(ERROR, "getting domain info list");
         goto out;
     }
 
@@ -1001,11 +1016,14 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
 int libxl_domain_pause(libxl_ctx *ctx, uint32_t domid)
 {
     int ret;
+    GC_INIT(ctx);
     ret = xc_domain_pause(ctx->xch, domid);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "pausing domain %d", domid);
+        LOGE(ERROR, "pausing domain %d", domid);
+        GC_FREE;
         return ERROR_FAIL;
     }
+    GC_FREE;
     return 0;
 }
 
@@ -1018,8 +1036,7 @@ int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid,
 
     ret = xc_domain_dumpcore(ctx->xch, domid, filename);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "core dumping domain %d to %s",
-                     domid, filename);
+        LOGE(ERROR, "core dumping domain %d to %s", domid, filename);
         rc = ERROR_FAIL;
         goto out;
     }
@@ -1053,7 +1070,7 @@ int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid)
     }
     ret = xc_domain_unpause(ctx->xch, domid);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unpausing domain %d", domid);
+        LOGE(ERROR, "unpausing domain %d", domid);
         rc = ERROR_FAIL;
     }
  out:
@@ -1077,7 +1094,7 @@ int libxl__domain_pvcontrol_available(libxl__gc *gc, uint32_t domid)
 
     ret = xc_hvm_param_get(ctx->xch, domid, HVM_PARAM_CALLBACK_IRQ, &pvdriver);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting HVM callback IRQ");
+        LOGE(ERROR, "getting HVM callback IRQ");
         return ERROR_FAIL;
     }
     return !!pvdriver;
@@ -1160,7 +1177,7 @@ static void domain_death_occurred(libxl__egc *egc,
     EGC_GC;
     libxl_evgen_domain_death *const evg = *evg_upd;
 
-    LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "%s", why);
+    LOG(DEBUG, "%s", why);
 
     libxl_evgen_domain_death *evg_next = LIBXL_TAILQ_NEXT(evg, entry);
     *evg_upd = evg_next;
@@ -1208,7 +1225,7 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
 
         for (;;) {
             if (!evg) {
-                LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "[evg=0] all reported");
+                LOG(DEBUG, "[evg=0] all reported");
                 goto all_reported;
             }
 
@@ -1223,7 +1240,7 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
             }
 
             if (got == gotend) {
-                LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " got==gotend");
+                LOG(DEBUG, " got==gotend");
                 break;
             }
 
@@ -1240,9 +1257,8 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
             }
 
             assert(evg->domid == got->domain);
-            LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " exists shutdown_reported=%d"
-                       " dominf.flags=%x",
-                       evg->shutdown_reported, got->flags);
+            LOG(DEBUG, " exists shutdown_reported=%d"" dominf.flags=%x",
+                evg->shutdown_reported, got->flags);
 
             if (got->flags & XEN_DOMINF_dying) {
                 domain_death_occurred(egc, &evg, "dying");
@@ -1254,7 +1270,7 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
                 libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN,
                                             got->domain, evg->user);
 
-                LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " shutdown reporting");
+                LOG(DEBUG, " shutdown reporting");
 
                 ev->u.domain_shutdown.shutdown_reason =
                     (got->flags >> XEN_DOMINF_shutdownshift) &
@@ -1271,7 +1287,7 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
  all_reported:
  out:
 
-    LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "domain death search done");
+    LOG(DEBUG, "domain death search done");
 
     CTX_UNLOCK;
 }
@@ -1590,7 +1606,7 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
     case 0:
         break;
     case ERROR_DOMAIN_NOTFOUND:
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "non-existant domain %d", domid);
+        LOG(ERROR, "non-existant domain %d", domid);
     default:
         goto out;
     }
@@ -1620,14 +1636,14 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
     }
 
     if (libxl__device_pci_destroy_all(gc, domid) < 0)
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "pci shutdown failed for domid %d", domid);
+        LOG(ERROR, "pci shutdown failed for domid %d", domid);
     rc = xc_domain_pause(ctx->xch, domid);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc, "xc_domain_pause failed for %d", domid);
+        LOGEV(ERROR, rc, "xc_domain_pause failed for %d", domid);
     }
     if (dm_present) {
         if (libxl__destroy_device_model(gc, domid) < 0)
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "libxl__destroy_device_model failed for %d", domid);
+            LOG(ERROR, "libxl__destroy_device_model failed for %d", domid);
 
         libxl__qmp_cleanup(gc, domid);
     }
@@ -1663,16 +1679,15 @@ static void devices_destroy_cb(libxl__egc *egc,
     }
 
     if (rc < 0)
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, 
-                   "libxl__devices_destroy failed for %d", domid);
+        LOG(ERROR, "libxl__devices_destroy failed for %d", domid);
 
     vm_path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/vm", dom_path));
     if (vm_path)
         if (!xs_rm(ctx->xsh, XBT_NULL, vm_path))
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xs_rm failed for %s", vm_path);
+            LOGE(ERROR, "xs_rm failed for %s", vm_path);
 
     if (!xs_rm(ctx->xsh, XBT_NULL, dom_path))
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xs_rm failed for %s", dom_path);
+        LOGE(ERROR, "xs_rm failed for %s", dom_path);
 
     xs_rm(ctx->xsh, XBT_NULL, libxl__xs_libxl_path(gc, domid));
     xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc,
@@ -1942,15 +1957,13 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
         char tmpname[] = "/tmp/vncautopass.XXXXXX";
         autopass_fd = mkstemp(tmpname);
         if ( autopass_fd < 0 ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "mkstemp %s failed", tmpname);
+            LOGE(ERROR, "mkstemp %s failed", tmpname);
             goto x_fail;
         }
 
         if ( unlink(tmpname) ) {
             /* should never happen */
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "unlink %s failed", tmpname);
+            LOGE(ERROR, "unlink %s failed", tmpname);
             goto x_fail;
         }
 
@@ -1959,8 +1972,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
             goto x_fail;
 
         if ( lseek(autopass_fd, SEEK_SET, 0) ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "rewind %s (autopass) failed", tmpname);
+            LOGE(ERROR, "rewind %s (autopass) failed", tmpname);
             goto x_fail;
         }
 
@@ -2353,13 +2365,12 @@ int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
                                    libxl_device_disk *disk,
                                    libxl__device *device)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int devid;
 
     devid = libxl__device_disk_dev_number(disk->vdev, NULL, NULL);
     if (devid==-1) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Invalid or unsupported"
-               " virtual disk identifier %s", disk->vdev);
+        LOG(ERROR, "Invalid or unsupported"" virtual disk identifier %s",
+            disk->vdev);
         return ERROR_INVAL;
     }
 
@@ -2377,8 +2388,7 @@ int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
             device->backend_kind = LIBXL__DEVICE_KIND_QDISK;
             break;
         default:
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "unrecognized disk backend type: %d", disk->backend);
+            LOG(ERROR, "unrecognized disk backend type: %d", disk->backend);
             return ERROR_INVAL;
     }
 
@@ -2471,8 +2481,8 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
         GCNEW(device);
         rc = libxl__device_from_disk(gc, domid, disk, device);
         if (rc != 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Invalid or unsupported"
-                   " virtual disk identifier %s", disk->vdev);
+            LOG(ERROR, "Invalid or unsupported"" virtual disk identifier %s",
+                disk->vdev);
             goto out;
         }
 
@@ -2544,9 +2554,8 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                 assert(device->backend_kind == LIBXL__DEVICE_KIND_QDISK);
                 break;
             default:
-                LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                           "unrecognized disk backend type: %d",
-                           disk->backend);
+                LOG(ERROR, "unrecognized disk backend type: %d",
+                    disk->backend);
                 rc = ERROR_INVAL;
                 goto out;
         }
@@ -2805,7 +2814,7 @@ libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *n
     return disks;
 
 out_err:
-    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unable to list disks");
+    LOG(ERROR, "Unable to list disks");
     while (disks && *num) {
         (*num)--;
         libxl_device_disk_dispose(&disks[*num]);
@@ -2909,7 +2918,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         }
     }
     if (i == num) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Virtual device not found");
+        LOG(ERROR, "Virtual device not found");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -2968,8 +2977,8 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/frontend", path));
         if (!tmp)
         {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
-                       libxl__sprintf(gc, "%s/frontend", path));
+            LOG(ERROR, "Internal error: %s does not exist",
+                libxl__sprintf(gc, "%s/frontend", path));
             rc = ERROR_FAIL;
             goto out;
         }
@@ -3000,8 +3009,8 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/frontend", path));
         if (!tmp)
         {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Internal error: %s does not exist",
-                       libxl__sprintf(gc, "%s/frontend", path));
+            LOG(ERROR, "Internal error: %s does not exist",
+                libxl__sprintf(gc, "%s/frontend", path));
             rc = ERROR_FAIL;
             goto out;
         }
@@ -3572,7 +3581,7 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num
     return nics;
 
 out_err:
-    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unable to list nics");
+    LOG(ERROR, "Unable to list nics");
     while (*num) {
         (*num)--;
         libxl_device_nic_dispose(&nics[*num]);
@@ -4604,27 +4613,24 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t max_memkb)
 
     mem = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/memory/target", dompath));
     if (!mem) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "cannot get memory info from %s/memory/target",
-                         dompath);
+        LOGE(ERROR, "cannot get memory info from %s/memory/target", dompath);
         goto out;
     }
     memorykb = strtoul(mem, &endptr, 10);
     if (*endptr != '\0') {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "invalid memory %s from %s/memory/target\n", mem, dompath);
+        LOGE(ERROR, "invalid memory %s from %s/memory/target\n", mem, dompath);
         goto out;
     }
 
     if (max_memkb < memorykb) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "memory_static_max must be greater than or or equal to memory_dynamic_max");
+        LOGE(ERROR,
+             "memory_static_max must be greater than or or equal to memory_dynamic_max");
         goto out;
     }
     rc = xc_domain_setmaxmem(ctx->xch, domid, max_memkb + LIBXL_MAXMEM_CONSTANT);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                "xc_domain_setmaxmem domid=%d memkb=%d failed "
-                "rc=%d\n", domid, max_memkb + LIBXL_MAXMEM_CONSTANT, rc);
+        LOGE(ERROR, "xc_domain_setmaxmem domid=%d memkb=%d failed ""rc=%d\n",
+             domid, max_memkb + LIBXL_MAXMEM_CONSTANT, rc);
         goto out;
     }
 
@@ -4663,8 +4669,8 @@ retry_transaction:
     if (target) {
         *target_memkb = strtoul(target, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s\n", target, target_path);
+            LOGE(ERROR, "invalid memory target %s from %s\n", target,
+                 target_path);
             rc = ERROR_FAIL;
             goto out;
         }
@@ -4673,9 +4679,8 @@ retry_transaction:
     if (staticmax) {
         *max_memkb = strtoul(staticmax, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "invalid memory static-max %s from %s\n",
-                             staticmax, max_path);
+            LOGE(ERROR, "invalid memory static-max %s from %s\n", staticmax,
+                 max_path);
             rc = ERROR_FAIL;
             goto out;
         }
@@ -4755,17 +4760,15 @@ retry_transaction:
             goto out_no_transaction;
         goto retry_transaction;
     } else if (!target) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "cannot get target memory info from %s/memory/target",
-                         dompath);
+        LOGE(ERROR, "cannot get target memory info from %s/memory/target",
+             dompath);
         abort_transaction = 1;
         goto out;
     } else {
         current_target_memkb = strtoul(target, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s/memory/target\n",
-                    target, dompath);
+            LOGE(ERROR, "invalid memory target %s from %s/memory/target\n",
+                 target, dompath);
             abort_transaction = 1;
             goto out;
         }
@@ -4773,17 +4776,15 @@ retry_transaction:
     memmax = libxl__xs_read(gc, t, libxl__sprintf(gc,
                 "%s/memory/static-max", dompath));
     if (!memmax) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "cannot get memory info from %s/memory/static-max",
-                         dompath);
+        LOGE(ERROR, "cannot get memory info from %s/memory/static-max",
+             dompath);
         abort_transaction = 1;
         goto out;
     }
     memorykb = strtoul(memmax, &endptr, 10);
     if (*endptr != '\0') {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                "invalid max memory %s from %s/memory/static-max\n",
-                memmax, dompath);
+        LOGE(ERROR, "invalid max memory %s from %s/memory/static-max\n",
+             memmax, dompath);
         abort_transaction = 1;
         goto out;
     }
@@ -4800,17 +4801,15 @@ retry_transaction:
     } else
         new_target_memkb = target_memkb - videoram;
     if (new_target_memkb > memorykb) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                "memory_dynamic_max must be less than or equal to"
-                " memory_static_max\n");
+        LOG(ERROR,
+            "memory_dynamic_max must be less than or equal to"" memory_static_max\n");
         abort_transaction = 1;
         goto out;
     }
 
     if (!domid && new_target_memkb < LIBXL_MIN_DOM0_MEM) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "new target %d for dom0 is below the minimum threshold",
-                   new_target_memkb);
+        LOG(ERROR, "new target %d for dom0 is below the minimum threshold",
+            new_target_memkb);
         abort_transaction = 1;
         goto out;
     }
@@ -4820,9 +4819,11 @@ retry_transaction:
         rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb +
                 LIBXL_MAXMEM_CONSTANT);
         if (rc != 0) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                    "xc_domain_setmaxmem domid=%u memkb=%"PRIu64" failed "
-                    "rc=%d\n", domid, memorykb + LIBXL_MAXMEM_CONSTANT, rc);
+            LOGE(ERROR,
+                 "xc_domain_setmaxmem domid=%u memkb=%"PRIu64" failed ""rc=%d\n",
+                 domid,
+                 memorykb + LIBXL_MAXMEM_CONSTANT,
+                 rc);
             abort_transaction = 1;
             goto out;
         }
@@ -4831,10 +4832,11 @@ retry_transaction:
     rc = xc_domain_set_pod_target(ctx->xch, domid,
             new_target_memkb / 4, NULL, NULL, NULL);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                "xc_domain_set_pod_target domid=%d, memkb=%d "
-                "failed rc=%d\n", domid, new_target_memkb / 4,
-                rc);
+        LOGE(ERROR,
+             "xc_domain_set_pod_target domid=%d, memkb=%d ""failed rc=%d\n",
+             domid,
+             new_target_memkb / 4,
+             rc);
         abort_transaction = 1;
         goto out;
     }
@@ -4889,28 +4891,27 @@ static int libxl__get_memory_target(libxl__gc *gc, uint32_t domid,
         if (rc < 0)
             goto out;
     } else if (!target) {
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                         "cannot get target memory info from %s/memory/target",
-                         dompath);
+        LOGE(ERROR, "cannot get target memory info from %s/memory/target",
+             dompath);
         goto out;
     } else if (!static_max) {
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                "cannot get target memory info from %s/memory/static-max",
-                dompath);
+        LOGE(ERROR,
+             "cannot get target memory info from %s/memory/static-max",
+             dompath);
         goto out;
     } else {
         target_memkb = strtoul(target, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s/memory/target\n",
-                    target, dompath);
+            LOGE(ERROR, "invalid memory target %s from %s/memory/target\n",
+                 target, dompath);
             goto out;
         }
         max_memkb = strtoul(static_max, &endptr, 10);
         if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s/memory/static-max\n",
-                    static_max, dompath);
+            LOGE(ERROR,
+                 "invalid memory target %s from %s/memory/static-max\n",
+                 static_max,
+                 dompath);
             goto out;
         }
 
@@ -5067,10 +5068,12 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     xc_physinfo_t xcphysinfo = { 0 };
     int rc;
     long l;
+    GC_INIT(ctx);
 
     rc = xc_physinfo(ctx->xch, &xcphysinfo);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting physinfo");
+        LOGE(ERROR, "getting physinfo");
+        GC_FREE;
         return ERROR_FAIL;
     }
     physinfo->threads_per_core = xcphysinfo.threads_per_core;
@@ -5086,8 +5089,8 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     if (l < 0 && errno == ENOSYS) {
         l = 0;
     } else if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
-                            "getting sharing freed pages");
+        LOGEV(ERROR, l, "getting sharing freed pages");
+        GC_FREE;
         return ERROR_FAIL;
     }
     physinfo->sharing_freed_pages = l;
@@ -5095,8 +5098,8 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     if (l < 0 && errno == ENOSYS) {
         l = 0;
     } else if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, l,
-                            "getting sharing used frames");
+        LOGEV(ERROR, l, "getting sharing used frames");
+        GC_FREE;
         return ERROR_FAIL;
     }
     physinfo->sharing_used_frames = l;
@@ -5107,6 +5110,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     physinfo->cap_hvm_directio =
         !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm_directio);
 
+    GC_FREE;
     return 0;
 }
 
@@ -5447,20 +5451,26 @@ int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid,
 int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
                                   libxl_bitmap *nodemap)
 {
+    GC_INIT(ctx);
     if (xc_domain_node_setaffinity(ctx->xch, domid, nodemap->map)) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting node affinity");
+        LOGE(ERROR, "setting node affinity");
+        GC_FREE;
         return ERROR_FAIL;
     }
+    GC_FREE;
     return 0;
 }
 
 int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
                                   libxl_bitmap *nodemap)
 {
+    GC_INIT(ctx);
     if (xc_domain_node_getaffinity(ctx->xch, domid, nodemap->map)) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting node affinity");
+        LOGE(ERROR, "getting node affinity");
+        GC_FREE;
         return ERROR_FAIL;
     }
+    GC_FREE;
     return 0;
 }
 
@@ -5560,11 +5570,13 @@ out:
 libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
 {
     libxl_scheduler sched, ret;
-
+    GC_INIT(ctx);
     if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        LOGE(ERROR, "getting domain info list");
         return ERROR_FAIL;
+        GC_FREE;
     }
+    GC_FREE;
     return sched;
 }
 
@@ -5651,16 +5663,19 @@ int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
 {
     struct xen_sysctl_credit_schedule sparam;
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_sched_credit_params_get(ctx->xch, poolid, &sparam);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting sched credit param");
+        LOGE(ERROR, "getting sched credit param");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
     scinfo->tslice_ms = sparam.tslice_ms;
     scinfo->ratelimit_us = sparam.ratelimit_us;
 
+    GC_FREE;
     return 0;
 }
 
@@ -5669,26 +5684,25 @@ int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
 {
     struct xen_sysctl_credit_schedule sparam;
     int rc=0;
+    GC_INIT(ctx);
 
     if (scinfo->tslice_ms <  XEN_SYSCTL_CSCHED_TSLICE_MIN
         || scinfo->tslice_ms > XEN_SYSCTL_CSCHED_TSLICE_MAX) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-            "Time slice out of range, valid range is from %d to %d",
-                            XEN_SYSCTL_CSCHED_TSLICE_MIN,
-                            XEN_SYSCTL_CSCHED_TSLICE_MAX);
+        LOG(ERROR, "Time slice out of range, valid range is from %d to %d",
+            XEN_SYSCTL_CSCHED_TSLICE_MIN, XEN_SYSCTL_CSCHED_TSLICE_MAX);
+        GC_FREE;
         return ERROR_INVAL;
     }
     if (scinfo->ratelimit_us <  XEN_SYSCTL_SCHED_RATELIMIT_MIN
         || scinfo->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-            "Ratelimit out of range, valid range is from %d to %d",
-                            XEN_SYSCTL_SCHED_RATELIMIT_MIN,
-                            XEN_SYSCTL_SCHED_RATELIMIT_MAX);
+        LOG(ERROR, "Ratelimit out of range, valid range is from %d to %d",
+            XEN_SYSCTL_SCHED_RATELIMIT_MIN, XEN_SYSCTL_SCHED_RATELIMIT_MAX);
+        GC_FREE;
         return ERROR_INVAL;
     }
     if (scinfo->ratelimit_us > scinfo->tslice_ms*1000) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "Ratelimit cannot be greater than timeslice");
+        LOG(ERROR, "Ratelimit cannot be greater than timeslice");
+        GC_FREE;
         return ERROR_INVAL;
     }
 
@@ -5697,13 +5711,15 @@ int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
 
     rc = xc_sched_credit_params_set(ctx->xch, poolid, &sparam);
     if ( rc < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting sched credit param");
+        LOGE(ERROR, "setting sched credit param");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
     scinfo->tslice_ms = sparam.tslice_ms;
     scinfo->ratelimit_us = sparam.ratelimit_us;
 
+    GC_FREE;
     return 0;
 }
 
@@ -5956,9 +5972,8 @@ int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
     }
 
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Send trigger '%s' failed",
-                         libxl_trigger_to_string(trigger));
+        LOGE(ERROR, "Send trigger '%s' failed",
+             libxl_trigger_to_string(trigger));
         rc = ERROR_FAIL;
     }
 
@@ -5980,11 +5995,14 @@ int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq)
 int libxl_send_debug_keys(libxl_ctx *ctx, char *keys)
 {
     int ret;
+    GC_INIT(ctx);
     ret = xc_send_debug_keys(ctx->xch, keys);
     if ( ret < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "sending debug keys");
+        LOGE(ERROR, "sending debug keys");
+        GC_FREE;
         return ERROR_FAIL;
     }
+    GC_FREE;
     return 0;
 }
 
@@ -6019,12 +6037,14 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
                                 char **line_r)
 {
     int ret;
+    GC_INIT(ctx);
 
     memset(cr->buffer, 0, cr->size);
     ret = xc_readconsolering(ctx->xch, cr->buffer, &cr->count,
                              cr->clear, cr->incremental, &cr->index);
     if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "reading console ring buffer");
+        LOGE(ERROR, "reading console ring buffer");
+        GC_FREE;
         return ERROR_FAIL;
     }
     if (!ret) {
@@ -6037,6 +6057,7 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
         }
     }
 
+    GC_FREE;
     return ret;
 }
 
@@ -6059,8 +6080,7 @@ uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid)
     start_time = libxl__xs_read(
         gc, XBT_NULL, libxl__sprintf(gc, "%s/start_time", vm_path));
     if (start_time == NULL) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, -1,
-                        "Can't get start time of domain '%d'", domid);
+        LOGEV(ERROR, -1, "Can't get start time of domain '%d'", domid);
         ret = -1;
     }else{
         ret = strtoul(start_time, NULL, 10);
@@ -6073,45 +6093,51 @@ char *libxl_tmem_list(libxl_ctx *ctx, uint32_t domid, int use_long)
 {
     int rc;
     char _buf[32768];
+    GC_INIT(ctx);
 
     rc = xc_tmem_control(ctx->xch, -1, XEN_SYSCTL_TMEM_OP_LIST, domid, 32768, use_long,
                          _buf);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not get tmem list");
+        LOGEV(ERROR, rc, "Can not get tmem list");
+        GC_FREE;
         return NULL;
     }
 
+    GC_FREE;
     return strdup(_buf);
 }
 
 int libxl_tmem_freeze(libxl_ctx *ctx, uint32_t domid)
 {
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_tmem_control(ctx->xch, -1, XEN_SYSCTL_TMEM_OP_FREEZE, domid, 0, 0,
                          NULL);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not freeze tmem pools");
+        LOGEV(ERROR, rc, "Can not freeze tmem pools");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
 int libxl_tmem_thaw(libxl_ctx *ctx, uint32_t domid)
 {
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_tmem_control(ctx->xch, -1, XEN_SYSCTL_TMEM_OP_THAW, domid, 0, 0,
                          NULL);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not thaw tmem pools");
+        LOGEV(ERROR, rc, "Can not thaw tmem pools");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
@@ -6131,19 +6157,21 @@ int libxl_tmem_set(libxl_ctx *ctx, uint32_t domid, char* name, uint32_t set)
 {
     int rc;
     int32_t subop = tmem_setop_from_string(name);
+    GC_INIT(ctx);
 
     if (subop == -1) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, -1,
-            "Invalid set, valid sets are <weight|cap|compress>");
+        LOGEV(ERROR, -1, "Invalid set, valid sets are <weight|cap|compress>");
+        GC_FREE;
         return ERROR_INVAL;
     }
     rc = xc_tmem_control(ctx->xch, -1, subop, domid, set, 0, NULL);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not set tmem %s", name);
+        LOGEV(ERROR, rc, "Can not set tmem %s", name);
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
@@ -6151,28 +6179,32 @@ int libxl_tmem_shared_auth(libxl_ctx *ctx, uint32_t domid,
                            char* uuid, int auth)
 {
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_tmem_auth(ctx->xch, domid, uuid, auth);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not set tmem shared auth");
+        LOGEV(ERROR, rc, "Can not set tmem shared auth");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
 int libxl_tmem_freeable(libxl_ctx *ctx)
 {
     int rc;
+    GC_INIT(ctx);
 
     rc = xc_tmem_control(ctx->xch, -1, XEN_SYSCTL_TMEM_OP_QUERY_FREEABLE_MB, -1, 0, 0, 0);
     if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not get tmem freeable memory");
+        LOGEV(ERROR, rc, "Can not get tmem freeable memory");
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return rc;
 }
 
@@ -6212,8 +6244,7 @@ int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
 
     rc = xc_cpupool_create(ctx->xch, poolid, sched);
     if (rc) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-           "Could not create cpupool");
+        LOGEV(ERROR, rc, "Could not create cpupool");
         GC_FREE;
         return ERROR_FAIL;
     }
@@ -6222,8 +6253,7 @@ int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
         if (libxl_bitmap_test(&cpumap, i)) {
             rc = xc_cpupool_addcpu(ctx->xch, *poolid, i);
             if (rc) {
-                LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-                    "Error moving cpu to cpupool");
+                LOGEV(ERROR, rc, "Error moving cpu to cpupool");
                 libxl_cpupool_destroy(ctx, *poolid);
                 GC_FREE;
                 return ERROR_FAIL;
@@ -6275,8 +6305,7 @@ int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid)
         if (libxl_bitmap_test(&cpumap, i)) {
             rc = xc_cpupool_removecpu(ctx->xch, poolid, i);
             if (rc) {
-                LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-                    "Error removing cpu from cpupool");
+                LOGEV(ERROR, rc, "Error removing cpu from cpupool");
                 rc = ERROR_FAIL;
                 goto out1;
             }
@@ -6284,7 +6313,7 @@ int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid)
 
     rc = xc_cpupool_destroy(ctx->xch, poolid);
     if (rc) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc, "Could not destroy cpupool");
+        LOGEV(ERROR, rc, "Could not destroy cpupool");
         rc = ERROR_FAIL;
         goto out1;
     }
@@ -6494,8 +6523,7 @@ int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid)
 
     rc = xc_cpupool_movedomain(ctx->xch, poolid, domid);
     if (rc) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Error moving domain to cpupool");
+        LOGEV(ERROR, rc, "Error moving domain to cpupool");
         GC_FREE;
         return ERROR_FAIL;
     }
@@ -6509,10 +6537,12 @@ static int fd_set_flags(libxl_ctx *ctx, int fd,
                         int flagmask, int set_p)
 {
     int flags, r;
+    GC_INIT(ctx);
 
     flags = fcntl(fd, fcntlgetop);
     if (flags == -1) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "fcntl(,F_GET%s) failed",fl);
+        LOGE(ERROR, "fcntl(,F_GET%s) failed", fl);
+        GC_FREE;
         return ERROR_FAIL;
     }
 
@@ -6523,10 +6553,12 @@ static int fd_set_flags(libxl_ctx *ctx, int fd,
 
     r = fcntl(fd, fcntlsetop, flags);
     if (r == -1) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "fcntl(,F_SET%s) failed",fl);
+        LOGE(ERROR, "fcntl(,F_SET%s) failed", fl);
+        GC_FREE;
         return ERROR_FAIL;
     }
 
+    GC_FREE;
     return 0;
 }
 
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index bf2099b..30380ec 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -102,7 +102,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
                     b_info->device_model_version =
                         LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
                 } else {
-                    LIBXL__LOG_ERRNO(CTX, XTL_ERROR, "qemu-xen access error");
+                    LOGE(ERROR, "qemu-xen access error");
                     return ERROR_FAIL;
                 }
             }
@@ -148,7 +148,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         b_info->device_model_version !=
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
         libxl_defbool_val(b_info->device_model_stubdomain)) {
-        LIBXL__LOG(CTX, XTL_ERROR,
+        LOG(ERROR,
             "device model stubdomains require \"qemu-xen-traditional\"");
         return ERROR_INVAL;
     }
@@ -374,9 +374,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         }
         break;
     default:
-        LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                   "invalid domain type %s in create info",
-                   libxl_domain_type_to_string(b_info->type));
+        LOG(ERROR, "invalid domain type %s in create info",
+            libxl_domain_type_to_string(b_info->type));
         return ERROR_INVAL;
     }
     return 0;
@@ -522,7 +521,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
     ret = libxl__arch_domain_prepare_config(gc, d_config, xc_config);
     if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "fail to get domain config");
+        LOGE(ERROR, "fail to get domain config");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -533,8 +532,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
                                       handle, flags, domid,
                                       xc_config);
         if (ret < 0) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "domain creation fail");
+            LOGE(ERROR, "domain creation fail");
             rc = ERROR_FAIL;
             goto out;
         }
@@ -546,7 +544,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
     ret = xc_cpupool_movedomain(ctx->xch, info->poolid, *domid);
     if (ret < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain move fail");
+        LOGE(ERROR, "domain move fail");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -559,7 +557,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
     vm_path = libxl__sprintf(gc, "/vm/%s", uuid_string);
     if (!vm_path) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot allocate create paths");
+        LOG(ERROR, "cannot allocate create paths");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -661,8 +659,7 @@ retry_transaction:
             t = 0;
             goto retry_transaction;
         }
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain creation "
-                         "xenstore transaction commit failed");
+        LOGE(ERROR, "domain creation ""xenstore transaction commit failed");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -878,7 +875,7 @@ static void initiate_domain_create(libxl__egc *egc,
 
     ret = libxl__domain_make(gc, d_config, &domid, &state->config);
     if (ret) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
+        LOG(ERROR, "cannot make domain: %d", ret);
         dcs->guest_domid = domid;
         ret = ERROR_FAIL;
         goto error_out;
@@ -1141,10 +1138,9 @@ static void domcreate_rebuild_done(libxl__egc *egc,
     /* convenience aliases */
     const uint32_t domid = dcs->guest_domid;
     libxl_domain_config *const d_config = dcs->guest_config;
-    libxl_ctx *const ctx = CTX;
 
     if (ret) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot (re-)build domain: %d", ret);
+        LOG(ERROR, "cannot (re-)build domain: %d", ret);
         ret = ERROR_FAIL;
         goto error_out;
     }
@@ -1335,15 +1331,13 @@ static void domcreate_devmodel_started(libxl__egc *egc,
 {
     libxl__domain_create_state *dcs = CONTAINER_OF(dmss, *dcs, dmss.dm);
     STATE_AO_GC(dmss->spawn.ao);
-    libxl_ctx *ctx = CTX;
     int domid = dcs->guest_domid;
 
     /* convenience aliases */
     libxl_domain_config *const d_config = dcs->guest_config;
 
     if (ret) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "device model did not start: %d", ret);
+        LOG(ERROR, "device model did not start: %d", ret);
         goto error_out;
     }
 
@@ -1411,7 +1405,6 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
     libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev);
     STATE_AO_GC(dcs->ao);
     int i;
-    libxl_ctx *ctx = CTX;
     int domid = dcs->guest_domid;
 
     /* convenience aliases */
@@ -1425,8 +1418,7 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
     for (i = 0; i < d_config->num_pcidevs; i++) {
         ret = libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], 1);
         if (ret < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "libxl_device_pci_add failed: %d", ret);
+            LOG(ERROR, "libxl_device_pci_add failed: %d", ret);
             goto error_out;
         }
     }
@@ -1435,8 +1427,7 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
         ret = libxl__create_pci_backend(gc, domid, d_config->pcidevs,
             d_config->num_pcidevs);
         if (ret < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                "libxl_create_pci_backend failed: %d", ret);
+            LOG(ERROR, "libxl_create_pci_backend failed: %d", ret);
             goto error_out;
         }
     }
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 71a1a3e..cf8b535 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -61,7 +61,6 @@ static int libxl__create_qemu_logfile(libxl__gc *gc, char *name)
 const char *libxl__domain_device_model(libxl__gc *gc,
                                        const libxl_domain_build_info *info)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     const char *dm;
 
     if (libxl_defbool_val(info->device_model_stubdomain))
@@ -78,9 +77,8 @@ const char *libxl__domain_device_model(libxl__gc *gc,
             dm = qemu_xen_path(gc);
             break;
         default:
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "invalid device model version %d",
-                       info->device_model_version);
+            LOG(ERROR, "invalid device model version %d",
+                info->device_model_version);
             dm = NULL;
             break;
         }
@@ -666,20 +664,18 @@ static char *dm_spice_options(libxl__gc *gc,
     char *opt;
 
     if (!spice->port && !spice->tls_port) {
-        LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                   "at least one of the spiceport or tls_port must be provided");
+        LOG(ERROR,
+            "at least one of the spiceport or tls_port must be provided");
         return NULL;
     }
 
     if (!libxl_defbool_val(spice->disable_ticketing)) {
         if (!spice->passwd) {
-            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                       "spice ticketing is enabled but missing password");
+            LOG(ERROR, "spice ticketing is enabled but missing password");
             return NULL;
         }
         else if (!spice->passwd[0]) {
-            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                               "spice password can't be empty");
+            LOG(ERROR, "spice password can't be empty");
             return NULL;
         }
     }
@@ -731,7 +727,6 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                         const libxl__domain_build_state *state,
                                         int *dm_state_fd)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     const libxl_domain_create_info *c_info = &guest_config->c_info;
     const libxl_domain_build_info *b_info = &guest_config->b_info;
     const libxl_device_disk *disks = guest_config->disks;
@@ -1140,8 +1135,8 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             const char *pdev_path;
 
             if (dev_number == -1) {
-                LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "unable to determine"
-                           " disk number for %s", disks[i].vdev);
+                LOG(WARN, "unable to determine"" disk number for %s",
+                    disks[i].vdev);
                 continue;
             }
 
@@ -1156,19 +1151,21 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                          disks[i].pdev_path, disk, disks[i].readwrite ? "off" : "on", format, dev_number);
             } else {
                 if (!disks[i].readwrite) {
-                    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "qemu-xen doesn't support read-only disk drivers");
+                    LOG(ERROR,
+                        "qemu-xen doesn't support read-only disk drivers");
                     return ERROR_INVAL;
                 }
 
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
-                    LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "cannot support"
-                               " empty disk format for %s", disks[i].vdev);
+                    LOG(WARN, "cannot support"" empty disk format for %s",
+                        disks[i].vdev);
                     continue;
                 }
 
                 if (format == NULL) {
-                    LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "unable to determine"
-                               " disk image format %s", disks[i].vdev);
+                    LOG(WARN,
+                        "unable to determine"" disk image format %s",
+                        disks[i].vdev);
                     continue;
                 }
 
@@ -1235,8 +1232,6 @@ static int libxl__build_device_model_args(libxl__gc *gc,
 /* dm_state_fd may be NULL iff caller knows we are using old stubdom
  * and therefore will be passing a filename rather than a fd. */
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-
     switch (guest_config->b_info.device_model_version) {
     case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
         return libxl__build_device_model_args_old(gc, dm,
@@ -1251,8 +1246,8 @@ static int libxl__build_device_model_args(libxl__gc *gc,
                                                   args, envs,
                                                   state, dm_state_fd);
     default:
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model version %d",
-                         guest_config->b_info.device_model_version);
+        LOGE(ERROR, "unknown device model version %d",
+             guest_config->b_info.device_model_version);
         return ERROR_INVAL;
     }
 }
@@ -1479,9 +1474,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
                    "%d", guest_domid);
     ret = xc_domain_set_target(ctx->xch, dm_domid, guest_domid);
     if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "setting target domain %d -> %d",
-                         dm_domid, guest_domid);
+        LOGE(ERROR, "setting target domain %d -> %d", dm_domid, guest_domid);
         ret = ERROR_FAIL;
         goto out;
     }
@@ -1740,8 +1733,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
         goto out;
     }
     if (access(dm, X_OK) < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "device model %s is not executable", dm);
+        LOGE(ERROR, "device model %s is not executable", dm);
         rc = ERROR_FAIL;
         goto out;
     }
@@ -1813,9 +1805,9 @@ retry_transaction:
         }
     }
 
-    LIBXL__LOG(CTX, XTL_DEBUG, "Spawning device-model %s with arguments:", dm);
+    LOG(DEBUG, "Spawning device-model %s with arguments:", dm);
     for (arg = args; *arg; arg++)
-        LIBXL__LOG(CTX, XTL_DEBUG, "  %s", *arg);
+        LOG(DEBUG, "  %s", *arg);
     if (*envs) {
         LOG(DEBUG, "Spawning device-model %s with additional environment:", dm);
         for (arg = envs; *arg; arg += 2)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b514377..b26ce57 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -216,8 +216,8 @@ static int hvm_set_viridian_features(libxl__gc *gc, uint32_t domid,
 
     libxl_for_each_set_bit(v, info->u.hvm.viridian_enable) {
         if (libxl_bitmap_test(&info->u.hvm.viridian_disable, v)) {
-            LIBXL__LOG(CTX, LIBXL__LOG_ERROR, "%s group both enabled and disabled",
-                       libxl_viridian_enlightenment_to_string(v));
+            LOG(ERROR, "%s group both enabled and disabled",
+                libxl_viridian_enlightenment_to_string(v));
             goto err;
         }
         if (libxl_viridian_enlightenment_to_string(v)) /* check validity */
@@ -231,7 +231,7 @@ static int hvm_set_viridian_features(libxl__gc *gc, uint32_t domid,
     /* The base set is a pre-requisite for all others */
     if (!libxl_bitmap_is_empty(&enlightenments) &&
         !libxl_bitmap_test(&enlightenments, LIBXL_VIRIDIAN_ENLIGHTENMENT_BASE)) {
-        LIBXL__LOG(CTX, LIBXL__LOG_ERROR, "base group not enabled");
+        LOG(ERROR, "base group not enabled");
         goto err;
     }
 
@@ -256,9 +256,7 @@ static int hvm_set_viridian_features(libxl__gc *gc, uint32_t domid,
                          domid,
                          HVM_PARAM_VIRIDIAN,
                          mask) != 0) {
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR,
-                         "Couldn't set viridian feature mask (0x%"PRIx64")",
-                         mask);
+        LOGE(ERROR, "Couldn't set viridian feature mask (0x%"PRIx64")", mask);
         goto err;
     }
 
@@ -404,7 +402,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
 
     if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
         LIBXL_MAXMEM_CONSTANT) < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't set max memory");
+        LOGE(ERROR, "Couldn't set max memory");
         return ERROR_FAIL;
     }
 
@@ -1992,8 +1990,7 @@ err:
     }
 
     if (rc)
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR, "cannot write/rename %s for %s",
-                 newfilename, filename);
+        LOGE(ERROR, "cannot write/rename %s for %s", newfilename, filename);
 out:
     return rc;
 }
@@ -2045,7 +2042,7 @@ int libxl__userdata_retrieve(libxl__gc *gc, uint32_t domid,
         goto out;
     }
     if (!e && !datalen) {
-        LIBXL__LOG(CTX, LIBXL__LOG_ERROR, "userdata file %s is empty", filename);
+        LOG(ERROR, "userdata file %s is empty", filename);
         if (data_r) assert(!*data_r);
         rc = ERROR_FAIL;
         goto out;
diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index bfb6b31..7d549ad 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -277,7 +277,7 @@ int libxl__gettimeofday(libxl__gc *gc, struct timeval *now_r)
 {
     int rc = gettimeofday(now_r, 0);
     if (rc) {
-        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR, "gettimeofday failed");
+        LOGE(ERROR, "gettimeofday failed");
         return ERROR_FAIL;
     }
     return 0;
@@ -523,9 +523,8 @@ static void watchfd_callback(libxl__egc *egc, libxl__ev_fd *ev,
         uint32_t counterval;
         int rc = sscanf(token, "%d/%"SCNx32, &slotnum, &counterval);
         if (rc != 2) {
-            LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
-                       "watch epath=%s token=%s: failed to parse token",
-                       epath, token);
+            LOG(ERROR, "watch epath=%s token=%s: failed to parse token",
+                epath, token);
             /* oh well */
             goto ignore;
         }
@@ -540,9 +539,7 @@ static void watchfd_callback(libxl__egc *egc, libxl__ev_fd *ev,
         libxl__ev_xswatch *w = libxl__watch_slot_contents(gc, slotnum);
 
         if (!w) {
-            LIBXL__LOG(CTX, LIBXL__LOG_DEBUG,
-                       "watch epath=%s token=%s: empty slot",
-                       epath, token);
+            LOG(DEBUG, "watch epath=%s token=%s: empty slot", epath, token);
             goto ignore;
         }
 
@@ -639,8 +636,7 @@ int libxl__ev_xswatch_register(libxl__gc *gc, libxl__ev_xswatch *w,
         w, path, token, slotnum);
 
     if (!xs_watch(CTX->xsh, path, token)) {
-        LIBXL__LOG_ERRNOVAL(CTX, LIBXL__LOG_ERROR, errno,
-                            "create watch for path %s", path);
+        LOGEV(ERROR, errno, "create watch for path %s", path);
         rc = ERROR_FAIL;
         goto out_rc;
     }
@@ -679,8 +675,7 @@ void libxl__ev_xswatch_deregister(libxl__gc *gc, libxl__ev_xswatch *w)
         if (!xs_unwatch(CTX->xsh, w->path, token))
             /* Oh well, we will just get watch events forever more
              * and ignore them.  But we should complain to the log. */
-            LIBXL__LOG_ERRNOVAL(CTX, LIBXL__LOG_ERROR, errno,
-                                "remove watch for path %s", w->path);
+            LOGEV(ERROR, errno, "remove watch for path %s", w->path);
 
         libxl__ev_watch_slot *slot = &CTX->watch_slots[w->slotnum];
         LIBXL_SLIST_INSERT_HEAD(&CTX->watch_freeslots, slot, empty);
@@ -863,25 +858,24 @@ static void devstate_callback(libxl__egc *egc, libxl__xswait_state *xsw,
 
     if (rc) {
         if (rc == ERROR_TIMEDOUT)
-            LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "backend %s wanted state %d "
-                       " timed out", ds->w.path, ds->wanted);
+            LOG(DEBUG, "backend %s wanted state %d "" timed out", ds->w.path,
+                ds->wanted);
         goto out;
     }
     if (!sstate) {
-        LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "backend %s wanted state %d"
-                   " but it was removed", ds->w.path, ds->wanted);
+        LOG(DEBUG, "backend %s wanted state %d"" but it was removed",
+            ds->w.path, ds->wanted);
         rc = ERROR_INVAL;
         goto out;
     }
 
     int got = atoi(sstate);
     if (got == ds->wanted) {
-        LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "backend %s wanted state %d ok",
-                   ds->w.path, ds->wanted);
+        LOG(DEBUG, "backend %s wanted state %d ok", ds->w.path, ds->wanted);
         rc = 0;
     } else {
-        LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "backend %s wanted state %d"
-                   " still waiting state %d", ds->w.path, ds->wanted, got);
+        LOG(DEBUG, "backend %s wanted state %d"" still waiting state %d",
+            ds->w.path, ds->wanted, got);
         return;
     }
 
@@ -1705,7 +1699,7 @@ static int eventloop_iteration(libxl__egc *egc, libxl__poller *poller) {
         if (errno == EINTR)
             return 0; /* will go round again if caller requires */
 
-        LIBXL__LOG_ERRNOVAL(CTX, LIBXL__LOG_ERROR, errno, "poll failed");
+        LOGEV(ERROR, errno, "poll failed");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -1897,6 +1891,7 @@ static bool ao_work_outstanding(libxl__ao *ao)
 
 void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
 {
+    EGC_GC;
     libxl_ctx *ctx = libxl__gc_owner(&egc->gc);
     assert(ao->progress_reports_outstanding >= 0);
 
@@ -1909,7 +1904,7 @@ void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao)
             /* don't bother with this if we're not in the event loop */
             libxl__poller_wakeup(egc, ao->poller);
     } else if (ao->how.callback) {
-        LIBXL__LOG(ctx, XTL_DEBUG, "ao %p: complete for callback",ao);
+        LOG(DEBUG, "ao %p: complete for callback", ao);
         LIBXL_TAILQ_INSERT_TAIL(&egc->aos_for_callback, ao, entry_for_callback);
     } else {
         libxl_event *ev;
@@ -2001,8 +1996,9 @@ int libxl__ao_inprogress(libxl__ao *ao,
             rc = eventloop_iteration(&egc,ao->poller);
             if (rc) {
                 /* Oh dear, this is quite unfortunate. */
-                LIBXL__LOG(CTX, LIBXL__LOG_ERROR, "Error waiting for"
-                           " event during long-running operation (rc=%d)", rc);
+                LOG(ERROR,
+                    "Error waiting for"" event during long-running operation (rc=%d)",
+                    rc);
                 sleep(1);
                 /* It's either this or return ERROR_I_DONT_KNOW_WHETHER
                  * _THE_THING_YOU_ASKED_FOR_WILL_BE_DONE_LATER_WHEN
@@ -2041,7 +2037,7 @@ static int ao__abort(libxl_ctx *ctx, libxl__ao *parent)
     parent->aborting = 1;
 
     if (LIBXL_LIST_EMPTY(&parent->abortables)) {
-        LIBXL__LOG(ctx, XTL_DEBUG,
+        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG,
                    "ao %p: abort requested and noted, but no-one interested",
                    parent);
         rc = 0;
@@ -2061,8 +2057,8 @@ static int ao__abort(libxl_ctx *ctx, libxl__ao *parent)
         LIBXL_LIST_REMOVE(abrt, entry);
         abrt->registered = 0;
 
-        LIBXL__LOG(ctx, XTL_DEBUG, "ao %p: abrt=%p: aborting",
-                   parent, abrt->ao);
+        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG,
+                   "ao %p: abrt=%p: aborting", parent, abrt->ao);
         abrt->callback(&egc, abrt, ERROR_ABORTED);
 
         libxl__ctx_unlock(ctx);
diff --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c
index ecb30cf..df4aead 100644
--- a/tools/libxl/libxl_exec.c
+++ b/tools/libxl/libxl_exec.c
@@ -168,7 +168,6 @@ int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
                                                        void *userdata),
                                  void *check_callback_userdata)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char *p;
     unsigned int len;
     int rc = 0;
@@ -181,7 +180,7 @@ int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
 
     xsh = xs_daemon_open();
     if (xsh == NULL) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unable to open xenstore connection");
+        LOG(ERROR, "Unable to open xenstore connection");
         goto err;
     }
 
@@ -224,7 +223,7 @@ again:
             }
         }
     }
-    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "%s not ready", what);
+    LOG(ERROR, "%s not ready", what);
 
     xs_unwatch(xsh, path, path);
     xs_daemon_close(xsh);
diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index 366ea05..c69d6f9 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -336,27 +336,28 @@ _hidden int libxl__mac_is_default(libxl_mac *mac)
 
 _hidden int libxl__init_recursive_mutex(libxl_ctx *ctx, pthread_mutex_t *lock)
 {
+    GC_INIT(ctx);
     pthread_mutexattr_t attr;
     int rc = 0;
 
     if (pthread_mutexattr_init(&attr) != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Failed to init mutex attributes");
-        return ERROR_FAIL;
+        LOGE(ERROR, "Failed to init mutex attributes");
+        rc = ERROR_FAIL;
+        goto out;
     }
     if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Failed to set mutex attributes");
+        LOGE(ERROR, "Failed to set mutex attributes");
         rc = ERROR_FAIL;
         goto out;
     }
     if (pthread_mutex_init(lock, &attr) != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to init mutex");
+        LOGE(ERROR, "Failed to init mutex");
         rc = ERROR_FAIL;
         goto out;
     }
 out:
     pthread_mutexattr_destroy(&attr);
+    GC_FREE;
     return rc;
 }
 
@@ -374,9 +375,7 @@ int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid)
     }
 
     if (libxl_device_model_version_from_string(dm_version, &value) < 0) {
-        libxl_ctx *ctx = libxl__gc_owner(gc);
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "fatal: %s contain a wrong value (%s)", path, dm_version);
+        LOG(ERROR, "fatal: %s contain a wrong value (%s)", path, dm_version);
         return -1;
     }
     return value;
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 8434ec8..378f6b0 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -81,7 +81,6 @@ static int libxl__device_from_pcidev(libxl__gc *gc, uint32_t domid,
 int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
                               libxl_device_pci *pcidev, int num)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     flexarray_t *front = NULL;
     flexarray_t *back = NULL;
     libxl__device device;
@@ -92,7 +91,7 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
 
     ret = 0;
 
-    LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Creating pci backend");
+    LOG(DEBUG, "Creating pci backend");
 
     /* add pci device */
     libxl__device_from_pcidev(gc, domid, pcidev, &device);
@@ -119,7 +118,6 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
 
 static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int starting)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     flexarray_t *back;
     char *num_devs, *be_path;
     int num = 0;
@@ -150,7 +148,7 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d
 
     back = flexarray_make(gc, 16, 1);
 
-    LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Adding new pci device to xenstore");
+    LOG(DEBUG, "Adding new pci device to xenstore");
     num = atoi(num_devs);
     libxl_create_pci_backend_device(gc, back, num, pcidev);
     flexarray_append_pair(back, "num_devs", libxl__sprintf(gc, "%d", num + 1));
@@ -214,7 +212,7 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
 
     if (domtype == LIBXL_DOMAIN_TYPE_PV) {
         if (libxl__wait_for_backend(gc, be_path, GCSPRINTF("%d", XenbusStateConnected)) < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "pci backend at %s is not ready", be_path);
+            LOG(DEBUG, "pci backend at %s is not ready", be_path);
             return ERROR_FAIL;
         }
     }
@@ -229,7 +227,7 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
         }
     }
     if (i == num) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Couldn't find the device on xenstore");
+        LOG(ERROR, "Couldn't find the device on xenstore");
         return ERROR_INVAL;
     }
 
@@ -243,7 +241,7 @@ retry_transaction:
 
     if (domtype == LIBXL_DOMAIN_TYPE_PV) {
         if (libxl__wait_for_backend(gc, be_path, GCSPRINTF("%d", XenbusStateConnected)) < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "pci backend at %s is not ready", be_path);
+            LOG(DEBUG, "pci backend at %s is not ready", be_path);
             return ERROR_FAIL;
         }
     }
@@ -374,14 +372,12 @@ static int is_pcidev_in_array(libxl_device_pci *assigned, int num_assigned,
 static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
                            libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int rc, fd;
     char *buf;
 
     fd = open(sysfs_path, O_WRONLY);
     if (fd < 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s",
-                         sysfs_path);
+        LOGE(ERROR, "Couldn't open %s", sysfs_path);
         return ERROR_FAIL;
     }
 
@@ -390,8 +386,7 @@ static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
     rc = write(fd, buf, strlen(buf));
     /* Annoying to have two if's, but we need the errno */
     if (rc < 0)
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "write to %s returned %d", sysfs_path, rc);
+        LOGE(ERROR, "write to %s returned %d", sysfs_path, rc);
     close(fd);
 
     if (rc < 0)
@@ -417,9 +412,9 @@ libxl_device_pci *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *num)
     dir = opendir(SYSFS_PCIBACK_DRIVER);
     if ( NULL == dir ) {
         if ( errno == ENOENT ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Looks like pciback driver not loaded");
+            LOG(ERROR, "Looks like pciback driver not loaded");
         }else{
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", SYSFS_PCIBACK_DRIVER);
+            LOGE(ERROR, "Couldn't open %s", SYSFS_PCIBACK_DRIVER);
         }
         goto out_closedir;
     }
@@ -456,7 +451,6 @@ out:
 static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
                             char **driver_path)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char * spath, *dp = NULL;
     struct stat st;
 
@@ -470,17 +464,16 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
         dp = libxl__zalloc(gc, PATH_MAX);
         dp = realpath(spath, dp);
         if ( !dp ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "realpath() failed");
+            LOGE(ERROR, "realpath() failed");
             return -1;
         }
 
-        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Driver re-plug path: %s",
-                   dp);
+        LOG(DEBUG, "Driver re-plug path: %s", dp);
 
         /* Unbind from the old driver */
         spath = libxl__sprintf(gc, "%s/unbind", dp);
         if ( sysfs_write_bdf(gc, spath, pcidev) < 0 ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't unbind device");
+            LOGE(ERROR, "Couldn't unbind device");
             return -1;
         }
     }
@@ -633,7 +626,6 @@ bool libxl__is_igd_vga_passthru(libxl__gc *gc,
 /* Scan through /sys/.../pciback/slots looking for pcidev's BDF */
 static int pciback_dev_has_slot(libxl__gc *gc, libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     FILE *f;
     int rc = 0;
     unsigned dom, bus, dev, func;
@@ -641,8 +633,7 @@ static int pciback_dev_has_slot(libxl__gc *gc, libxl_device_pci *pcidev)
     f = fopen(SYSFS_PCIBACK_DRIVER"/slots", "r");
 
     if (f == NULL) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s",
-                         SYSFS_PCIBACK_DRIVER"/slots");
+        LOGE(ERROR, "Couldn't open %s", SYSFS_PCIBACK_DRIVER"/slots");
         return ERROR_FAIL;
     }
 
@@ -662,18 +653,15 @@ out:
 
 static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char * spath;
     int rc;
     struct stat st;
 
     if ( access(SYSFS_PCIBACK_DRIVER, F_OK) < 0 ) {
         if ( errno == ENOENT ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "Looks like pciback driver is not loaded");
+            LOG(ERROR, "Looks like pciback driver is not loaded");
         } else {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "Can't access "SYSFS_PCIBACK_DRIVER);
+            LOGE(ERROR, "Can't access "SYSFS_PCIBACK_DRIVER);
         }
         return -1;
     }
@@ -687,31 +675,27 @@ static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pcidev)
         return 1;
     if ( rc < 0 && errno == ENOENT )
         return 0;
-    LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Accessing %s", spath);
+    LOGE(ERROR, "Accessing %s", spath);
     return -1;
 }
 
 static int pciback_dev_assign(libxl__gc *gc, libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int rc;
 
     if ( (rc=pciback_dev_has_slot(gc, pcidev)) < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Error checking for pciback slot");
+        LOGE(ERROR, "Error checking for pciback slot");
         return ERROR_FAIL;
     } else if (rc == 0) {
         if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/new_slot",
                              pcidev) < 0 ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                       "Couldn't bind device to pciback!");
+            LOGE(ERROR, "Couldn't bind device to pciback!");
             return ERROR_FAIL;
         }
     }
 
     if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/bind", pcidev) < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                         "Couldn't bind device to pciback!");
+        LOGE(ERROR, "Couldn't bind device to pciback!");
         return ERROR_FAIL;
     }
     return 0;
@@ -719,11 +703,9 @@ static int pciback_dev_assign(libxl__gc *gc, libxl_device_pci *pcidev)
 
 static int pciback_dev_unassign(libxl__gc *gc, libxl_device_pci *pcidev)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-
     /* Remove from pciback */
     if ( sysfs_dev_unbind(gc, pcidev, NULL) < 0 ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Couldn't unbind device!");
+        LOG(ERROR, "Couldn't unbind device!");
         return ERROR_FAIL;
     }
 
@@ -731,8 +713,7 @@ static int pciback_dev_unassign(libxl__gc *gc, libxl_device_pci *pcidev)
     if ( pciback_dev_has_slot(gc, pcidev) > 0 ) {
         if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/remove_slot",
                              pcidev) < 0 ) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                             "Couldn't remove pciback slot");
+            LOGE(ERROR, "Couldn't remove pciback slot");
             return ERROR_FAIL;
         }
     }
@@ -745,7 +726,6 @@ static void pci_assignable_driver_path_write(libxl__gc *gc,
                                             libxl_device_pci *pcidev,
                                             char *driver_path)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char *path;
 
     path = libxl__sprintf(gc, PCIBACK_INFO_PATH"/"PCI_BDF_XSPATH"/driver_path",
@@ -754,9 +734,7 @@ static void pci_assignable_driver_path_write(libxl__gc *gc,
                           pcidev->dev,
                           pcidev->func);
     if ( libxl__xs_write(gc, XBT_NULL, path, "%s", driver_path) < 0 ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_WARNING,
-                         "Write of %s to node %s failed.",
-                         driver_path, path);
+        LOGE(WARN, "Write of %s to node %s failed.", driver_path, path);
     }
 }
 
@@ -805,7 +783,7 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
     /* See if the device exists */
     spath = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF, dom, bus, dev, func);
     if ( lstat(spath, &st) ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't lstat %s", spath);
+        LOGE(ERROR, "Couldn't lstat %s", spath);
         return ERROR_FAIL;
     }
 
@@ -847,7 +825,7 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
     }
 
     if ( pciback_dev_assign(gc, pcidev) ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Couldn't bind device to pciback!");
+        LOG(ERROR, "Couldn't bind device to pciback!");
         return ERROR_FAIL;
     }
 
@@ -858,7 +836,6 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
                                                libxl_device_pci *pcidev,
                                                int rebind)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int rc;
     char *driver_path;
 
@@ -868,8 +845,7 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
     } else if ( rc ) {
         pciback_dev_unassign(gc, pcidev);
     } else {
-        LIBXL__LOG(ctx, LIBXL__LOG_WARNING,
-                   "Not bound to pciback");
+        LOG(WARN, "Not bound to pciback");
     }
 
     /* Rebind if necessary */
@@ -877,14 +853,12 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
 
     if ( driver_path ) {
         if ( rebind ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_INFO, "Rebinding to driver at %s",
-                       driver_path);
+            LOG(INFO, "Rebinding to driver at %s", driver_path);
 
             if ( sysfs_write_bdf(gc,
                                  libxl__sprintf(gc, "%s/bind", driver_path),
                                  pcidev) < 0 ) {
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                                 "Couldn't bind device to %s", driver_path);
+                LOGE(ERROR, "Couldn't bind device to %s", driver_path);
                 return -1;
             }
 
@@ -892,8 +866,8 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
         }
     } else {
         if ( rebind ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_WARNING,
-                       "Couldn't find path for original driver; not rebinding");
+            LOG(WARN,
+                "Couldn't find path for original driver; not rebinding");
         }
     }
 
@@ -940,7 +914,7 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi
 
     dir = opendir(SYSFS_PCI_DEV);
     if ( NULL == dir ) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", SYSFS_PCI_DEV);
+        LOGE(ERROR, "Couldn't open %s", SYSFS_PCI_DEV);
         return -1;
     }
 
@@ -964,7 +938,7 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi
                 LIBXL__LOG(ctx, LIBXL__LOG_ERROR, PCI_BDF " is not assigned to pciback driver",
                        dom, bus, dev, func);
             else
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't lstat %s", path);
+                LOGE(ERROR, "Couldn't lstat %s", path);
             closedir(dir);
             return -1;
         }
@@ -1020,11 +994,9 @@ static int qemu_pci_add_xenstore(libxl__gc *gc, uint32_t domid,
     vdevfn = libxl__xs_read(gc, XBT_NULL, path);
     path = libxl__device_model_xs_path(gc, dm_domid, domid, "/state");
     if ( rc < 0 )
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "qemu refused to add device: %s", vdevfn);
+        LOG(ERROR, "qemu refused to add device: %s", vdevfn);
     else if ( sscanf(vdevfn, "0x%x", &pcidev->vdevfn) != 1 ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "wrong format for the vdevfn: '%s'", vdevfn);
+        LOG(ERROR, "wrong format for the vdevfn: '%s'", vdevfn);
         rc = -1;
     }
     xs_write(ctx->xsh, XBT_NULL, path, state, strlen(state));
@@ -1072,7 +1044,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     irq = 0;
 
     if (f == NULL) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", sysfs_path);
+        LOGE(ERROR, "Couldn't open %s", sysfs_path);
         return ERROR_FAIL;
     }
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
@@ -1083,7 +1055,10 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
             if (flags & PCI_BAR_IO) {
                 rc = xc_domain_ioport_permission(ctx->xch, domid, start, size, 1);
                 if (rc < 0) {
-                    LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Error: xc_domain_ioport_permission error 0x%llx/0x%llx", start, size);
+                    LOGE(ERROR,
+                         "Error: xc_domain_ioport_permission error 0x%llx/0x%llx",
+                         start,
+                         size);
                     fclose(f);
                     return ERROR_FAIL;
                 }
@@ -1091,7 +1066,10 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
                 rc = xc_domain_iomem_permission(ctx->xch, domid, start>>XC_PAGE_SHIFT,
                                                 (size+(XC_PAGE_SIZE-1))>>XC_PAGE_SHIFT, 1);
                 if (rc < 0) {
-                    LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Error: xc_domain_iomem_permission error 0x%llx/0x%llx", start, size);
+                    LOGE(ERROR,
+                         "Error: xc_domain_iomem_permission error 0x%llx/0x%llx",
+                         start,
+                         size);
                     fclose(f);
                     return ERROR_FAIL;
                 }
@@ -1103,19 +1081,19 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
                                 pcidev->bus, pcidev->dev, pcidev->func);
     f = fopen(sysfs_path, "r");
     if (f == NULL) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", sysfs_path);
+        LOGE(ERROR, "Couldn't open %s", sysfs_path);
         goto out;
     }
     if ((fscanf(f, "%u", &irq) == 1) && irq) {
         rc = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
         if (rc < 0) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Error: xc_physdev_map_pirq irq=%d", irq);
+            LOGE(ERROR, "Error: xc_physdev_map_pirq irq=%d", irq);
             fclose(f);
             return ERROR_FAIL;
         }
         rc = xc_domain_irq_permission(ctx->xch, domid, irq, 1);
         if (rc < 0) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Error: xc_domain_irq_permission irq=%d", irq);
+            LOGE(ERROR, "Error: xc_domain_irq_permission irq=%d", irq);
             fclose(f);
             return ERROR_FAIL;
         }
@@ -1126,8 +1104,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     if (pcidev->permissive) {
         if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/permissive",
                              pcidev) < 0 ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "Setting permissive for device");
+            LOG(ERROR, "Setting permissive for device");
             return ERROR_FAIL;
         }
     }
@@ -1137,12 +1114,12 @@ out:
         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.");
+            LOGE(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");
+            LOGE(ERROR, "xc_assign_device failed");
             return ERROR_FAIL;
         }
     }
@@ -1167,25 +1144,25 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
         char *buf = libxl__sprintf(gc, PCI_BDF, domain, bus, dev, func);
         rc = write(fd, buf, strlen(buf));
         if (rc < 0)
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "write to %s returned %d", reset, rc);
+            LOG(ERROR, "write to %s returned %d", reset, rc);
         close(fd);
         return rc < 0 ? rc : 0;
     }
     if (errno != ENOENT)
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to access pciback path %s", reset);
+        LOGE(ERROR, "Failed to access pciback path %s", reset);
     reset = libxl__sprintf(gc, "%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func);
     fd = open(reset, O_WRONLY);
     if (fd >= 0) {
         rc = write(fd, "1", 1);
         if (rc < 0)
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "write to %s returned %d", reset, rc);
+            LOGE(ERROR, "write to %s returned %d", reset, rc);
         close(fd);
         return rc < 0 ? rc : 0;
     }
     if (errno == ENOENT) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF, domain, bus, dev, func);
     } else {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to access reset path %s", reset);
+        LOGE(ERROR, "Failed to access reset path %s", reset);
     }
     return -1;
 }
@@ -1264,12 +1241,13 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
 
     rc = get_all_assigned_devices(gc, &assigned, &num_assigned);
     if ( rc ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
+        LOG(ERROR,
+            "cannot determine if device is assigned, refusing to continue");
         goto out;
     }
     if ( is_pcidev_in_array(assigned, num_assigned, pcidev->domain,
                      pcidev->bus, pcidev->dev, pcidev->func) ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device already attached to a domain");
+        LOG(ERROR, "PCI device already attached to a domain");
         rc = ERROR_FAIL;
         goto out;
     }
@@ -1289,7 +1267,7 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
 
     if ( pcidev->vfunc_mask == LIBXL_PCI_FUNC_ALL ) {
         if ( !(pcidev->vdevfn >> 3) ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Must specify a v-slot for multi-function devices");
+            LOG(ERROR, "Must specify a v-slot for multi-function devices");
             rc = ERROR_INVAL;
             goto out;
         }
@@ -1346,7 +1324,7 @@ static int qemu_pci_remove_xenstore(libxl__gc *gc, uint32_t domid,
         libxl__qemu_traditional_cmd(gc, domid, "pci-rem");
         if (libxl__wait_for_device_model_deprecated(gc, domid, "pci-removed",
                                          NULL, NULL, NULL) < 0) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model didn't respond in time");
+            LOG(ERROR, "Device Model didn't respond in time");
             /* This depends on guest operating system acknowledging the
              * SCI, if it doesn't respond in time then we may wish to
              * force the removal.
@@ -1379,7 +1357,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
     rc = ERROR_INVAL;
     if ( !is_pcidev_in_array(assigned, num, pcidev->domain,
                       pcidev->bus, pcidev->dev, pcidev->func) ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device not attached to this domain");
+        LOG(ERROR, "PCI device not attached to this domain");
         goto out_fail;
     }
 
@@ -1416,7 +1394,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
         int i;
 
         if (f == NULL) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", sysfs_path);
+            LOGE(ERROR, "Couldn't open %s", sysfs_path);
             goto skip1;
         }
         for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
@@ -1427,12 +1405,18 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
                 if (flags & PCI_BAR_IO) {
                     rc = xc_domain_ioport_permission(ctx->xch, domid, start, size, 0);
                     if (rc < 0)
-                        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_domain_ioport_permission error 0x%x/0x%x", start, size);
+                        LOGE(ERROR,
+                             "xc_domain_ioport_permission error 0x%x/0x%x",
+                             start,
+                             size);
                 } else {
                     rc = xc_domain_iomem_permission(ctx->xch, domid, start>>XC_PAGE_SHIFT,
                                                     (size+(XC_PAGE_SIZE-1))>>XC_PAGE_SHIFT, 0);
                     if (rc < 0)
-                        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_domain_iomem_permission error 0x%x/0x%x", start, size);
+                        LOGE(ERROR,
+                             "xc_domain_iomem_permission error 0x%x/0x%x",
+                             start,
+                             size);
                 }
             }
         }
@@ -1442,17 +1426,17 @@ skip1:
                                    pcidev->bus, pcidev->dev, pcidev->func);
         f = fopen(sysfs_path, "r");
         if (f == NULL) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't open %s", sysfs_path);
+            LOGE(ERROR, "Couldn't open %s", sysfs_path);
             goto out;
         }
         if ((fscanf(f, "%u", &irq) == 1) && irq) {
             rc = xc_physdev_unmap_pirq(ctx->xch, domid, irq);
             if (rc < 0) {
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_physdev_unmap_pirq irq=%d", irq);
+                LOGE(ERROR, "xc_physdev_unmap_pirq irq=%d", irq);
             }
             rc = xc_domain_irq_permission(ctx->xch, domid, irq, 0);
             if (rc < 0) {
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_domain_irq_permission irq=%d", irq);
+                LOGE(ERROR, "xc_domain_irq_permission irq=%d", irq);
             }
         }
         fclose(f);
@@ -1466,7 +1450,7 @@ out:
     if (!libxl_is_stubdom(ctx, domid, NULL)) {
         rc = xc_deassign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev));
         if (rc < 0 && (hvm || errno != ENOSYS))
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xc_deassign_device failed");
+            LOGE(ERROR, "xc_deassign_device failed");
     }
 
     stubdomid = libxl_get_stubdom_id(ctx, domid);
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 408ec85..2eba584 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -402,28 +402,27 @@ int libxl_read_file_contents(libxl_ctx *ctx, const char *filename,
                            constdata void *data, ssize_t sz,              \
                            const char *source, const char *what) {        \
       ssize_t got;                                                        \
+      GC_INIT(ctx);                                                       \
                                                                           \
       while (sz > 0) {                                                    \
           got = rw(fd, data, sz);                                         \
           if (got == -1) {                                                \
               if (errno == EINTR) continue;                               \
-              if (!ctx) return errno;                                     \
-              LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "failed to " #rw " %s%s%s", \
-                           what?what:"", what?" from ":"", source);       \
+              if (!ctx) { GC_FREE; return errno; }                        \
+              LOGE(ERROR, "failed to "#rw" %s%s%s", what ? what : "", what ? " from " : "", source);       \
+              GC_FREE;                                                    \
               return errno;                                               \
           }                                                               \
           if (got == 0) {                                                 \
-              if (!ctx) return EPROTO;                                    \
-              LIBXL__LOG(ctx, LIBXL__LOG_ERROR,                                   \
-                     zero_is_eof                                          \
-                     ? "file/stream truncated reading %s%s%s"             \
-                     : "file/stream write returned 0! writing %s%s%s",    \
-                     what?what:"", what?" from ":"", source);             \
+              if (!ctx) { GC_FREE; return  EPROTO; }                      \
+              LOG(ERROR, zero_is_eof ? "file/stream truncated reading %s%s%s" : "file/stream write returned 0! writing %s%s%s", what ? what : "", what ? " from " : "", source);             \
+              GC_FREE;                                                    \
               return EPROTO;                                              \
           }                                                               \
           sz -= got;                                                      \
           data = (char*)data + got;                                       \
       }                                                                   \
+      GC_FREE;                                                            \
       return 0;                                                           \
   }
 
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 896f34c..a3e50df 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -30,7 +30,7 @@ static const char *e820_names(int type)
     return "Unknown";
 }
 
-static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
+static int e820_sanitize(libxl__gc *gc, struct e820entry src[],
                          uint32_t *nr_entries,
                          unsigned long map_limitkb,
                          unsigned long balloon_kb)
@@ -91,7 +91,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
     ram_end = e820[idx].addr + e820[idx].size;
     idx ++;
 
-    LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Memory: %"PRIu64"kB End of RAM: " \
+    LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "Memory: %"PRIu64"kB End of RAM: " \
                "0x%"PRIx64" (PFN) Delta: %"PRIu64"kB, PCI start: %"PRIu64"kB " \
                "(0x%"PRIx64" PFN), Balloon %"PRIu64"kB\n", (uint64_t)map_limitkb,
                ram_end >> 12, delta_kb, start_kb ,start >> 12,
@@ -150,7 +150,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
             if (src[i].addr + src[i].size != end) {
                 /* We messed up somewhere */
                 src[i].type = 0;
-                LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Computed E820 wrongly. Continuing on.");
+                LOGE(ERROR, "Computed E820 wrongly. Continuing on.");
             }
         }
         /* Lastly, convert the RAM to UNSUABLE. Look in the Linux kernel
@@ -212,9 +212,8 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
     nr = idx;
 
     for (i = 0; i < nr; i++) {
-      LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, ":\t[%"PRIx64" -> %"PRIx64"] %s",
-                 e820[i].addr >> 12, (e820[i].addr + e820[i].size) >> 12,
-                 e820_names(e820[i].type));
+      LOG(DEBUG, ":\t[%"PRIx64" -> %"PRIx64"] %s", e820[i].addr >> 12,
+          (e820[i].addr + e820[i].size) >> 12, e820_names(e820[i].type));
     }
 
     /* Done: copy the sanitized version. */
@@ -236,7 +235,7 @@ static int e820_host_sanitize(libxl__gc *gc,
 
     *nr = rc;
 
-    rc = e820_sanitize(CTX, map, nr, b_info->target_memkb,
+    rc = e820_sanitize(gc, map, nr, b_info->target_memkb,
                        (b_info->max_memkb - b_info->target_memkb) +
                        b_info->u.pv.slack_memkb);
     return rc;
@@ -335,9 +334,8 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
             libxl_defbool_val(d_config->b_info.u.pv.e820_host)) {
         ret = libxl__e820_alloc(gc, domid, d_config);
         if (ret) {
-            LIBXL__LOG_ERRNO(gc->owner, LIBXL__LOG_ERROR,
-                    "Failed while collecting E820 with: %d (errno:%d)\n",
-                    ret, errno);
+            LOGE(ERROR, "Failed while collecting E820 with: %d (errno:%d)\n",
+                 ret, errno);
         }
     }
 
diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c
index d7eaa66..b0db062 100644
--- a/tools/libxl/libxl_xshelp.c
+++ b/tools/libxl/libxl_xshelp.c
@@ -130,8 +130,7 @@ char *libxl__xs_get_dompath(libxl__gc *gc, uint32_t domid)
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char *s = xs_get_domain_path(ctx->xsh, domid);
     if (!s) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "failed to get dompath for %" PRIu32,
-                     domid);
+        LOGE(ERROR, "failed to get dompath for %"PRIu32, domid);
         return NULL;
     }
     libxl__ptr_add(gc, s);
@@ -160,10 +159,9 @@ bool libxl__xs_mkdir(libxl__gc *gc, xs_transaction_t t,
 
 char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char *s = libxl__sprintf(gc, "/libxl/%i", domid);
     if (!s)
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot allocate create paths");
+        LOG(ERROR, "cannot allocate create paths");
     return s;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:34:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34: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 1Zo1DX-0000O8-Ea; Mon, 19 Oct 2015 03:34: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 1Zo1DV-0000Nh-N1
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:33 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	F4/EB-01421-9C464265; Mon, 19 Oct 2015 03:34:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1445225671!51887104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 891 invoked from network); 19 Oct 2015 03:34:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:34:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DT-0005be-4I
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DT-00046S-1F
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:31 +0000
Date: Mon, 19 Oct 2015 03:34:31 +0000
Message-Id: <E1Zo1DT-00046S-1F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix long lines and delete
	extraneous quotes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53a7472a64a23f23c8515fc9084a9bc089b49a3d
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 2 15:56:39 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:30:36 2015 +0100

    libxl: fix long lines and delete extraneous quotes
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c       |   21 +++++++++++++--------
 tools/libxl/libxl_utils.c |    8 ++++++--
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 1b754c8..ca725a9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -420,14 +420,14 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         if (rc == ERROR_INVAL) {
             /* no such domain, good */
         } else if (rc != 0) {
-            LOG(ERROR, "unexpected error""checking for existing domain");
+            LOG(ERROR, "unexpected error checking for existing domain");
             goto x_rc;
         } else if (domid_e == domid) {
             /* domain already has this name, ok (but we do still
              * need the rest of the code as we may need to check
              * old_name, for example). */
         } else {
-            LOG(ERROR, "domain with name \"%s\""" already exists.", new_name);
+            LOG(ERROR, "domain with name \"%s\" already exists.", new_name);
             rc = ERROR_INVAL;
             goto x_rc;
         }
@@ -437,14 +437,15 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         got_old_name = xs_read(ctx->xsh, trans, name_path, &got_old_len);
         if (!got_old_name) {
             LOGEV(ERROR, errno,
-                  "check old name"" for domain %"PRIu32" allegedly named `%s'",
+                  "check old name for domain %"PRIu32" allegedly named `%s'",
                   domid,
                   old_name);
             goto x_fail;
         }
         if (strcmp(old_name, got_old_name)) {
             LOG(ERROR,
-                "domain %"PRIu32" allegedly named ""`%s' is actually named `%s' - racing ?",
+                "domain %"PRIu32" allegedly named "
+                "`%s' is actually named `%s' - racing ?",
                 domid,
                 old_name,
                 got_old_name);
@@ -456,7 +457,8 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     if (!xs_write(ctx->xsh, trans, name_path,
                   new_name, strlen(new_name))) {
         LOG(ERROR,
-            "failed to write new name `%s'"" for domain %"PRIu32" previously named `%s'",
+            "failed to write new name `%s'"
+            " for domain %"PRIu32" previously named `%s'",
             new_name,
             domid,
             old_name);
@@ -489,14 +491,16 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
             trans = our_trans = 0;
             if (errno != EAGAIN) {
                 LOG(ERROR,
-                    "failed to commit new name `%s'"" for domain %"PRIu32" previously named `%s'",
+                    "failed to commit new name `%s'"
+                    " for domain %"PRIu32" previously named `%s'",
                     new_name,
                     domid,
                     old_name);
                 goto x_fail;
             }
             LOG(DEBUG,
-                "need to retry rename transaction"" for domain %"PRIu32" (name_path=\"%s\", new_name=\"%s\")",
+                "need to retry rename transaction"
+                " for domain %"PRIu32" (name_path=\"%s\", new_name=\"%s\")",
                 domid,
                 name_path,
                 new_name);
@@ -4802,7 +4806,8 @@ retry_transaction:
         new_target_memkb = target_memkb - videoram;
     if (new_target_memkb > memorykb) {
         LOG(ERROR,
-            "memory_dynamic_max must be less than or equal to"" memory_static_max\n");
+            "memory_dynamic_max must be less than or equal to"
+            " memory_static_max\n");
         abort_transaction = 1;
         goto out;
     }
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 2eba584..e42422a 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -409,13 +409,17 @@ int libxl_read_file_contents(libxl_ctx *ctx, const char *filename,
           if (got == -1) {                                                \
               if (errno == EINTR) continue;                               \
               if (!ctx) { GC_FREE; return errno; }                        \
-              LOGE(ERROR, "failed to "#rw" %s%s%s", what ? what : "", what ? " from " : "", source);       \
+              LOGE(ERROR, "failed to "#rw" %s%s%s",                       \
+                   what ? what : "", what ? " from " : "", source);       \
               GC_FREE;                                                    \
               return errno;                                               \
           }                                                               \
           if (got == 0) {                                                 \
               if (!ctx) { GC_FREE; return  EPROTO; }                      \
-              LOG(ERROR, zero_is_eof ? "file/stream truncated reading %s%s%s" : "file/stream write returned 0! writing %s%s%s", what ? what : "", what ? " from " : "", source);             \
+              LOG(ERROR, zero_is_eof                                      \
+                  ? "file/stream truncated reading %s%s%s"                \
+                  : "file/stream write returned 0! writing %s%s%s",       \
+                  what ? what : "", what ? " from " : "", source);        \
               GC_FREE;                                                    \
               return EPROTO;                                              \
           }                                                               \
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:34:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34: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 1Zo1DX-0000O8-Ea; Mon, 19 Oct 2015 03:34: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 1Zo1DV-0000Nh-N1
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:33 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	F4/EB-01421-9C464265; Mon, 19 Oct 2015 03:34:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1445225671!51887104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 891 invoked from network); 19 Oct 2015 03:34:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:34:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DT-0005be-4I
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1DT-00046S-1F
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:31 +0000
Date: Mon, 19 Oct 2015 03:34:31 +0000
Message-Id: <E1Zo1DT-00046S-1F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix long lines and delete
	extraneous quotes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53a7472a64a23f23c8515fc9084a9bc089b49a3d
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 2 15:56:39 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:30:36 2015 +0100

    libxl: fix long lines and delete extraneous quotes
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c       |   21 +++++++++++++--------
 tools/libxl/libxl_utils.c |    8 ++++++--
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 1b754c8..ca725a9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -420,14 +420,14 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         if (rc == ERROR_INVAL) {
             /* no such domain, good */
         } else if (rc != 0) {
-            LOG(ERROR, "unexpected error""checking for existing domain");
+            LOG(ERROR, "unexpected error checking for existing domain");
             goto x_rc;
         } else if (domid_e == domid) {
             /* domain already has this name, ok (but we do still
              * need the rest of the code as we may need to check
              * old_name, for example). */
         } else {
-            LOG(ERROR, "domain with name \"%s\""" already exists.", new_name);
+            LOG(ERROR, "domain with name \"%s\" already exists.", new_name);
             rc = ERROR_INVAL;
             goto x_rc;
         }
@@ -437,14 +437,15 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         got_old_name = xs_read(ctx->xsh, trans, name_path, &got_old_len);
         if (!got_old_name) {
             LOGEV(ERROR, errno,
-                  "check old name"" for domain %"PRIu32" allegedly named `%s'",
+                  "check old name for domain %"PRIu32" allegedly named `%s'",
                   domid,
                   old_name);
             goto x_fail;
         }
         if (strcmp(old_name, got_old_name)) {
             LOG(ERROR,
-                "domain %"PRIu32" allegedly named ""`%s' is actually named `%s' - racing ?",
+                "domain %"PRIu32" allegedly named "
+                "`%s' is actually named `%s' - racing ?",
                 domid,
                 old_name,
                 got_old_name);
@@ -456,7 +457,8 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     if (!xs_write(ctx->xsh, trans, name_path,
                   new_name, strlen(new_name))) {
         LOG(ERROR,
-            "failed to write new name `%s'"" for domain %"PRIu32" previously named `%s'",
+            "failed to write new name `%s'"
+            " for domain %"PRIu32" previously named `%s'",
             new_name,
             domid,
             old_name);
@@ -489,14 +491,16 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
             trans = our_trans = 0;
             if (errno != EAGAIN) {
                 LOG(ERROR,
-                    "failed to commit new name `%s'"" for domain %"PRIu32" previously named `%s'",
+                    "failed to commit new name `%s'"
+                    " for domain %"PRIu32" previously named `%s'",
                     new_name,
                     domid,
                     old_name);
                 goto x_fail;
             }
             LOG(DEBUG,
-                "need to retry rename transaction"" for domain %"PRIu32" (name_path=\"%s\", new_name=\"%s\")",
+                "need to retry rename transaction"
+                " for domain %"PRIu32" (name_path=\"%s\", new_name=\"%s\")",
                 domid,
                 name_path,
                 new_name);
@@ -4802,7 +4806,8 @@ retry_transaction:
         new_target_memkb = target_memkb - videoram;
     if (new_target_memkb > memorykb) {
         LOG(ERROR,
-            "memory_dynamic_max must be less than or equal to"" memory_static_max\n");
+            "memory_dynamic_max must be less than or equal to"
+            " memory_static_max\n");
         abort_transaction = 1;
         goto out;
     }
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 2eba584..e42422a 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -409,13 +409,17 @@ int libxl_read_file_contents(libxl_ctx *ctx, const char *filename,
           if (got == -1) {                                                \
               if (errno == EINTR) continue;                               \
               if (!ctx) { GC_FREE; return errno; }                        \
-              LOGE(ERROR, "failed to "#rw" %s%s%s", what ? what : "", what ? " from " : "", source);       \
+              LOGE(ERROR, "failed to "#rw" %s%s%s",                       \
+                   what ? what : "", what ? " from " : "", source);       \
               GC_FREE;                                                    \
               return errno;                                               \
           }                                                               \
           if (got == 0) {                                                 \
               if (!ctx) { GC_FREE; return  EPROTO; }                      \
-              LOG(ERROR, zero_is_eof ? "file/stream truncated reading %s%s%s" : "file/stream write returned 0! writing %s%s%s", what ? what : "", what ? " from " : "", source);             \
+              LOG(ERROR, zero_is_eof                                      \
+                  ? "file/stream truncated reading %s%s%s"                \
+                  : "file/stream write returned 0! writing %s%s%s",       \
+                  what ? what : "", what ? " from " : "", source);        \
               GC_FREE;                                                    \
               return EPROTO;                                              \
           }                                                               \
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:34:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1Dh-0000Px-HU; Mon, 19 Oct 2015 03:34: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 1Zo1Df-0000PW-P0
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:43 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	2B/FB-01421-3D464265; Mon, 19 Oct 2015 03:34:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445225681!23119173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17045 invoked from network); 19 Oct 2015 03:34:42 -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;
	19 Oct 2015 03:34:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dd-0005bq-Es
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dd-000476-DD
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:41 +0000
Date: Mon, 19 Oct 2015 03:34:41 +0000
Message-Id: <E1Zo1Dd-000476-DD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: map LIBXL__LOG_VERBOSE to
	XTL_VERBOSE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ed134b368e6f9dad5722fd9b10c7c183fb9d795a
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 2 15:56:40 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:30:36 2015 +0100

    libxl: map LIBXL__LOG_VERBOSE to XTL_VERBOSE
    
    There is code in libxl using XTL_VERBOSE. We should provide a libxl
    mapping for it.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_internal.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index c2413c2..d035b6d 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1637,6 +1637,7 @@ _hidden const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *g_cfg);
 _hidden char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path);
 
 #define LIBXL__LOG_DEBUG   XTL_DEBUG
+#define LIBXL__LOG_VERBOSE XTL_VERBOSE
 #define LIBXL__LOG_INFO    XTL_INFO
 #define LIBXL__LOG_WARNING XTL_WARN
 #define LIBXL__LOG_ERROR   XTL_ERROR
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:34:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1Dh-0000Px-HU; Mon, 19 Oct 2015 03:34: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 1Zo1Df-0000PW-P0
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:43 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	2B/FB-01421-3D464265; Mon, 19 Oct 2015 03:34:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445225681!23119173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17045 invoked from network); 19 Oct 2015 03:34:42 -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;
	19 Oct 2015 03:34:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dd-0005bq-Es
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dd-000476-DD
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:41 +0000
Date: Mon, 19 Oct 2015 03:34:41 +0000
Message-Id: <E1Zo1Dd-000476-DD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: map LIBXL__LOG_VERBOSE to
	XTL_VERBOSE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ed134b368e6f9dad5722fd9b10c7c183fb9d795a
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 2 15:56:40 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:30:36 2015 +0100

    libxl: map LIBXL__LOG_VERBOSE to XTL_VERBOSE
    
    There is code in libxl using XTL_VERBOSE. We should provide a libxl
    mapping for it.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_internal.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index c2413c2..d035b6d 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1637,6 +1637,7 @@ _hidden const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *g_cfg);
 _hidden char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path);
 
 #define LIBXL__LOG_DEBUG   XTL_DEBUG
+#define LIBXL__LOG_VERBOSE XTL_VERBOSE
 #define LIBXL__LOG_INFO    XTL_INFO
 #define LIBXL__LOG_WARNING XTL_WARN
 #define LIBXL__LOG_ERROR   XTL_ERROR
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:34:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34: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 1Zo1Ds-0000S8-K8; Mon, 19 Oct 2015 03:34: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 1Zo1Dq-0000Rg-Vb
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:55 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	F3/22-02804-ED464265; Mon, 19 Oct 2015 03:34:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445225692!49915003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4061 invoked from network); 19 Oct 2015 03:34:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:34:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dn-0005by-Pj
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dn-00048R-Nz
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:51 +0000
Date: Mon, 19 Oct 2015 03:34:51 +0000
Message-Id: <E1Zo1Dn-00048R-Nz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix places missed by spatch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b92b94c581270bd72588e06e304a88738cafd8e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 2 15:56:41 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:30:36 2015 +0100

    libxl: fix places missed by spatch
    
    The spatch provided in previous patch didn't handle all sites that need
    transformation.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c        |   17 ++++++++---------
 tools/libxl/libxl_create.c |    4 ++--
 tools/libxl/libxl_pci.c    |   43 +++++++++++++++++++------------------------
 tools/libxl/libxl_x86.c    |   10 +++++-----
 4 files changed, 34 insertions(+), 40 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ca725a9..22bbc29 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1221,11 +1221,10 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
         }
         gotend = &domaininfos[rc];
 
-        LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "[evg=%p:%"PRIu32"]"
-                   " nentries=%d rc=%d %ld..%ld",
-                   evg, evg->domid, nentries, rc,
-                   rc>0 ? (long)domaininfos[0].domain : 0,
-                   rc>0 ? (long)domaininfos[rc-1].domain : 0);
+        LOG(DEBUG, "[evg=%p:%"PRIu32"] nentries=%d rc=%d %ld..%ld",
+            evg, evg->domid, nentries, rc,
+            rc>0 ? (long)domaininfos[0].domain : 0,
+            rc>0 ? (long)domaininfos[rc-1].domain : 0);
 
         for (;;) {
             if (!evg) {
@@ -1233,10 +1232,10 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
                 goto all_reported;
             }
 
-            LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "[evg=%p:%"PRIu32"]"
-                       "   got=domaininfos[%d] got->domain=%ld",
-                       evg, evg->domid, (int)(got - domaininfos),
-                       got < gotend ? (long)got->domain : -1L);
+            LOG(DEBUG, "[evg=%p:%"PRIu32"]"
+                "   got=domaininfos[%d] got->domain=%ld",
+                evg, evg->domid, (int)(got - domaininfos),
+                got < gotend ? (long)got->domain : -1L);
 
             if (!rc) {
                 domain_death_occurred(egc, &evg, "empty list");
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 30380ec..f0fee00 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -97,8 +97,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
             if (rc < 0) {
                 /* qemu-xen unavailable, use qemu-xen-traditional */
                 if (errno == ENOENT) {
-                    LIBXL__LOG_ERRNO(CTX, XTL_VERBOSE, "qemu-xen is unavailable"
-                                     ", use qemu-xen-traditional instead");
+                    LOGE(VERBOSE, "qemu-xen is unavailable"
+                         ", use qemu-xen-traditional instead");
                     b_info->device_model_version =
                         LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
                 } else {
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 378f6b0..fad2eb6 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -768,7 +768,6 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
                                             libxl_device_pci *pcidev,
                                             int rebind)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     unsigned dom, bus, dev, func;
     char *spath, *driver_path = NULL;
     int rc;
@@ -793,16 +792,14 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
         return ERROR_FAIL;
     }
     if ( rc ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_WARNING, PCI_BDF" already assigned to pciback",
-                   dom, bus, dev, func);
+        LOG(WARN, PCI_BDF" already assigned to pciback", dom, bus, dev, func);
         return 0;
     }
 
     /* Check to see if there's already a driver that we need to unbind from */
     if ( sysfs_dev_unbind(gc, pcidev, &driver_path ) ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "Couldn't unbind "PCI_BDF" from driver",
-                   dom, bus, dev, func);
+        LOG(ERROR, "Couldn't unbind "PCI_BDF" from driver",
+            dom, bus, dev, func);
         return ERROR_FAIL;
     }
 
@@ -812,13 +809,11 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
             pci_assignable_driver_path_write(gc, pcidev, driver_path);
         } else if ( (driver_path =
                      pci_assignable_driver_path_read(gc, pcidev)) != NULL ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_INFO,
-                       PCI_BDF" not bound to a driver, will be rebound to %s",
-                       dom, bus, dev, func, driver_path);
+            LOG(INFO, PCI_BDF" not bound to a driver, will be rebound to %s",
+                dom, bus, dev, func, driver_path);
         } else {
-            LIBXL__LOG(ctx, LIBXL__LOG_WARNING,
-                       PCI_BDF" not bound to a driver, will not be rebound.",
-                       dom, bus, dev, func);
+            LOG(WARN, PCI_BDF" not bound to a driver, will not be rebound.",
+                dom, bus, dev, func);
         }
     } else {
         pci_assignable_driver_path_remove(gc, pcidev);
@@ -906,7 +901,6 @@ int libxl_device_pci_assignable_remove(libxl_ctx *ctx, libxl_device_pci *pcidev,
 */
 static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsigned int *func_mask)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     struct dirent *de;
     DIR *dir;
 
@@ -935,8 +929,8 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi
         path = libxl__sprintf(gc, "%s/" PCI_BDF, SYSFS_PCIBACK_DRIVER, dom, bus, dev, func);
         if ( lstat(path, &st) ) {
             if ( errno == ENOENT )
-                LIBXL__LOG(ctx, LIBXL__LOG_ERROR, PCI_BDF " is not assigned to pciback driver",
-                       dom, bus, dev, func);
+                LOG(ERROR, PCI_BDF " is not assigned to pciback driver",
+                    dom, bus, dev, func);
             else
                 LOGE(ERROR, "Couldn't lstat %s", path);
             closedir(dir);
@@ -1134,7 +1128,6 @@ out:
 static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned int bus,
                                    unsigned int dev, unsigned int func)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char *reset;
     int fd, rc;
 
@@ -1160,7 +1153,9 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
         return rc < 0 ? rc : 0;
     }
     if (errno == ENOENT) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF, domain, bus, dev, func);
+        LOG(ERROR,
+            "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF,
+            domain, bus, dev, func);
     } else {
         LOGE(ERROR, "Failed to access reset path %s", reset);
     }
@@ -1214,11 +1209,11 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
     if (libxl__domain_type(gc, domid) == LIBXL_DOMAIN_TYPE_HVM) {
         rc = xc_test_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev));
         if (rc) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "PCI device %04x:%02x:%02x.%u %s?",
-                       pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func,
-                       errno == ENOSYS ? "cannot be assigned - no IOMMU"
-                                       : "already assigned to a different guest");
+            LOG(ERROR,
+                "PCI device %04x:%02x:%02x.%u %s?",
+                pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func,
+                errno == ENOSYS ? "cannot be assigned - no IOMMU"
+                : "already assigned to a different guest");
             goto out;
         }
     }
@@ -1233,8 +1228,8 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
     }
 
     if (!libxl_pcidev_assignable(ctx, pcidev)) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device %x:%x:%x.%x is not assignable",
-                   pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        LOG(ERROR, "PCI device %x:%x:%x.%x is not assignable",
+            pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
         rc = ERROR_FAIL;
         goto out;
     }
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index a3e50df..bedd941 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -91,11 +91,11 @@ static int e820_sanitize(libxl__gc *gc, struct e820entry src[],
     ram_end = e820[idx].addr + e820[idx].size;
     idx ++;
 
-    LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "Memory: %"PRIu64"kB End of RAM: " \
-               "0x%"PRIx64" (PFN) Delta: %"PRIu64"kB, PCI start: %"PRIu64"kB " \
-               "(0x%"PRIx64" PFN), Balloon %"PRIu64"kB\n", (uint64_t)map_limitkb,
-               ram_end >> 12, delta_kb, start_kb ,start >> 12,
-               (uint64_t)balloon_kb);
+    LOG(DEBUG, "Memory: %"PRIu64"kB End of RAM: " \
+        "0x%"PRIx64" (PFN) Delta: %"PRIu64"kB, PCI start: %"PRIu64"kB " \
+        "(0x%"PRIx64" PFN), Balloon %"PRIu64"kB\n", (uint64_t)map_limitkb,
+        ram_end >> 12, delta_kb, start_kb ,start >> 12,
+        (uint64_t)balloon_kb);
 
 
     /* This whole code below is to guard against if the Intel IGD is passed into
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:34:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:34: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 1Zo1Ds-0000S8-K8; Mon, 19 Oct 2015 03:34: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 1Zo1Dq-0000Rg-Vb
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:55 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	F3/22-02804-ED464265; Mon, 19 Oct 2015 03:34:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445225692!49915003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4061 invoked from network); 19 Oct 2015 03:34:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:34:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dn-0005by-Pj
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dn-00048R-Nz
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:34:51 +0000
Date: Mon, 19 Oct 2015 03:34:51 +0000
Message-Id: <E1Zo1Dn-00048R-Nz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix places missed by spatch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b92b94c581270bd72588e06e304a88738cafd8e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 2 15:56:41 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 7 12:30:36 2015 +0100

    libxl: fix places missed by spatch
    
    The spatch provided in previous patch didn't handle all sites that need
    transformation.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c        |   17 ++++++++---------
 tools/libxl/libxl_create.c |    4 ++--
 tools/libxl/libxl_pci.c    |   43 +++++++++++++++++++------------------------
 tools/libxl/libxl_x86.c    |   10 +++++-----
 4 files changed, 34 insertions(+), 40 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ca725a9..22bbc29 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1221,11 +1221,10 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
         }
         gotend = &domaininfos[rc];
 
-        LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "[evg=%p:%"PRIu32"]"
-                   " nentries=%d rc=%d %ld..%ld",
-                   evg, evg->domid, nentries, rc,
-                   rc>0 ? (long)domaininfos[0].domain : 0,
-                   rc>0 ? (long)domaininfos[rc-1].domain : 0);
+        LOG(DEBUG, "[evg=%p:%"PRIu32"] nentries=%d rc=%d %ld..%ld",
+            evg, evg->domid, nentries, rc,
+            rc>0 ? (long)domaininfos[0].domain : 0,
+            rc>0 ? (long)domaininfos[rc-1].domain : 0);
 
         for (;;) {
             if (!evg) {
@@ -1233,10 +1232,10 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
                 goto all_reported;
             }
 
-            LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "[evg=%p:%"PRIu32"]"
-                       "   got=domaininfos[%d] got->domain=%ld",
-                       evg, evg->domid, (int)(got - domaininfos),
-                       got < gotend ? (long)got->domain : -1L);
+            LOG(DEBUG, "[evg=%p:%"PRIu32"]"
+                "   got=domaininfos[%d] got->domain=%ld",
+                evg, evg->domid, (int)(got - domaininfos),
+                got < gotend ? (long)got->domain : -1L);
 
             if (!rc) {
                 domain_death_occurred(egc, &evg, "empty list");
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 30380ec..f0fee00 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -97,8 +97,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
             if (rc < 0) {
                 /* qemu-xen unavailable, use qemu-xen-traditional */
                 if (errno == ENOENT) {
-                    LIBXL__LOG_ERRNO(CTX, XTL_VERBOSE, "qemu-xen is unavailable"
-                                     ", use qemu-xen-traditional instead");
+                    LOGE(VERBOSE, "qemu-xen is unavailable"
+                         ", use qemu-xen-traditional instead");
                     b_info->device_model_version =
                         LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
                 } else {
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 378f6b0..fad2eb6 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -768,7 +768,6 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
                                             libxl_device_pci *pcidev,
                                             int rebind)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     unsigned dom, bus, dev, func;
     char *spath, *driver_path = NULL;
     int rc;
@@ -793,16 +792,14 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
         return ERROR_FAIL;
     }
     if ( rc ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_WARNING, PCI_BDF" already assigned to pciback",
-                   dom, bus, dev, func);
+        LOG(WARN, PCI_BDF" already assigned to pciback", dom, bus, dev, func);
         return 0;
     }
 
     /* Check to see if there's already a driver that we need to unbind from */
     if ( sysfs_dev_unbind(gc, pcidev, &driver_path ) ) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                   "Couldn't unbind "PCI_BDF" from driver",
-                   dom, bus, dev, func);
+        LOG(ERROR, "Couldn't unbind "PCI_BDF" from driver",
+            dom, bus, dev, func);
         return ERROR_FAIL;
     }
 
@@ -812,13 +809,11 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
             pci_assignable_driver_path_write(gc, pcidev, driver_path);
         } else if ( (driver_path =
                      pci_assignable_driver_path_read(gc, pcidev)) != NULL ) {
-            LIBXL__LOG(ctx, LIBXL__LOG_INFO,
-                       PCI_BDF" not bound to a driver, will be rebound to %s",
-                       dom, bus, dev, func, driver_path);
+            LOG(INFO, PCI_BDF" not bound to a driver, will be rebound to %s",
+                dom, bus, dev, func, driver_path);
         } else {
-            LIBXL__LOG(ctx, LIBXL__LOG_WARNING,
-                       PCI_BDF" not bound to a driver, will not be rebound.",
-                       dom, bus, dev, func);
+            LOG(WARN, PCI_BDF" not bound to a driver, will not be rebound.",
+                dom, bus, dev, func);
         }
     } else {
         pci_assignable_driver_path_remove(gc, pcidev);
@@ -906,7 +901,6 @@ int libxl_device_pci_assignable_remove(libxl_ctx *ctx, libxl_device_pci *pcidev,
 */
 static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsigned int *func_mask)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     struct dirent *de;
     DIR *dir;
 
@@ -935,8 +929,8 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi
         path = libxl__sprintf(gc, "%s/" PCI_BDF, SYSFS_PCIBACK_DRIVER, dom, bus, dev, func);
         if ( lstat(path, &st) ) {
             if ( errno == ENOENT )
-                LIBXL__LOG(ctx, LIBXL__LOG_ERROR, PCI_BDF " is not assigned to pciback driver",
-                       dom, bus, dev, func);
+                LOG(ERROR, PCI_BDF " is not assigned to pciback driver",
+                    dom, bus, dev, func);
             else
                 LOGE(ERROR, "Couldn't lstat %s", path);
             closedir(dir);
@@ -1134,7 +1128,6 @@ out:
 static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned int bus,
                                    unsigned int dev, unsigned int func)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     char *reset;
     int fd, rc;
 
@@ -1160,7 +1153,9 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
         return rc < 0 ? rc : 0;
     }
     if (errno == ENOENT) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF, domain, bus, dev, func);
+        LOG(ERROR,
+            "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF,
+            domain, bus, dev, func);
     } else {
         LOGE(ERROR, "Failed to access reset path %s", reset);
     }
@@ -1214,11 +1209,11 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
     if (libxl__domain_type(gc, domid) == LIBXL_DOMAIN_TYPE_HVM) {
         rc = xc_test_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev));
         if (rc) {
-            LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
-                       "PCI device %04x:%02x:%02x.%u %s?",
-                       pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func,
-                       errno == ENOSYS ? "cannot be assigned - no IOMMU"
-                                       : "already assigned to a different guest");
+            LOG(ERROR,
+                "PCI device %04x:%02x:%02x.%u %s?",
+                pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func,
+                errno == ENOSYS ? "cannot be assigned - no IOMMU"
+                : "already assigned to a different guest");
             goto out;
         }
     }
@@ -1233,8 +1228,8 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
     }
 
     if (!libxl_pcidev_assignable(ctx, pcidev)) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device %x:%x:%x.%x is not assignable",
-                   pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        LOG(ERROR, "PCI device %x:%x:%x.%x is not assignable",
+            pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
         rc = ERROR_FAIL;
         goto out;
     }
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index a3e50df..bedd941 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -91,11 +91,11 @@ static int e820_sanitize(libxl__gc *gc, struct e820entry src[],
     ram_end = e820[idx].addr + e820[idx].size;
     idx ++;
 
-    LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "Memory: %"PRIu64"kB End of RAM: " \
-               "0x%"PRIx64" (PFN) Delta: %"PRIu64"kB, PCI start: %"PRIu64"kB " \
-               "(0x%"PRIx64" PFN), Balloon %"PRIu64"kB\n", (uint64_t)map_limitkb,
-               ram_end >> 12, delta_kb, start_kb ,start >> 12,
-               (uint64_t)balloon_kb);
+    LOG(DEBUG, "Memory: %"PRIu64"kB End of RAM: " \
+        "0x%"PRIx64" (PFN) Delta: %"PRIu64"kB, PCI start: %"PRIu64"kB " \
+        "(0x%"PRIx64" PFN), Balloon %"PRIu64"kB\n", (uint64_t)map_limitkb,
+        ram_end >> 12, delta_kb, start_kb ,start >> 12,
+        (uint64_t)balloon_kb);
 
 
     /* This whole code below is to guard against if the Intel IGD is passed into
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:35:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35: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 1Zo1E7-0000UG-NC; Mon, 19 Oct 2015 03:35: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 1Zo1E5-0000U0-Q0
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:09 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	05/7E-19110-DE464265; Mon, 19 Oct 2015 03:35:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1445225707!26492439!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16364 invoked from network); 19 Oct 2015 03:35:08 -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;
	19 Oct 2015 03:35:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1E3-0005cZ-3D
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dy-00049m-1w
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:02 +0000
Date: Mon, 19 Oct 2015 03:35:02 +0000
Message-Id: <E1Zo1Dy-00049m-1w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/cpufreq: relocate the driver
	register function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49388f11d512bb92706ce046643bfbb3c1d963c9
Author:     Wei Wang <wei.w.wang@intel.com>
AuthorDate: Thu Oct 8 11:01:58 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:01:58 2015 +0200

    x86/cpufreq: relocate the driver register function
    
    Move the driver register function to the cpufreq.c, and remove the
    (unused) de-registration one.
    
    Signed-off-by: Wei Wang <wei.w.wang@intel.com>
    
    Mark the funciton __init.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/cpufreq/cpufreq.c      |   15 +++++++++++++++
 xen/include/acpi/cpufreq/cpufreq.h |   27 +--------------------------
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 567e9e9..81a187b 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -638,3 +638,18 @@ static int __init cpufreq_presmp_init(void)
 }
 presmp_initcall(cpufreq_presmp_init);
 
+int __init cpufreq_register_driver(struct cpufreq_driver *driver_data)
+{
+   if ( !driver_data || !driver_data->init ||
+        !driver_data->verify || !driver_data->exit ||
+        (!driver_data->target == !driver_data->setpolicy) )
+        return -EINVAL;
+
+    if ( cpufreq_driver )
+        return -EBUSY;
+
+    cpufreq_driver = driver_data;
+
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 1ec04ca..48ad1d0 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -170,32 +170,7 @@ struct cpufreq_driver {
 
 extern struct cpufreq_driver *cpufreq_driver;
 
-static __inline__ 
-int cpufreq_register_driver(struct cpufreq_driver *driver_data)
-{
-    if (!driver_data         || 
-        !driver_data->init   || 
-        !driver_data->exit   || 
-        !driver_data->verify || 
-        !driver_data->target)
-        return -EINVAL;
-
-    if (cpufreq_driver)
-        return -EBUSY;
-
-    cpufreq_driver = driver_data;
-    return 0;
-}
-
-static __inline__ 
-int cpufreq_unregister_driver(struct cpufreq_driver *driver)
-{
-    if (!cpufreq_driver || (driver != cpufreq_driver))
-        return -EINVAL;
-
-    cpufreq_driver = NULL;
-    return 0;
-}
+int cpufreq_register_driver(struct cpufreq_driver *);
 
 static __inline__
 void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:35:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35: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 1Zo1E7-0000UG-NC; Mon, 19 Oct 2015 03:35: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 1Zo1E5-0000U0-Q0
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:09 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	05/7E-19110-DE464265; Mon, 19 Oct 2015 03:35:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1445225707!26492439!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16364 invoked from network); 19 Oct 2015 03:35:08 -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;
	19 Oct 2015 03:35:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1E3-0005cZ-3D
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Dy-00049m-1w
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:02 +0000
Date: Mon, 19 Oct 2015 03:35:02 +0000
Message-Id: <E1Zo1Dy-00049m-1w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/cpufreq: relocate the driver
	register function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49388f11d512bb92706ce046643bfbb3c1d963c9
Author:     Wei Wang <wei.w.wang@intel.com>
AuthorDate: Thu Oct 8 11:01:58 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:01:58 2015 +0200

    x86/cpufreq: relocate the driver register function
    
    Move the driver register function to the cpufreq.c, and remove the
    (unused) de-registration one.
    
    Signed-off-by: Wei Wang <wei.w.wang@intel.com>
    
    Mark the funciton __init.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/cpufreq/cpufreq.c      |   15 +++++++++++++++
 xen/include/acpi/cpufreq/cpufreq.h |   27 +--------------------------
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 567e9e9..81a187b 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -638,3 +638,18 @@ static int __init cpufreq_presmp_init(void)
 }
 presmp_initcall(cpufreq_presmp_init);
 
+int __init cpufreq_register_driver(struct cpufreq_driver *driver_data)
+{
+   if ( !driver_data || !driver_data->init ||
+        !driver_data->verify || !driver_data->exit ||
+        (!driver_data->target == !driver_data->setpolicy) )
+        return -EINVAL;
+
+    if ( cpufreq_driver )
+        return -EBUSY;
+
+    cpufreq_driver = driver_data;
+
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 1ec04ca..48ad1d0 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -170,32 +170,7 @@ struct cpufreq_driver {
 
 extern struct cpufreq_driver *cpufreq_driver;
 
-static __inline__ 
-int cpufreq_register_driver(struct cpufreq_driver *driver_data)
-{
-    if (!driver_data         || 
-        !driver_data->init   || 
-        !driver_data->exit   || 
-        !driver_data->verify || 
-        !driver_data->target)
-        return -EINVAL;
-
-    if (cpufreq_driver)
-        return -EBUSY;
-
-    cpufreq_driver = driver_data;
-    return 0;
-}
-
-static __inline__ 
-int cpufreq_unregister_driver(struct cpufreq_driver *driver)
-{
-    if (!cpufreq_driver || (driver != cpufreq_driver))
-        return -EINVAL;
-
-    cpufreq_driver = NULL;
-    return 0;
-}
+int cpufreq_register_driver(struct cpufreq_driver *);
 
 static __inline__
 void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:35:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35: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 1Zo1EG-0000W3-Q6; Mon, 19 Oct 2015 03:35: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 1Zo1EF-0000Vk-Mc
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:19 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	D2/5A-02324-7F464265; Mon, 19 Oct 2015 03:35:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1445225717!19672107!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5837 invoked from network); 19 Oct 2015 03:35:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:35:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1ED-0005ch-D8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1ED-0004At-At
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:17 +0000
Date: Mon, 19 Oct 2015 03:35:17 +0000
Message-Id: <E1Zo1ED-0004At-At@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m: fix typo "populete"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c3e4e915f136699aa1cb1d39a1c1571ace1761f5
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Oct 8 11:02:47 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:02:47 2015 +0200

    x86/p2m: fix typo "populete"
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@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 09144e0..1178832 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1287,7 +1287,7 @@ void p2m_mem_paging_drop_page(struct domain *d, unsigned long gfn,
 }
 
 /**
- * p2m_mem_paging_populate - Tell pager to populete a paged page
+ * p2m_mem_paging_populate - Tell pager to populate a paged page
  * @d: guest domain
  * @gfn: guest page in paging 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 Mon Oct 19 03:35:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35: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 1Zo1EG-0000W3-Q6; Mon, 19 Oct 2015 03:35: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 1Zo1EF-0000Vk-Mc
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:19 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	D2/5A-02324-7F464265; Mon, 19 Oct 2015 03:35:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1445225717!19672107!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5837 invoked from network); 19 Oct 2015 03:35:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:35:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1ED-0005ch-D8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1ED-0004At-At
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:17 +0000
Date: Mon, 19 Oct 2015 03:35:17 +0000
Message-Id: <E1Zo1ED-0004At-At@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m: fix typo "populete"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c3e4e915f136699aa1cb1d39a1c1571ace1761f5
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Oct 8 11:02:47 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:02:47 2015 +0200

    x86/p2m: fix typo "populete"
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@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 09144e0..1178832 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1287,7 +1287,7 @@ void p2m_mem_paging_drop_page(struct domain *d, unsigned long gfn,
 }
 
 /**
- * p2m_mem_paging_populate - Tell pager to populete a paged page
+ * p2m_mem_paging_populate - Tell pager to populate a paged page
  * @d: guest domain
  * @gfn: guest page in paging 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 Mon Oct 19 03:35:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1ER-0000YR-Ug; Mon, 19 Oct 2015 03:35:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EQ-0000Y8-59
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:30 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	B7/43-05979-10564265; Mon, 19 Oct 2015 03:35:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1445225727!54297654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6443 invoked from network); 19 Oct 2015 03:35: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;
	19 Oct 2015 03:35:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EN-0005cp-NT
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EN-0004Bl-Ll
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:27 +0000
Date: Mon, 19 Oct 2015 03:35:27 +0000
Message-Id: <E1Zo1EN-0004Bl-Ll@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e3352222b45d999611da51616ae0180601dfd4b
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:19:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:19:28 2015 +0200

    efi: split out efi_init()
    
    ..which initializes basic EFI variables. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 2bc5b25..ba285d4 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -597,6 +597,22 @@ static char *__init get_value(const struct file *cfg, const char *section,
     return NULL;
 }
 
+static void __init efi_init(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;
+    efi_version = SystemTable->Hdr.Revision;
+    efi_fw_vendor = SystemTable->FirmwareVendor;
+    efi_fw_revision = SystemTable->FirmwareRevision;
+
+    StdOut = SystemTable->ConOut;
+    StdErr = SystemTable->StdErr ?: StdOut;
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -719,18 +735,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     char *option_str;
     bool_t use_cfg_file;
 
-    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;
-    efi_version = SystemTable->Hdr.Revision;
-    efi_fw_vendor = SystemTable->FirmwareVendor;
-    efi_fw_revision = SystemTable->FirmwareRevision;
+    efi_init(ImageHandle, SystemTable);
 
-    StdOut = SystemTable->ConOut;
-    StdErr = SystemTable->StdErr ?: StdOut;
     use_cfg_file = efi_arch_use_config_file(SystemTable);
 
     status = efi_bs->HandleProtocol(ImageHandle, &loaded_image_guid,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:35:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1ER-0000YR-Ug; Mon, 19 Oct 2015 03:35:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EQ-0000Y8-59
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:30 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	B7/43-05979-10564265; Mon, 19 Oct 2015 03:35:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1445225727!54297654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6443 invoked from network); 19 Oct 2015 03:35: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;
	19 Oct 2015 03:35:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EN-0005cp-NT
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EN-0004Bl-Ll
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:27 +0000
Date: Mon, 19 Oct 2015 03:35:27 +0000
Message-Id: <E1Zo1EN-0004Bl-Ll@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e3352222b45d999611da51616ae0180601dfd4b
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:19:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:19:28 2015 +0200

    efi: split out efi_init()
    
    ..which initializes basic EFI variables. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 2bc5b25..ba285d4 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -597,6 +597,22 @@ static char *__init get_value(const struct file *cfg, const char *section,
     return NULL;
 }
 
+static void __init efi_init(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;
+    efi_version = SystemTable->Hdr.Revision;
+    efi_fw_vendor = SystemTable->FirmwareVendor;
+    efi_fw_revision = SystemTable->FirmwareRevision;
+
+    StdOut = SystemTable->ConOut;
+    StdErr = SystemTable->StdErr ?: StdOut;
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -719,18 +735,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     char *option_str;
     bool_t use_cfg_file;
 
-    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;
-    efi_version = SystemTable->Hdr.Revision;
-    efi_fw_vendor = SystemTable->FirmwareVendor;
-    efi_fw_revision = SystemTable->FirmwareRevision;
+    efi_init(ImageHandle, SystemTable);
 
-    StdOut = SystemTable->ConOut;
-    StdErr = SystemTable->StdErr ?: StdOut;
     use_cfg_file = efi_arch_use_config_file(SystemTable);
 
     status = efi_bs->HandleProtocol(ImageHandle, &loaded_image_guid,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:35:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35: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 1Zo1Ec-0000aC-14; Mon, 19 Oct 2015 03:35:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ea-0000Zv-FZ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:40 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	D4/53-05979-B0564265; Mon, 19 Oct 2015 03:35:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1445225738!22345820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4433 invoked from network); 19 Oct 2015 03:35:39 -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;
	19 Oct 2015 03:35:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EX-0005cx-UW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EX-0004CY-TY
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:37 +0000
Date: Mon, 19 Oct 2015 03:35:37 +0000
Message-Id: <E1Zo1EX-0004CY-TY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_console_set_mode()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43e6ee132d0e638be6ee4373a325f6eeb571ecaf
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:21:45 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:21:45 2015 +0200

    efi: split out efi_console_set_mode()
    
    ..which sets console mode. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index ba285d4..0506932 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -613,6 +613,25 @@ static void __init efi_init(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTabl
     StdErr = SystemTable->StdErr ?: StdOut;
 }
 
+static void __init efi_console_set_mode(void)
+{
+    UINTN cols, rows, size;
+    unsigned int best, i;
+
+    for ( i = 0, size = 0, best = StdOut->Mode->Mode;
+          i < StdOut->Mode->MaxMode; ++i )
+    {
+        if ( StdOut->QueryMode(StdOut, i, &cols, &rows) == EFI_SUCCESS &&
+             cols * rows > size )
+        {
+            size = cols * rows;
+            best = i;
+        }
+    }
+    if ( best != StdOut->Mode->Mode )
+        StdOut->SetMode(StdOut, best);
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -797,23 +816,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         }
 
         if ( !base_video )
-        {
-            unsigned int best;
-            UINTN cols, rows, size;
-
-            for ( i = 0, size = 0, best = StdOut->Mode->Mode;
-                  i < StdOut->Mode->MaxMode; ++i )
-            {
-                if ( StdOut->QueryMode(StdOut, i, &cols, &rows) == EFI_SUCCESS &&
-                     cols * rows > size )
-                {
-                    size = cols * rows;
-                    best = i;
-                }
-            }
-            if ( best != StdOut->Mode->Mode )
-                StdOut->SetMode(StdOut, best);
-        }
+            efi_console_set_mode();
     }
 
     PrintStr(L"Xen " __stringify(XEN_VERSION) "." __stringify(XEN_SUBVERSION)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:35:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35: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 1Zo1Ec-0000aC-14; Mon, 19 Oct 2015 03:35:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ea-0000Zv-FZ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:40 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	D4/53-05979-B0564265; Mon, 19 Oct 2015 03:35:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1445225738!22345820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4433 invoked from network); 19 Oct 2015 03:35:39 -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;
	19 Oct 2015 03:35:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EX-0005cx-UW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1EX-0004CY-TY
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:37 +0000
Date: Mon, 19 Oct 2015 03:35:37 +0000
Message-Id: <E1Zo1EX-0004CY-TY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_console_set_mode()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43e6ee132d0e638be6ee4373a325f6eeb571ecaf
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:21:45 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:21:45 2015 +0200

    efi: split out efi_console_set_mode()
    
    ..which sets console mode. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index ba285d4..0506932 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -613,6 +613,25 @@ static void __init efi_init(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTabl
     StdErr = SystemTable->StdErr ?: StdOut;
 }
 
+static void __init efi_console_set_mode(void)
+{
+    UINTN cols, rows, size;
+    unsigned int best, i;
+
+    for ( i = 0, size = 0, best = StdOut->Mode->Mode;
+          i < StdOut->Mode->MaxMode; ++i )
+    {
+        if ( StdOut->QueryMode(StdOut, i, &cols, &rows) == EFI_SUCCESS &&
+             cols * rows > size )
+        {
+            size = cols * rows;
+            best = i;
+        }
+    }
+    if ( best != StdOut->Mode->Mode )
+        StdOut->SetMode(StdOut, best);
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -797,23 +816,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         }
 
         if ( !base_video )
-        {
-            unsigned int best;
-            UINTN cols, rows, size;
-
-            for ( i = 0, size = 0, best = StdOut->Mode->Mode;
-                  i < StdOut->Mode->MaxMode; ++i )
-            {
-                if ( StdOut->QueryMode(StdOut, i, &cols, &rows) == EFI_SUCCESS &&
-                     cols * rows > size )
-                {
-                    size = cols * rows;
-                    best = i;
-                }
-            }
-            if ( best != StdOut->Mode->Mode )
-                StdOut->SetMode(StdOut, best);
-        }
+            efi_console_set_mode();
     }
 
     PrintStr(L"Xen " __stringify(XEN_VERSION) "." __stringify(XEN_SUBVERSION)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:35:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35: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 1Zo1Em-0000bx-3e; Mon, 19 Oct 2015 03:35: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 1Zo1Ek-0000bX-Lm
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:50 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	41/80-03763-51564265; Mon, 19 Oct 2015 03:35:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445225748!21524214!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 27749 invoked from network); 19 Oct 2015 03:35:49 -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;
	19 Oct 2015 03:35:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ei-0005d5-76
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ei-0004E5-4d
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:48 +0000
Date: Mon, 19 Oct 2015 03:35:48 +0000
Message-Id: <E1Zo1Ei-0004E5-4d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_get_gop()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fd08b427a0f65c6746a7c236e0de96167c59964
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:22:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:22:52 2015 +0200

    efi: split out efi_get_gop()
    
    ..which gets pointer to GOP device. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   59 +++++++++++++++++++++++++++++-------------------
 1 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 0506932..44b0400 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -632,6 +632,41 @@ static void __init efi_console_set_mode(void)
         StdOut->SetMode(StdOut, best);
 }
 
+static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(void)
+{
+    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
+    EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
+    EFI_HANDLE *handles;
+    EFI_STATUS status;
+    UINTN info_size, size = 0;
+    static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
+    unsigned int i;
+
+    status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size, NULL);
+    if ( status == EFI_BUFFER_TOO_SMALL )
+        status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
+    if ( !EFI_ERROR(status) )
+        status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size,
+                                      handles);
+    if ( EFI_ERROR(status) )
+        size = 0;
+    for ( i = 0; i < size / sizeof(*handles); ++i )
+    {
+        status = efi_bs->HandleProtocol(handles[i], &gop_guid, (void **)&gop);
+        if ( EFI_ERROR(status) )
+            continue;
+        status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info);
+        if ( !EFI_ERROR(status) )
+            break;
+    }
+    if ( handles )
+        efi_bs->FreePool(handles);
+    if ( EFI_ERROR(status) )
+        gop = NULL;
+
+    return gop;
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -738,14 +773,12 @@ void EFIAPI __init noreturn
 efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 {
     static EFI_GUID __initdata loaded_image_guid = LOADED_IMAGE_PROTOCOL;
-    static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
     static EFI_GUID __initdata shim_lock_guid = SHIM_LOCK_PROTOCOL_GUID;
     EFI_LOADED_IMAGE *loaded_image;
     EFI_STATUS status;
     unsigned int i, argc;
     CHAR16 **argv, *file_name, *cfg_file_name = NULL, *options = NULL;
     UINTN map_key, info_size, gop_mode = ~0;
-    EFI_HANDLE *handles = NULL;
     EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
     EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
@@ -835,27 +868,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
                                &cols, &rows) == EFI_SUCCESS )
             efi_arch_console_init(cols, rows);
 
-        status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size, NULL);
-        if ( status == EFI_BUFFER_TOO_SMALL )
-            status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
-        if ( !EFI_ERROR(status) )
-            status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size,
-                                          handles);
-        if ( EFI_ERROR(status) )
-            size = 0;
-        for ( i = 0; i < size / sizeof(*handles); ++i )
-        {
-            status = efi_bs->HandleProtocol(handles[i], &gop_guid, (void **)&gop);
-            if ( EFI_ERROR(status) )
-                continue;
-            status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info);
-            if ( !EFI_ERROR(status) )
-                break;
-        }
-        if ( handles )
-            efi_bs->FreePool(handles);
-        if ( EFI_ERROR(status) )
-            gop = NULL;
+        gop = efi_get_gop();
 
         /* Get the file system interface. */
         dir_handle = get_parent_handle(loaded_image, &file_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 Mon Oct 19 03:35:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:35: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 1Zo1Em-0000bx-3e; Mon, 19 Oct 2015 03:35: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 1Zo1Ek-0000bX-Lm
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:50 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	41/80-03763-51564265; Mon, 19 Oct 2015 03:35:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445225748!21524214!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 27749 invoked from network); 19 Oct 2015 03:35:49 -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;
	19 Oct 2015 03:35:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ei-0005d5-76
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ei-0004E5-4d
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:48 +0000
Date: Mon, 19 Oct 2015 03:35:48 +0000
Message-Id: <E1Zo1Ei-0004E5-4d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_get_gop()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fd08b427a0f65c6746a7c236e0de96167c59964
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:22:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:22:52 2015 +0200

    efi: split out efi_get_gop()
    
    ..which gets pointer to GOP device. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   59 +++++++++++++++++++++++++++++-------------------
 1 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 0506932..44b0400 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -632,6 +632,41 @@ static void __init efi_console_set_mode(void)
         StdOut->SetMode(StdOut, best);
 }
 
+static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(void)
+{
+    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
+    EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
+    EFI_HANDLE *handles;
+    EFI_STATUS status;
+    UINTN info_size, size = 0;
+    static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
+    unsigned int i;
+
+    status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size, NULL);
+    if ( status == EFI_BUFFER_TOO_SMALL )
+        status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
+    if ( !EFI_ERROR(status) )
+        status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size,
+                                      handles);
+    if ( EFI_ERROR(status) )
+        size = 0;
+    for ( i = 0; i < size / sizeof(*handles); ++i )
+    {
+        status = efi_bs->HandleProtocol(handles[i], &gop_guid, (void **)&gop);
+        if ( EFI_ERROR(status) )
+            continue;
+        status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info);
+        if ( !EFI_ERROR(status) )
+            break;
+    }
+    if ( handles )
+        efi_bs->FreePool(handles);
+    if ( EFI_ERROR(status) )
+        gop = NULL;
+
+    return gop;
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -738,14 +773,12 @@ void EFIAPI __init noreturn
 efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 {
     static EFI_GUID __initdata loaded_image_guid = LOADED_IMAGE_PROTOCOL;
-    static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
     static EFI_GUID __initdata shim_lock_guid = SHIM_LOCK_PROTOCOL_GUID;
     EFI_LOADED_IMAGE *loaded_image;
     EFI_STATUS status;
     unsigned int i, argc;
     CHAR16 **argv, *file_name, *cfg_file_name = NULL, *options = NULL;
     UINTN map_key, info_size, gop_mode = ~0;
-    EFI_HANDLE *handles = NULL;
     EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
     EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
@@ -835,27 +868,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
                                &cols, &rows) == EFI_SUCCESS )
             efi_arch_console_init(cols, rows);
 
-        status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size, NULL);
-        if ( status == EFI_BUFFER_TOO_SMALL )
-            status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
-        if ( !EFI_ERROR(status) )
-            status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size,
-                                          handles);
-        if ( EFI_ERROR(status) )
-            size = 0;
-        for ( i = 0; i < size / sizeof(*handles); ++i )
-        {
-            status = efi_bs->HandleProtocol(handles[i], &gop_guid, (void **)&gop);
-            if ( EFI_ERROR(status) )
-                continue;
-            status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info);
-            if ( !EFI_ERROR(status) )
-                break;
-        }
-        if ( handles )
-            efi_bs->FreePool(handles);
-        if ( EFI_ERROR(status) )
-            gop = NULL;
+        gop = efi_get_gop();
 
         /* Get the file system interface. */
         dir_handle = get_parent_handle(loaded_image, &file_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 Mon Oct 19 03:36:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1Ew-0000dg-6H; Mon, 19 Oct 2015 03:36:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ev-0000dU-Jt
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:01 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	F6/41-14422-02564265; Mon, 19 Oct 2015 03:36:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445225758!43127912!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27187 invoked from network); 19 Oct 2015 03:35:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:35:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Es-0005dD-JN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Es-0004FJ-H6
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:58 +0000
Date: Mon, 19 Oct 2015 03:35:58 +0000
Message-Id: <E1Zo1Es-0004FJ-H6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_find_gop_mode()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c36226f41a5c03608068f56e2b1f56de690ae5b
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:23:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:23:28 2015 +0200

    efi: split out efi_find_gop_mode()
    
    ..which finds suitable GOP mode. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   89 +++++++++++++++++++++++++++---------------------
 1 files changed, 50 insertions(+), 39 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 44b0400..f3146a8 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -667,6 +667,55 @@ static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(void)
     return gop;
 }
 
+static UINTN __init efi_find_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
+                                      UINTN cols, UINTN rows, UINTN depth)
+{
+    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
+    EFI_STATUS status;
+    UINTN gop_mode = ~0, info_size, size;
+    unsigned int i;
+
+    for ( i = size = 0; i < gop->Mode->MaxMode; ++i )
+    {
+        unsigned int bpp = 0;
+
+        status = gop->QueryMode(gop, i, &info_size, &mode_info);
+        if ( EFI_ERROR(status) )
+            continue;
+        switch ( mode_info->PixelFormat )
+        {
+        case PixelBitMask:
+            bpp = hweight32(mode_info->PixelInformation.RedMask |
+                            mode_info->PixelInformation.GreenMask |
+                            mode_info->PixelInformation.BlueMask);
+            break;
+        case PixelRedGreenBlueReserved8BitPerColor:
+        case PixelBlueGreenRedReserved8BitPerColor:
+            bpp = 24;
+            break;
+        default:
+            continue;
+        }
+        if ( cols == mode_info->HorizontalResolution &&
+             rows == mode_info->VerticalResolution &&
+             (!depth || bpp == depth) )
+        {
+            gop_mode = i;
+            break;
+        }
+        if ( !cols && !rows &&
+             mode_info->HorizontalResolution *
+             mode_info->VerticalResolution > size )
+        {
+            size = mode_info->HorizontalResolution *
+                   mode_info->VerticalResolution;
+            gop_mode = i;
+        }
+    }
+
+    return gop_mode;
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -977,45 +1026,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         dir_handle->Close(dir_handle);
 
         if ( gop && !base_video )
-        {
-            for ( i = size = 0; i < gop->Mode->MaxMode; ++i )
-            {
-                unsigned int bpp = 0;
-
-                status = gop->QueryMode(gop, i, &info_size, &mode_info);
-                if ( EFI_ERROR(status) )
-                    continue;
-                switch ( mode_info->PixelFormat )
-                {
-                case PixelBitMask:
-                    bpp = hweight32(mode_info->PixelInformation.RedMask |
-                                    mode_info->PixelInformation.GreenMask |
-                                    mode_info->PixelInformation.BlueMask);
-                    break;
-                case PixelRedGreenBlueReserved8BitPerColor:
-                case PixelBlueGreenRedReserved8BitPerColor:
-                    bpp = 24;
-                    break;
-                default:
-                    continue;
-                }
-                if ( cols == mode_info->HorizontalResolution &&
-                     rows == mode_info->VerticalResolution &&
-                     (!depth || bpp == depth) )
-                {
-                    gop_mode = i;
-                    break;
-                }
-                if ( !cols && !rows &&
-                     mode_info->HorizontalResolution *
-                     mode_info->VerticalResolution > size )
-                {
-                    size = mode_info->HorizontalResolution *
-                           mode_info->VerticalResolution;
-                    gop_mode = i;
-                }
-            }
-        }
+            gop_mode = efi_find_gop_mode(gop, cols, rows, depth);
     }
 
     efi_arch_edd();
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:36:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1Ew-0000dg-6H; Mon, 19 Oct 2015 03:36:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ev-0000dU-Jt
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:01 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	F6/41-14422-02564265; Mon, 19 Oct 2015 03:36:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445225758!43127912!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27187 invoked from network); 19 Oct 2015 03:35:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:35:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Es-0005dD-JN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Es-0004FJ-H6
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:35:58 +0000
Date: Mon, 19 Oct 2015 03:35:58 +0000
Message-Id: <E1Zo1Es-0004FJ-H6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_find_gop_mode()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c36226f41a5c03608068f56e2b1f56de690ae5b
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:23:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:23:28 2015 +0200

    efi: split out efi_find_gop_mode()
    
    ..which finds suitable GOP mode. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   89 +++++++++++++++++++++++++++---------------------
 1 files changed, 50 insertions(+), 39 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 44b0400..f3146a8 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -667,6 +667,55 @@ static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(void)
     return gop;
 }
 
+static UINTN __init efi_find_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
+                                      UINTN cols, UINTN rows, UINTN depth)
+{
+    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
+    EFI_STATUS status;
+    UINTN gop_mode = ~0, info_size, size;
+    unsigned int i;
+
+    for ( i = size = 0; i < gop->Mode->MaxMode; ++i )
+    {
+        unsigned int bpp = 0;
+
+        status = gop->QueryMode(gop, i, &info_size, &mode_info);
+        if ( EFI_ERROR(status) )
+            continue;
+        switch ( mode_info->PixelFormat )
+        {
+        case PixelBitMask:
+            bpp = hweight32(mode_info->PixelInformation.RedMask |
+                            mode_info->PixelInformation.GreenMask |
+                            mode_info->PixelInformation.BlueMask);
+            break;
+        case PixelRedGreenBlueReserved8BitPerColor:
+        case PixelBlueGreenRedReserved8BitPerColor:
+            bpp = 24;
+            break;
+        default:
+            continue;
+        }
+        if ( cols == mode_info->HorizontalResolution &&
+             rows == mode_info->VerticalResolution &&
+             (!depth || bpp == depth) )
+        {
+            gop_mode = i;
+            break;
+        }
+        if ( !cols && !rows &&
+             mode_info->HorizontalResolution *
+             mode_info->VerticalResolution > size )
+        {
+            size = mode_info->HorizontalResolution *
+                   mode_info->VerticalResolution;
+            gop_mode = i;
+        }
+    }
+
+    return gop_mode;
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -977,45 +1026,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         dir_handle->Close(dir_handle);
 
         if ( gop && !base_video )
-        {
-            for ( i = size = 0; i < gop->Mode->MaxMode; ++i )
-            {
-                unsigned int bpp = 0;
-
-                status = gop->QueryMode(gop, i, &info_size, &mode_info);
-                if ( EFI_ERROR(status) )
-                    continue;
-                switch ( mode_info->PixelFormat )
-                {
-                case PixelBitMask:
-                    bpp = hweight32(mode_info->PixelInformation.RedMask |
-                                    mode_info->PixelInformation.GreenMask |
-                                    mode_info->PixelInformation.BlueMask);
-                    break;
-                case PixelRedGreenBlueReserved8BitPerColor:
-                case PixelBlueGreenRedReserved8BitPerColor:
-                    bpp = 24;
-                    break;
-                default:
-                    continue;
-                }
-                if ( cols == mode_info->HorizontalResolution &&
-                     rows == mode_info->VerticalResolution &&
-                     (!depth || bpp == depth) )
-                {
-                    gop_mode = i;
-                    break;
-                }
-                if ( !cols && !rows &&
-                     mode_info->HorizontalResolution *
-                     mode_info->VerticalResolution > size )
-                {
-                    size = mode_info->HorizontalResolution *
-                           mode_info->VerticalResolution;
-                    gop_mode = i;
-                }
-            }
-        }
+            gop_mode = efi_find_gop_mode(gop, cols, rows, depth);
     }
 
     efi_arch_edd();
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:36:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1F6-0000fN-97; Mon, 19 Oct 2015 03:36: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 1Zo1F5-0000fG-Kg
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:11 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	BC/03-26043-B2564265; Mon, 19 Oct 2015 03:36:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1445225769!32797874!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12647 invoked from network); 19 Oct 2015 03:36: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;
	19 Oct 2015 03:36:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1F2-0005do-W2
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1F2-0004GC-Qv
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:08 +0000
Date: Mon, 19 Oct 2015 03:36:08 +0000
Message-Id: <E1Zo1F2-0004GC-Qv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_tables()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0dd7e37832f71eabd83906039641bcac9e13b919
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:24:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:24:00 2015 +0200

    efi: split out efi_tables()
    
    ..which collects system tables data. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   61 +++++++++++++++++++++++++++---------------------
 1 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index f3146a8..3e900dc 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -716,6 +716,39 @@ static UINTN __init efi_find_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
     return gop_mode;
 }
 
+static void __init efi_tables(void)
+{
+    unsigned int i;
+
+    /* Obtain basic table pointers. */
+    for ( i = 0; i < efi_num_ct; ++i )
+    {
+        static EFI_GUID __initdata acpi2_guid = ACPI_20_TABLE_GUID;
+        static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
+        static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
+        static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
+        static EFI_GUID __initdata smbios3_guid = SMBIOS3_TABLE_GUID;
+
+        if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
+	       efi.acpi20 = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&acpi_guid, &efi_ct[i].VendorGuid) )
+	       efi.acpi = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&mps_guid, &efi_ct[i].VendorGuid) )
+	       efi.mps = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
+	       efi.smbios = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) )
+	       efi.smbios3 = (long)efi_ct[i].VendorTable;
+    }
+
+#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
+    dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
+                      ? (void *)(long)efi.smbios : NULL,
+                      efi.smbios3 != EFI_INVALID_TABLE_ADDR
+                      ? (void *)(long)efi.smbios3 : NULL);
+#endif
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -1034,33 +1067,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     /* XXX Collect EDID info. */
     efi_arch_cpu();
 
-    /* Obtain basic table pointers. */
-    for ( i = 0; i < efi_num_ct; ++i )
-    {
-        static EFI_GUID __initdata acpi2_guid = ACPI_20_TABLE_GUID;
-        static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
-        static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
-        static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
-        static EFI_GUID __initdata smbios3_guid = SMBIOS3_TABLE_GUID;
-
-        if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
-	       efi.acpi20 = (long)efi_ct[i].VendorTable;
-        if ( match_guid(&acpi_guid, &efi_ct[i].VendorGuid) )
-	       efi.acpi = (long)efi_ct[i].VendorTable;
-        if ( match_guid(&mps_guid, &efi_ct[i].VendorGuid) )
-	       efi.mps = (long)efi_ct[i].VendorTable;
-        if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
-	       efi.smbios = (long)efi_ct[i].VendorTable;
-        if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) )
-	       efi.smbios3 = (long)efi_ct[i].VendorTable;
-    }
-
-#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
-    dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
-                      ? (void *)(long)efi.smbios : NULL,
-                      efi.smbios3 != EFI_INVALID_TABLE_ADDR
-                      ? (void *)(long)efi.smbios3 : NULL);
-#endif
+    efi_tables();
 
     /* Collect PCI ROM contents. */
     setup_efi_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 Mon Oct 19 03:36:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1F6-0000fN-97; Mon, 19 Oct 2015 03:36: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 1Zo1F5-0000fG-Kg
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:11 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	BC/03-26043-B2564265; Mon, 19 Oct 2015 03:36:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1445225769!32797874!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12647 invoked from network); 19 Oct 2015 03:36: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;
	19 Oct 2015 03:36:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1F2-0005do-W2
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1F2-0004GC-Qv
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:08 +0000
Date: Mon, 19 Oct 2015 03:36:08 +0000
Message-Id: <E1Zo1F2-0004GC-Qv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_tables()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0dd7e37832f71eabd83906039641bcac9e13b919
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:24:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:24:00 2015 +0200

    efi: split out efi_tables()
    
    ..which collects system tables data. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   61 +++++++++++++++++++++++++++---------------------
 1 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index f3146a8..3e900dc 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -716,6 +716,39 @@ static UINTN __init efi_find_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
     return gop_mode;
 }
 
+static void __init efi_tables(void)
+{
+    unsigned int i;
+
+    /* Obtain basic table pointers. */
+    for ( i = 0; i < efi_num_ct; ++i )
+    {
+        static EFI_GUID __initdata acpi2_guid = ACPI_20_TABLE_GUID;
+        static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
+        static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
+        static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
+        static EFI_GUID __initdata smbios3_guid = SMBIOS3_TABLE_GUID;
+
+        if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
+	       efi.acpi20 = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&acpi_guid, &efi_ct[i].VendorGuid) )
+	       efi.acpi = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&mps_guid, &efi_ct[i].VendorGuid) )
+	       efi.mps = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
+	       efi.smbios = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) )
+	       efi.smbios3 = (long)efi_ct[i].VendorTable;
+    }
+
+#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
+    dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
+                      ? (void *)(long)efi.smbios : NULL,
+                      efi.smbios3 != EFI_INVALID_TABLE_ADDR
+                      ? (void *)(long)efi.smbios3 : NULL);
+#endif
+}
+
 static void __init setup_efi_pci(void)
 {
     EFI_STATUS status;
@@ -1034,33 +1067,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     /* XXX Collect EDID info. */
     efi_arch_cpu();
 
-    /* Obtain basic table pointers. */
-    for ( i = 0; i < efi_num_ct; ++i )
-    {
-        static EFI_GUID __initdata acpi2_guid = ACPI_20_TABLE_GUID;
-        static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
-        static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
-        static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
-        static EFI_GUID __initdata smbios3_guid = SMBIOS3_TABLE_GUID;
-
-        if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
-	       efi.acpi20 = (long)efi_ct[i].VendorTable;
-        if ( match_guid(&acpi_guid, &efi_ct[i].VendorGuid) )
-	       efi.acpi = (long)efi_ct[i].VendorTable;
-        if ( match_guid(&mps_guid, &efi_ct[i].VendorGuid) )
-	       efi.mps = (long)efi_ct[i].VendorTable;
-        if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
-	       efi.smbios = (long)efi_ct[i].VendorTable;
-        if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) )
-	       efi.smbios3 = (long)efi_ct[i].VendorTable;
-    }
-
-#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
-    dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
-                      ? (void *)(long)efi.smbios : NULL,
-                      efi.smbios3 != EFI_INVALID_TABLE_ADDR
-                      ? (void *)(long)efi.smbios3 : NULL);
-#endif
+    efi_tables();
 
     /* Collect PCI ROM contents. */
     setup_efi_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 Mon Oct 19 03:36:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1FG-0000h4-Bl; Mon, 19 Oct 2015 03:36:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FF-0000gk-If
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:21 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	20/F7-01748-43564265; Mon, 19 Oct 2015 03:36:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445225779!23119343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23162 invoked from network); 19 Oct 2015 03:36:20 -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;
	19 Oct 2015 03:36:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FD-0005dw-BQ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FD-0004H2-6a
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:19 +0000
Date: Mon, 19 Oct 2015 03:36:19 +0000
Message-Id: <E1Zo1FD-0004H2-6a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_variables()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c890487659ca92ca666df19379490deb85169884
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:24:31 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:24:31 2015 +0200

    efi: split out efi_variables()
    
    ..which collects variable store parameters. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   41 ++++++++++++++++++++++++-----------------
 1 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 3e900dc..9bbb952 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -836,6 +836,29 @@ static void __init setup_efi_pci(void)
     efi_bs->FreePool(handles);
 }
 
+static void __init efi_variables(void)
+{
+    EFI_STATUS status;
+
+    status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
+             efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
+                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                       EFI_VARIABLE_RUNTIME_ACCESS,
+                                       &efi_boot_max_var_store_size,
+                                       &efi_boot_remain_var_store_size,
+                                       &efi_boot_max_var_size) :
+             EFI_INCOMPATIBLE_VERSION;
+    if ( EFI_ERROR(status) )
+    {
+        efi_boot_max_var_store_size = 0;
+        efi_boot_remain_var_store_size = 0;
+        efi_boot_max_var_size = status;
+        PrintStr(L"Warning: Could not query variable store: ");
+        DisplayUint(status, 0);
+        PrintStr(newline);
+    }
+}
+
 static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz)
 {
    if ( bpp < 0 )
@@ -1073,23 +1096,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     setup_efi_pci();
 
     /* Get snapshot of variable store parameters. */
-    status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
-             efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
-                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                       EFI_VARIABLE_RUNTIME_ACCESS,
-                                       &efi_boot_max_var_store_size,
-                                       &efi_boot_remain_var_store_size,
-                                       &efi_boot_max_var_size) :
-             EFI_INCOMPATIBLE_VERSION;
-    if ( EFI_ERROR(status) )
-    {
-        efi_boot_max_var_store_size = 0;
-        efi_boot_remain_var_store_size = 0;
-        efi_boot_max_var_size = status;
-        PrintStr(L"Warning: Could not query variable store: ");
-        DisplayUint(status, 0);
-        PrintStr(newline);
-    }
+    efi_variables();
 
     efi_arch_memory_setup();
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:36:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1FG-0000h4-Bl; Mon, 19 Oct 2015 03:36:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FF-0000gk-If
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:21 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	20/F7-01748-43564265; Mon, 19 Oct 2015 03:36:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445225779!23119343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23162 invoked from network); 19 Oct 2015 03:36:20 -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;
	19 Oct 2015 03:36:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FD-0005dw-BQ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FD-0004H2-6a
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:19 +0000
Date: Mon, 19 Oct 2015 03:36:19 +0000
Message-Id: <E1Zo1FD-0004H2-6a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_variables()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c890487659ca92ca666df19379490deb85169884
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:24:31 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:24:31 2015 +0200

    efi: split out efi_variables()
    
    ..which collects variable store parameters. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   41 ++++++++++++++++++++++++-----------------
 1 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 3e900dc..9bbb952 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -836,6 +836,29 @@ static void __init setup_efi_pci(void)
     efi_bs->FreePool(handles);
 }
 
+static void __init efi_variables(void)
+{
+    EFI_STATUS status;
+
+    status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
+             efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
+                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                       EFI_VARIABLE_RUNTIME_ACCESS,
+                                       &efi_boot_max_var_store_size,
+                                       &efi_boot_remain_var_store_size,
+                                       &efi_boot_max_var_size) :
+             EFI_INCOMPATIBLE_VERSION;
+    if ( EFI_ERROR(status) )
+    {
+        efi_boot_max_var_store_size = 0;
+        efi_boot_remain_var_store_size = 0;
+        efi_boot_max_var_size = status;
+        PrintStr(L"Warning: Could not query variable store: ");
+        DisplayUint(status, 0);
+        PrintStr(newline);
+    }
+}
+
 static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz)
 {
    if ( bpp < 0 )
@@ -1073,23 +1096,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     setup_efi_pci();
 
     /* Get snapshot of variable store parameters. */
-    status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
-             efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
-                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                       EFI_VARIABLE_RUNTIME_ACCESS,
-                                       &efi_boot_max_var_store_size,
-                                       &efi_boot_remain_var_store_size,
-                                       &efi_boot_max_var_size) :
-             EFI_INCOMPATIBLE_VERSION;
-    if ( EFI_ERROR(status) )
-    {
-        efi_boot_max_var_store_size = 0;
-        efi_boot_remain_var_store_size = 0;
-        efi_boot_max_var_size = status;
-        PrintStr(L"Warning: Could not query variable store: ");
-        DisplayUint(status, 0);
-        PrintStr(newline);
-    }
+    efi_variables();
 
     efi_arch_memory_setup();
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:36:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1FR-0000j7-GK; Mon, 19 Oct 2015 03:36:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FQ-0000iq-AB
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:32 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	0E/CA-16965-F3564265; Mon, 19 Oct 2015 03:36:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445225789!21524272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30513 invoked from network); 19 Oct 2015 03:36:30 -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;
	19 Oct 2015 03:36:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FN-0005e4-KQ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FN-0004Hu-IW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:29 +0000
Date: Mon, 19 Oct 2015 03:36:29 +0000
Message-Id: <E1Zo1FN-0004Hu-IW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_set_gop_mode()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af79880d358de78ba52effb7daece27d42bc602c
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:25:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:25:09 2015 +0200

    efi: split out efi_set_gop_mode()
    
    ..which sets chosen GOP mode. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9bbb952..0be5d9e 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -859,6 +859,22 @@ static void __init efi_variables(void)
     }
 }
 
+static void __init efi_set_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop, UINTN gop_mode)
+{
+    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
+    EFI_STATUS status;
+    UINTN info_size;
+
+    /* Set graphics mode. */
+    if ( gop_mode < gop->Mode->MaxMode && gop_mode != gop->Mode->Mode )
+        gop->SetMode(gop, gop_mode);
+
+    /* Get graphics and frame buffer info. */
+    status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info);
+    if ( !EFI_ERROR(status) )
+        efi_arch_video_init(gop, info_size, mode_info);
+}
+
 static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz)
 {
    if ( bpp < 0 )
@@ -886,7 +902,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     UINTN map_key, info_size, gop_mode = ~0;
     EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
-    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
     union string section = { NULL }, name;
     bool_t base_video = 0, retry;
     char *option_str;
@@ -1101,17 +1116,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     efi_arch_memory_setup();
 
     if ( gop )
-    {
-
-        /* Set graphics mode. */
-        if ( gop_mode < gop->Mode->MaxMode && gop_mode != gop->Mode->Mode )
-            gop->SetMode(gop, gop_mode);
-
-        /* Get graphics and frame buffer info. */
-        status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info);
-        if ( !EFI_ERROR(status) )
-            efi_arch_video_init(gop, info_size, mode_info);
-    }
+        efi_set_gop_mode(gop, gop_mode);
 
     info_size = 0;
     efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:36:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1FR-0000j7-GK; Mon, 19 Oct 2015 03:36:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FQ-0000iq-AB
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:32 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	0E/CA-16965-F3564265; Mon, 19 Oct 2015 03:36:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445225789!21524272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30513 invoked from network); 19 Oct 2015 03:36:30 -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;
	19 Oct 2015 03:36:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FN-0005e4-KQ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FN-0004Hu-IW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:29 +0000
Date: Mon, 19 Oct 2015 03:36:29 +0000
Message-Id: <E1Zo1FN-0004Hu-IW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_set_gop_mode()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af79880d358de78ba52effb7daece27d42bc602c
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:25:09 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:25:09 2015 +0200

    efi: split out efi_set_gop_mode()
    
    ..which sets chosen GOP mode. We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9bbb952..0be5d9e 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -859,6 +859,22 @@ static void __init efi_variables(void)
     }
 }
 
+static void __init efi_set_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop, UINTN gop_mode)
+{
+    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
+    EFI_STATUS status;
+    UINTN info_size;
+
+    /* Set graphics mode. */
+    if ( gop_mode < gop->Mode->MaxMode && gop_mode != gop->Mode->Mode )
+        gop->SetMode(gop, gop_mode);
+
+    /* Get graphics and frame buffer info. */
+    status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info);
+    if ( !EFI_ERROR(status) )
+        efi_arch_video_init(gop, info_size, mode_info);
+}
+
 static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz)
 {
    if ( bpp < 0 )
@@ -886,7 +902,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     UINTN map_key, info_size, gop_mode = ~0;
     EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
-    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
     union string section = { NULL }, name;
     bool_t base_video = 0, retry;
     char *option_str;
@@ -1101,17 +1116,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     efi_arch_memory_setup();
 
     if ( gop )
-    {
-
-        /* Set graphics mode. */
-        if ( gop_mode < gop->Mode->MaxMode && gop_mode != gop->Mode->Mode )
-            gop->SetMode(gop, gop_mode);
-
-        /* Get graphics and frame buffer info. */
-        status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info);
-        if ( !EFI_ERROR(status) )
-            efi_arch_video_init(gop, info_size, mode_info);
-    }
+        efi_set_gop_mode(gop, gop_mode);
 
     info_size = 0;
     efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:36:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1Fd-00012q-Iv; Mon, 19 Oct 2015 03:36: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 1Zo1Fc-0000yL-EK
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:44 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	6B/79-22089-B4564265; Mon, 19 Oct 2015 03:36:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1445225800!43147707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28968 invoked from network); 19 Oct 2015 03:36:40 -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;
	19 Oct 2015 03:36:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FX-0005eC-Ul
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FX-0004Ik-Sa
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:39 +0000
Date: Mon, 19 Oct 2015 03:36:39 +0000
Message-Id: <E1Zo1FX-0004Ik-Sa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_exit_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 2fe4c0060c62a012109dab1d981522dc26822110
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:26:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:26:37 2015 +0200

    efi: split out efi_exit_boot()
    
    ..which gets memory map and calls ExitBootServices(). We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   92 ++++++++++++++++++++++++++----------------------
 1 files changed, 50 insertions(+), 42 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 0be5d9e..005bb2b 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -875,6 +875,53 @@ static void __init efi_set_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop, UINTN gop
         efi_arch_video_init(gop, info_size, mode_info);
 }
 
+static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
+{
+    EFI_STATUS status;
+    UINTN info_size = 0, map_key;
+    bool_t retry;
+
+    efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
+                         &efi_mdesc_size, &mdesc_ver);
+    info_size += 8 * efi_mdesc_size;
+    efi_memmap = efi_arch_allocate_mmap_buffer(info_size);
+    if ( !efi_memmap )
+        blexit(L"Unable to allocate memory for EFI memory map");
+
+    for ( retry = 0; ; retry = 1 )
+    {
+        efi_memmap_size = info_size;
+        status = SystemTable->BootServices->GetMemoryMap(&efi_memmap_size,
+                                                         efi_memmap, &map_key,
+                                                         &efi_mdesc_size,
+                                                         &mdesc_ver);
+        if ( EFI_ERROR(status) )
+            PrintErrMesg(L"Cannot obtain memory map", status);
+
+        efi_arch_process_memory_map(SystemTable, efi_memmap, efi_memmap_size,
+                                    efi_mdesc_size, mdesc_ver);
+
+        efi_arch_pre_exit_boot();
+
+        status = SystemTable->BootServices->ExitBootServices(ImageHandle,
+                                                             map_key);
+        efi_bs = NULL;
+        if ( status != EFI_INVALID_PARAMETER || retry )
+            break;
+    }
+
+    if ( EFI_ERROR(status) )
+        PrintErrMesg(L"Cannot exit boot services", status);
+
+    /* Adjust pointers into EFI. */
+    efi_ct = (void *)efi_ct + DIRECTMAP_VIRT_START;
+#ifdef USE_SET_VIRTUAL_ADDRESS_MAP
+    efi_rs = (void *)efi_rs + DIRECTMAP_VIRT_START;
+#endif
+    efi_memmap = (void *)efi_memmap + DIRECTMAP_VIRT_START;
+    efi_fw_vendor = (void *)efi_fw_vendor + DIRECTMAP_VIRT_START;
+}
+
 static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz)
 {
    if ( bpp < 0 )
@@ -899,11 +946,11 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     EFI_STATUS status;
     unsigned int i, argc;
     CHAR16 **argv, *file_name, *cfg_file_name = NULL, *options = NULL;
-    UINTN map_key, info_size, gop_mode = ~0;
+    UINTN gop_mode = ~0;
     EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
     union string section = { NULL }, name;
-    bool_t base_video = 0, retry;
+    bool_t base_video = 0;
     char *option_str;
     bool_t use_cfg_file;
 
@@ -1118,46 +1165,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     if ( gop )
         efi_set_gop_mode(gop, gop_mode);
 
-    info_size = 0;
-    efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
-                         &efi_mdesc_size, &mdesc_ver);
-    info_size += 8 * efi_mdesc_size;
-    efi_memmap = efi_arch_allocate_mmap_buffer(info_size);
-    if ( !efi_memmap )
-        blexit(L"Unable to allocate memory for EFI memory map");
-
-    for ( retry = 0; ; retry = 1 )
-    {
-        efi_memmap_size = info_size;
-        status = SystemTable->BootServices->GetMemoryMap(&efi_memmap_size,
-                                                         efi_memmap, &map_key,
-                                                         &efi_mdesc_size,
-                                                         &mdesc_ver);
-        if ( EFI_ERROR(status) )
-            PrintErrMesg(L"Cannot obtain memory map", status);
-
-        efi_arch_process_memory_map(SystemTable, efi_memmap, efi_memmap_size,
-                                    efi_mdesc_size, mdesc_ver);
-
-        efi_arch_pre_exit_boot();
-
-        status = SystemTable->BootServices->ExitBootServices(ImageHandle,
-                                                             map_key);
-        efi_bs = NULL;
-        if ( status != EFI_INVALID_PARAMETER || retry )
-            break;
-    }
-
-    if ( EFI_ERROR(status) )
-        PrintErrMesg(L"Cannot exit boot services", status);
-
-    /* Adjust pointers into EFI. */
-    efi_ct = (void *)efi_ct + DIRECTMAP_VIRT_START;
-#ifdef USE_SET_VIRTUAL_ADDRESS_MAP
-    efi_rs = (void *)efi_rs + DIRECTMAP_VIRT_START;
-#endif
-    efi_memmap = (void *)efi_memmap + DIRECTMAP_VIRT_START;
-    efi_fw_vendor = (void *)efi_fw_vendor + DIRECTMAP_VIRT_START;
+    efi_exit_boot(ImageHandle, SystemTable);
 
     efi_arch_post_exit_boot();
     for( ; ; ); /* not reached */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:36:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1Fd-00012q-Iv; Mon, 19 Oct 2015 03:36: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 1Zo1Fc-0000yL-EK
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:44 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	6B/79-22089-B4564265; Mon, 19 Oct 2015 03:36:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1445225800!43147707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28968 invoked from network); 19 Oct 2015 03:36:40 -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;
	19 Oct 2015 03:36:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FX-0005eC-Ul
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1FX-0004Ik-Sa
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:39 +0000
Date: Mon, 19 Oct 2015 03:36:39 +0000
Message-Id: <E1Zo1FX-0004Ik-Sa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: split out efi_exit_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 2fe4c0060c62a012109dab1d981522dc26822110
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 8 11:26:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 8 11:26:37 2015 +0200

    efi: split out efi_exit_boot()
    
    ..which gets memory map and calls ExitBootServices(). We want to re-use this
    code to support multiboot2 protocol on EFI platforms.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c |   92 ++++++++++++++++++++++++++----------------------
 1 files changed, 50 insertions(+), 42 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 0be5d9e..005bb2b 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -875,6 +875,53 @@ static void __init efi_set_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop, UINTN gop
         efi_arch_video_init(gop, info_size, mode_info);
 }
 
+static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
+{
+    EFI_STATUS status;
+    UINTN info_size = 0, map_key;
+    bool_t retry;
+
+    efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
+                         &efi_mdesc_size, &mdesc_ver);
+    info_size += 8 * efi_mdesc_size;
+    efi_memmap = efi_arch_allocate_mmap_buffer(info_size);
+    if ( !efi_memmap )
+        blexit(L"Unable to allocate memory for EFI memory map");
+
+    for ( retry = 0; ; retry = 1 )
+    {
+        efi_memmap_size = info_size;
+        status = SystemTable->BootServices->GetMemoryMap(&efi_memmap_size,
+                                                         efi_memmap, &map_key,
+                                                         &efi_mdesc_size,
+                                                         &mdesc_ver);
+        if ( EFI_ERROR(status) )
+            PrintErrMesg(L"Cannot obtain memory map", status);
+
+        efi_arch_process_memory_map(SystemTable, efi_memmap, efi_memmap_size,
+                                    efi_mdesc_size, mdesc_ver);
+
+        efi_arch_pre_exit_boot();
+
+        status = SystemTable->BootServices->ExitBootServices(ImageHandle,
+                                                             map_key);
+        efi_bs = NULL;
+        if ( status != EFI_INVALID_PARAMETER || retry )
+            break;
+    }
+
+    if ( EFI_ERROR(status) )
+        PrintErrMesg(L"Cannot exit boot services", status);
+
+    /* Adjust pointers into EFI. */
+    efi_ct = (void *)efi_ct + DIRECTMAP_VIRT_START;
+#ifdef USE_SET_VIRTUAL_ADDRESS_MAP
+    efi_rs = (void *)efi_rs + DIRECTMAP_VIRT_START;
+#endif
+    efi_memmap = (void *)efi_memmap + DIRECTMAP_VIRT_START;
+    efi_fw_vendor = (void *)efi_fw_vendor + DIRECTMAP_VIRT_START;
+}
+
 static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz)
 {
    if ( bpp < 0 )
@@ -899,11 +946,11 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     EFI_STATUS status;
     unsigned int i, argc;
     CHAR16 **argv, *file_name, *cfg_file_name = NULL, *options = NULL;
-    UINTN map_key, info_size, gop_mode = ~0;
+    UINTN gop_mode = ~0;
     EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
     union string section = { NULL }, name;
-    bool_t base_video = 0, retry;
+    bool_t base_video = 0;
     char *option_str;
     bool_t use_cfg_file;
 
@@ -1118,46 +1165,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     if ( gop )
         efi_set_gop_mode(gop, gop_mode);
 
-    info_size = 0;
-    efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
-                         &efi_mdesc_size, &mdesc_ver);
-    info_size += 8 * efi_mdesc_size;
-    efi_memmap = efi_arch_allocate_mmap_buffer(info_size);
-    if ( !efi_memmap )
-        blexit(L"Unable to allocate memory for EFI memory map");
-
-    for ( retry = 0; ; retry = 1 )
-    {
-        efi_memmap_size = info_size;
-        status = SystemTable->BootServices->GetMemoryMap(&efi_memmap_size,
-                                                         efi_memmap, &map_key,
-                                                         &efi_mdesc_size,
-                                                         &mdesc_ver);
-        if ( EFI_ERROR(status) )
-            PrintErrMesg(L"Cannot obtain memory map", status);
-
-        efi_arch_process_memory_map(SystemTable, efi_memmap, efi_memmap_size,
-                                    efi_mdesc_size, mdesc_ver);
-
-        efi_arch_pre_exit_boot();
-
-        status = SystemTable->BootServices->ExitBootServices(ImageHandle,
-                                                             map_key);
-        efi_bs = NULL;
-        if ( status != EFI_INVALID_PARAMETER || retry )
-            break;
-    }
-
-    if ( EFI_ERROR(status) )
-        PrintErrMesg(L"Cannot exit boot services", status);
-
-    /* Adjust pointers into EFI. */
-    efi_ct = (void *)efi_ct + DIRECTMAP_VIRT_START;
-#ifdef USE_SET_VIRTUAL_ADDRESS_MAP
-    efi_rs = (void *)efi_rs + DIRECTMAP_VIRT_START;
-#endif
-    efi_memmap = (void *)efi_memmap + DIRECTMAP_VIRT_START;
-    efi_fw_vendor = (void *)efi_fw_vendor + DIRECTMAP_VIRT_START;
+    efi_exit_boot(ImageHandle, SystemTable);
 
     efi_arch_post_exit_boot();
     for( ; ; ); /* not reached */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:36:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1Fm-0001AJ-Lj; Mon, 19 Oct 2015 03:36: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 1Zo1Fl-0001A5-HM
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:53 +0000
Content-Length: 10347
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	D6/4C-16618-45564265; Mon, 19 Oct 2015 03:36:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1445225810!56720582!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9538 invoked from network); 19 Oct 2015 03:36:51 -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;
	19 Oct 2015 03:36:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Fi-0005eH-Ag
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Fi-0004K9-7p
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:50 +0000
Date: Mon, 19 Oct 2015 03:36:50 +0000
Message-Id: <E1Zo1Fi-0004K9-7p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: split x86 HVM setup_guest into
	smaller logical 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: multipart/mixed; boundary="===============4796410083558920407=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4796410083558920407==
Content-Length: 10198
Content-Transfer-Encoding: quoted-printable

commit c64ef24febcf5bc6c6da733abd256412da8c4895
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:33 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:12:04 2015 +0100

    libxc: split x86 HVM setup_guest into smaller logical functions
    
    This is just a preparatory change to clean up the code in setup_guest.
    Should not introduce any functional changes.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/xc_hvm_build_x86.c |  198 +++++++++++++++++++++++----------------
 1 files changed, 117 insertions(+), 81 deletions(-)

diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index ea250dd..4d3736b 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -231,28 +231,20 @@ static int check_mmio_hole(uint64_t start, uint64_t memsize,
         return 1;
 }
 
-static int setup_guest(xc_interface *xch,
-                       uint32_t dom, struct xc_hvm_build_args *args,
-                       char *image, unsigned long image_size)
+static int xc_hvm_populate_memory(xc_interface *xch, uint32_t dom,
+                                  struct xc_hvm_build_args *args,
+                                  xen_pfn_t *page_array)
 {
-    xen_pfn_t *page_array =3D NULL;
     unsigned long i, vmemid, nr_pages =3D args->mem_size >> PAGE_SHIFT;
     unsigned long p2m_size;
     unsigned long target_pages =3D args->mem_target >> PAGE_SHIFT;
-    unsigned long entry_eip, cur_pages, cur_pfn;
-    void *hvm_info_page;
-    uint32_t *ident_pt;
-    struct elf_binary elf;
-    uint64_t v_start, v_end;
-    uint64_t m_start =3D 0, m_end =3D 0;
+    unsigned long cur_pages, cur_pfn;
     int rc;
     xen_capabilities_info_t caps;
     unsigned long stat_normal_pages =3D 0, stat_2mb_pages =3D 0, 
         stat_1gb_pages =3D 0;
     unsigned int memflags =3D 0;
     int claim_enabled =3D args->claim_enabled;
-    xen_pfn_t special_array[NR_SPECIAL_PAGES];
-    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
     uint64_t total_pages;
     xen_vmemrange_t dummy_vmemrange[2];
     unsigned int dummy_vnode_to_pnode[1];
@@ -260,19 +252,6 @@ static int setup_guest(xc_interface *xch,
     unsigned int *vnode_to_pnode;
     unsigned int nr_vmemranges, nr_vnodes;
 
-    memset(&elf, 0, sizeof(elf));
-    if ( elf_init(&elf, image, image_size) !=3D 0 )
-    {
-        PERROR("Could not initialise ELF image");
-        goto error_out;
-    }
-
-    xc_elf_set_logfile(xch, &elf, 1);
-
-    elf_parse_binary(&elf);
-    v_start =3D 0;
-    v_end =3D args->mem_size;
-
     if ( nr_pages > target_pages )
         memflags |=3D XENMEMF_populate_on_demand;
 
@@ -345,24 +324,6 @@ static int setup_guest(xc_interface *xch,
         goto error_out;
     }
 
-    if ( modules_init(args, v_end, &elf, &m_start, &m_end) !=3D 0 )
-    {
-        ERROR("Insufficient space to load modules.");
-        goto error_out;
-    }
-
-    DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
-    DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
-    DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
-    DPRINTF("  TOTAL:    %016"PRIx64"->%016"PRIx64"\n", v_start, v_end);
-    DPRINTF("  ENTRY:    %016"PRIx64"\n", elf_uval(&elf, elf.ehdr, e_entry));
-
-    if ( (page_array =3D malloc(p2m_size * sizeof(xen_pfn_t))) =3D=3D NULL )
-    {
-        PERROR("Could not allocate memory.");
-        goto error_out;
-    }
-
     for ( i =3D 0; i < p2m_size; i++ )
         page_array[i] =3D ((xen_pfn_t)-1);
     for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
@@ -564,7 +525,54 @@ static int setup_guest(xc_interface *xch,
     DPRINTF("  4KB PAGES: 0x%016lx\n", stat_normal_pages);
     DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
     DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
-    
+
+    rc =3D 0;
+    goto out;
+ error_out:
+    rc =3D -1;
+ out:
+
+    /* ensure no unclaimed pages are left unused */
+    xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
+
+    return rc;
+}
+
+static int xc_hvm_load_image(xc_interface *xch,
+                       uint32_t dom, struct xc_hvm_build_args *args,
+                       xen_pfn_t *page_array)
+{
+    unsigned long entry_eip, image_size;
+    struct elf_binary elf;
+    uint64_t v_start, v_end;
+    uint64_t m_start =3D 0, m_end =3D 0;
+    char *image;
+    int rc;
+
+    image =3D xc_read_image(xch, args->image_file_name, &image_size);
+    if ( image =3D=3D NULL )
+        return -1;
+
+    memset(&elf, 0, sizeof(elf));
+    if ( elf_init(&elf, image, image_size) !=3D 0 )
+        goto error_out;
+
+    xc_elf_set_logfile(xch, &elf, 1);
+
+    elf_parse_binary(&elf);
+    v_start =3D 0;
+    v_end =3D args->mem_size;
+
+    if ( modules_init(args, v_end, &elf, &m_start, &m_end) !=3D 0 )
+    {
+        ERROR("Insufficient space to load modules.");
+        goto error_out;
+    }
+
+    DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
+    DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
+    DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
+
     if ( loadelfimage(xch, &elf, dom, page_array) !=3D 0 )
     {
         PERROR("Could not load ELF image");
@@ -577,6 +585,44 @@ static int setup_guest(xc_interface *xch,
         goto error_out;
     }
 
+    /* Insert JMP <rel32> instruction at address 0x0 to reach entry point. */
+    entry_eip =3D elf_uval(&elf, elf.ehdr, e_entry);
+    if ( entry_eip !=3D 0 )
+    {
+        char *page0 =3D xc_map_foreign_range(
+            xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, 0);
+        if ( page0 =3D=3D NULL )
+            goto error_out;
+        page0[0] =3D 0xe9;
+        *(uint32_t *)&page0[1] =3D entry_eip - 5;
+        munmap(page0, PAGE_SIZE);
+    }
+
+    rc =3D 0;
+    goto out;
+ error_out:
+    rc =3D -1;
+ out:
+    if ( elf_check_broken(&elf) )
+        ERROR("HVM ELF broken: %s", elf_check_broken(&elf));
+    free(image);
+
+    return rc;
+}
+
+static int xc_hvm_populate_params(xc_interface *xch, uint32_t dom,
+                                  struct xc_hvm_build_args *args)
+{
+    unsigned long i;
+    void *hvm_info_page;
+    uint32_t *ident_pt;
+    uint64_t v_end;
+    int rc;
+    xen_pfn_t special_array[NR_SPECIAL_PAGES];
+    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
+
+    v_end =3D args->mem_size;
+
     if ( (hvm_info_page =3D xc_map_foreign_range(
               xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
               HVM_INFO_PFN)) =3D=3D NULL )
@@ -665,34 +711,12 @@ static int setup_guest(xc_interface *xch,
     xc_hvm_param_set(xch, dom, HVM_PARAM_IDENT_PT,
                      special_pfn(SPECIALPAGE_IDENT_PT) << PAGE_SHIFT);
 
-    /* Insert JMP <rel32> instruction at address 0x0 to reach entry point. */
-    entry_eip =3D elf_uval(&elf, elf.ehdr, e_entry);
-    if ( entry_eip !=3D 0 )
-    {
-        char *page0 =3D xc_map_foreign_range(
-            xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, 0);
-        if ( page0 =3D=3D NULL )
-        {
-            PERROR("Could not map page0");
-            goto error_out;
-        }
-        page0[0] =3D 0xe9;
-        *(uint32_t *)&page0[1] =3D entry_eip - 5;
-        munmap(page0, PAGE_SIZE);
-    }
-
     rc =3D 0;
     goto out;
  error_out:
     rc =3D -1;
  out:
-    if ( elf_check_broken(&elf) )
-        ERROR("HVM ELF broken: %s", elf_check_broken(&elf));
-
-    /* ensure no unclaimed pages are left unused */
-    xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
 
-    free(page_array);
     return rc;
 }
 
@@ -703,9 +727,8 @@ int xc_hvm_build(xc_interface *xch, uint32_t domid,
                  struct xc_hvm_build_args *hvm_args)
 {
     struct xc_hvm_build_args args =3D *hvm_args;
-    void *image;
-    unsigned long image_size;
-    int sts;
+    xen_pfn_t *parray =3D NULL;
+    int rc;
 
     if ( domid =3D=3D 0 )
         return -1;
@@ -716,24 +739,37 @@ int xc_hvm_build(xc_interface *xch, uint32_t domid,
     if ( args.mem_size < (2ull << 20) || args.mem_target < (2ull << 20) )
         return -1;
 
-    image =3D xc_read_image(xch, args.image_file_name, &image_size);
-    if ( image =3D=3D NULL )
+    parray =3D malloc((args.mem_size >> PAGE_SHIFT) * sizeof(xen_pfn_t));
+    if ( parray =3D=3D NULL )
         return -1;
 
-    sts =3D setup_guest(xch, domid, &args, image, image_size);
-
-    if (!sts)
+    rc =3D xc_hvm_populate_memory(xch, domid, &args, parray);
+    if ( rc !=3D 0 )
     {
-        /* Return module load addresses to caller */
-        hvm_args->acpi_module.guest_addr_out =3D 
-            args.acpi_module.guest_addr_out;
-        hvm_args->smbios_module.guest_addr_out =3D 
-            args.smbios_module.guest_addr_out;
+        PERROR("xc_hvm_populate_memory failed");
+        goto out;
+    }
+    rc =3D xc_hvm_load_image(xch, domid, &args, parray);
+    if ( rc !=3D 0 )
+    {
+        PERROR("xc_hvm_load_image failed");
+        goto out;
+    }
+    rc =3D xc_hvm_populate_params(xch, domid, &args);
+    if ( rc !=3D 0 )
+    {
+        PERROR("xc_hvm_populate_params failed");
+        goto out;
     }
 
-    free(image);
+    /* Return module load addresses to caller */
+    hvm_args->acpi_module.guest_addr_out =3D args.acpi_module.guest_addr_out;
+    hvm_args->smbios_module.guest_addr_out =3D args.smbios_module.guest_addr_out;
 
-    return sts;
+out:
+    free(parray);
+
+    return rc;
 }
 
 /* xc_hvm_build_target_mem: 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:36:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:36: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 1Zo1Fm-0001AJ-Lj; Mon, 19 Oct 2015 03:36: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 1Zo1Fl-0001A5-HM
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:53 +0000
Content-Length: 10347
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	D6/4C-16618-45564265; Mon, 19 Oct 2015 03:36:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1445225810!56720582!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9538 invoked from network); 19 Oct 2015 03:36:51 -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;
	19 Oct 2015 03:36:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Fi-0005eH-Ag
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Fi-0004K9-7p
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:36:50 +0000
Date: Mon, 19 Oct 2015 03:36:50 +0000
Message-Id: <E1Zo1Fi-0004K9-7p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: split x86 HVM setup_guest into
	smaller logical 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: multipart/mixed; boundary="===============4796410083558920407=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4796410083558920407==
Content-Length: 10198
Content-Transfer-Encoding: quoted-printable

commit c64ef24febcf5bc6c6da733abd256412da8c4895
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:33 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:12:04 2015 +0100

    libxc: split x86 HVM setup_guest into smaller logical functions
    
    This is just a preparatory change to clean up the code in setup_guest.
    Should not introduce any functional changes.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/xc_hvm_build_x86.c |  198 +++++++++++++++++++++++----------------
 1 files changed, 117 insertions(+), 81 deletions(-)

diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index ea250dd..4d3736b 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -231,28 +231,20 @@ static int check_mmio_hole(uint64_t start, uint64_t memsize,
         return 1;
 }
 
-static int setup_guest(xc_interface *xch,
-                       uint32_t dom, struct xc_hvm_build_args *args,
-                       char *image, unsigned long image_size)
+static int xc_hvm_populate_memory(xc_interface *xch, uint32_t dom,
+                                  struct xc_hvm_build_args *args,
+                                  xen_pfn_t *page_array)
 {
-    xen_pfn_t *page_array =3D NULL;
     unsigned long i, vmemid, nr_pages =3D args->mem_size >> PAGE_SHIFT;
     unsigned long p2m_size;
     unsigned long target_pages =3D args->mem_target >> PAGE_SHIFT;
-    unsigned long entry_eip, cur_pages, cur_pfn;
-    void *hvm_info_page;
-    uint32_t *ident_pt;
-    struct elf_binary elf;
-    uint64_t v_start, v_end;
-    uint64_t m_start =3D 0, m_end =3D 0;
+    unsigned long cur_pages, cur_pfn;
     int rc;
     xen_capabilities_info_t caps;
     unsigned long stat_normal_pages =3D 0, stat_2mb_pages =3D 0, 
         stat_1gb_pages =3D 0;
     unsigned int memflags =3D 0;
     int claim_enabled =3D args->claim_enabled;
-    xen_pfn_t special_array[NR_SPECIAL_PAGES];
-    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
     uint64_t total_pages;
     xen_vmemrange_t dummy_vmemrange[2];
     unsigned int dummy_vnode_to_pnode[1];
@@ -260,19 +252,6 @@ static int setup_guest(xc_interface *xch,
     unsigned int *vnode_to_pnode;
     unsigned int nr_vmemranges, nr_vnodes;
 
-    memset(&elf, 0, sizeof(elf));
-    if ( elf_init(&elf, image, image_size) !=3D 0 )
-    {
-        PERROR("Could not initialise ELF image");
-        goto error_out;
-    }
-
-    xc_elf_set_logfile(xch, &elf, 1);
-
-    elf_parse_binary(&elf);
-    v_start =3D 0;
-    v_end =3D args->mem_size;
-
     if ( nr_pages > target_pages )
         memflags |=3D XENMEMF_populate_on_demand;
 
@@ -345,24 +324,6 @@ static int setup_guest(xc_interface *xch,
         goto error_out;
     }
 
-    if ( modules_init(args, v_end, &elf, &m_start, &m_end) !=3D 0 )
-    {
-        ERROR("Insufficient space to load modules.");
-        goto error_out;
-    }
-
-    DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
-    DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
-    DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
-    DPRINTF("  TOTAL:    %016"PRIx64"->%016"PRIx64"\n", v_start, v_end);
-    DPRINTF("  ENTRY:    %016"PRIx64"\n", elf_uval(&elf, elf.ehdr, e_entry));
-
-    if ( (page_array =3D malloc(p2m_size * sizeof(xen_pfn_t))) =3D=3D NULL )
-    {
-        PERROR("Could not allocate memory.");
-        goto error_out;
-    }
-
     for ( i =3D 0; i < p2m_size; i++ )
         page_array[i] =3D ((xen_pfn_t)-1);
     for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
@@ -564,7 +525,54 @@ static int setup_guest(xc_interface *xch,
     DPRINTF("  4KB PAGES: 0x%016lx\n", stat_normal_pages);
     DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
     DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
-    
+
+    rc =3D 0;
+    goto out;
+ error_out:
+    rc =3D -1;
+ out:
+
+    /* ensure no unclaimed pages are left unused */
+    xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
+
+    return rc;
+}
+
+static int xc_hvm_load_image(xc_interface *xch,
+                       uint32_t dom, struct xc_hvm_build_args *args,
+                       xen_pfn_t *page_array)
+{
+    unsigned long entry_eip, image_size;
+    struct elf_binary elf;
+    uint64_t v_start, v_end;
+    uint64_t m_start =3D 0, m_end =3D 0;
+    char *image;
+    int rc;
+
+    image =3D xc_read_image(xch, args->image_file_name, &image_size);
+    if ( image =3D=3D NULL )
+        return -1;
+
+    memset(&elf, 0, sizeof(elf));
+    if ( elf_init(&elf, image, image_size) !=3D 0 )
+        goto error_out;
+
+    xc_elf_set_logfile(xch, &elf, 1);
+
+    elf_parse_binary(&elf);
+    v_start =3D 0;
+    v_end =3D args->mem_size;
+
+    if ( modules_init(args, v_end, &elf, &m_start, &m_end) !=3D 0 )
+    {
+        ERROR("Insufficient space to load modules.");
+        goto error_out;
+    }
+
+    DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
+    DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
+    DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
+
     if ( loadelfimage(xch, &elf, dom, page_array) !=3D 0 )
     {
         PERROR("Could not load ELF image");
@@ -577,6 +585,44 @@ static int setup_guest(xc_interface *xch,
         goto error_out;
     }
 
+    /* Insert JMP <rel32> instruction at address 0x0 to reach entry point. */
+    entry_eip =3D elf_uval(&elf, elf.ehdr, e_entry);
+    if ( entry_eip !=3D 0 )
+    {
+        char *page0 =3D xc_map_foreign_range(
+            xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, 0);
+        if ( page0 =3D=3D NULL )
+            goto error_out;
+        page0[0] =3D 0xe9;
+        *(uint32_t *)&page0[1] =3D entry_eip - 5;
+        munmap(page0, PAGE_SIZE);
+    }
+
+    rc =3D 0;
+    goto out;
+ error_out:
+    rc =3D -1;
+ out:
+    if ( elf_check_broken(&elf) )
+        ERROR("HVM ELF broken: %s", elf_check_broken(&elf));
+    free(image);
+
+    return rc;
+}
+
+static int xc_hvm_populate_params(xc_interface *xch, uint32_t dom,
+                                  struct xc_hvm_build_args *args)
+{
+    unsigned long i;
+    void *hvm_info_page;
+    uint32_t *ident_pt;
+    uint64_t v_end;
+    int rc;
+    xen_pfn_t special_array[NR_SPECIAL_PAGES];
+    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
+
+    v_end =3D args->mem_size;
+
     if ( (hvm_info_page =3D xc_map_foreign_range(
               xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
               HVM_INFO_PFN)) =3D=3D NULL )
@@ -665,34 +711,12 @@ static int setup_guest(xc_interface *xch,
     xc_hvm_param_set(xch, dom, HVM_PARAM_IDENT_PT,
                      special_pfn(SPECIALPAGE_IDENT_PT) << PAGE_SHIFT);
 
-    /* Insert JMP <rel32> instruction at address 0x0 to reach entry point. */
-    entry_eip =3D elf_uval(&elf, elf.ehdr, e_entry);
-    if ( entry_eip !=3D 0 )
-    {
-        char *page0 =3D xc_map_foreign_range(
-            xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, 0);
-        if ( page0 =3D=3D NULL )
-        {
-            PERROR("Could not map page0");
-            goto error_out;
-        }
-        page0[0] =3D 0xe9;
-        *(uint32_t *)&page0[1] =3D entry_eip - 5;
-        munmap(page0, PAGE_SIZE);
-    }
-
     rc =3D 0;
     goto out;
  error_out:
     rc =3D -1;
  out:
-    if ( elf_check_broken(&elf) )
-        ERROR("HVM ELF broken: %s", elf_check_broken(&elf));
-
-    /* ensure no unclaimed pages are left unused */
-    xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
 
-    free(page_array);
     return rc;
 }
 
@@ -703,9 +727,8 @@ int xc_hvm_build(xc_interface *xch, uint32_t domid,
                  struct xc_hvm_build_args *hvm_args)
 {
     struct xc_hvm_build_args args =3D *hvm_args;
-    void *image;
-    unsigned long image_size;
-    int sts;
+    xen_pfn_t *parray =3D NULL;
+    int rc;
 
     if ( domid =3D=3D 0 )
         return -1;
@@ -716,24 +739,37 @@ int xc_hvm_build(xc_interface *xch, uint32_t domid,
     if ( args.mem_size < (2ull << 20) || args.mem_target < (2ull << 20) )
         return -1;
 
-    image =3D xc_read_image(xch, args.image_file_name, &image_size);
-    if ( image =3D=3D NULL )
+    parray =3D malloc((args.mem_size >> PAGE_SHIFT) * sizeof(xen_pfn_t));
+    if ( parray =3D=3D NULL )
         return -1;
 
-    sts =3D setup_guest(xch, domid, &args, image, image_size);
-
-    if (!sts)
+    rc =3D xc_hvm_populate_memory(xch, domid, &args, parray);
+    if ( rc !=3D 0 )
     {
-        /* Return module load addresses to caller */
-        hvm_args->acpi_module.guest_addr_out =3D 
-            args.acpi_module.guest_addr_out;
-        hvm_args->smbios_module.guest_addr_out =3D 
-            args.smbios_module.guest_addr_out;
+        PERROR("xc_hvm_populate_memory failed");
+        goto out;
+    }
+    rc =3D xc_hvm_load_image(xch, domid, &args, parray);
+    if ( rc !=3D 0 )
+    {
+        PERROR("xc_hvm_load_image failed");
+        goto out;
+    }
+    rc =3D xc_hvm_populate_params(xch, domid, &args);
+    if ( rc !=3D 0 )
+    {
+        PERROR("xc_hvm_populate_params failed");
+        goto out;
     }
 
-    free(image);
+    /* Return module load addresses to caller */
+    hvm_args->acpi_module.guest_addr_out =3D args.acpi_module.guest_addr_out;
+    hvm_args->smbios_module.guest_addr_out =3D args.smbios_module.guest_addr_out;
 
-    return sts;
+out:
+    free(parray);
+
+    return rc;
 }
 
 /* xc_hvm_build_target_mem: 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1Fw-0001Bo-OY; Mon, 19 Oct 2015 03:37: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 1Zo1Fv-0001Bc-KB
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:03 +0000
Content-Length: 13092
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	83/68-01748-E5564265; Mon, 19 Oct 2015 03:37:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1445225820!53063883!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23628 invoked from network); 19 Oct 2015 03:37:01 -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;
	19 Oct 2015 03:37:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Fs-0005eS-LO
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Fs-0004Ky-J1
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:00 +0000
Date: Mon, 19 Oct 2015 03:37:00 +0000
Message-Id: <E1Zo1Fs-0004Ky-J1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: unify xc_dom_p2m_{host/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: multipart/mixed; boundary="===============3270865742435943489=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3270865742435943489==
Content-Length: 12919
Content-Transfer-Encoding: quoted-printable

commit 2637d04d3b863f6537c109ff966b6734fa320d84
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:34 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:12:04 2015 +0100

    libxc: unify xc_dom_p2m_{host/guest}
    
    Unify both functions into xc_dom_p2m. Should not introduce any functional
    change.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/grub/kexec.c              |    4 ++--
 tools/libxc/include/xc_dom.h      |   14 ++------------
 tools/libxc/xc_dom_boot.c         |   10 +++++-----
 tools/libxc/xc_dom_compat_linux.c |    4 ++--
 tools/libxc/xc_dom_x86.c          |   32 ++++++++++++++++----------------
 tools/libxl/libxl_dom.c           |    4 ++--
 6 files changed, 29 insertions(+), 39 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 4c33b25..0b2f4f3 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -358,9 +358,9 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
 #ifdef __x86_64__
                 MMUEXT_PIN_L4_TABLE,
 #endif
-                xc_dom_p2m_host(dom, dom->pgtables_seg.pfn),
+                xc_dom_p2m(dom, dom->pgtables_seg.pfn),
                 dom->guest_domid)) !=3D 0 ) {
-        grub_printf("pin_table(%lx) returned %d\n", xc_dom_p2m_host(dom,
+        grub_printf("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
                     dom->pgtables_seg.pfn), rc);
         errnum =3D ERR_BOOT_FAILURE;
         goto out_remap;
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 602c5cd..e794a13 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -373,19 +373,9 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
     return ptr + offset;
 }
 
-static inline xen_pfn_t xc_dom_p2m_host(struct xc_dom_image *dom, xen_pfn_t pfn)
+static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
 {
-    if (dom->shadow_enabled)
-        return pfn;
-    if (pfn < dom->rambase_pfn || pfn >=3D dom->rambase_pfn + dom->total_pages)
-        return INVALID_MFN;
-    return dom->p2m_host[pfn - dom->rambase_pfn];
-}
-
-static inline xen_pfn_t xc_dom_p2m_guest(struct xc_dom_image *dom,
-                                         xen_pfn_t pfn)
-{
-    if (xc_dom_feature_translated(dom))
+    if ( dom->shadow_enabled || xc_dom_feature_translated(dom) )
         return pfn;
     if (pfn < dom->rambase_pfn || pfn >=3D dom->rambase_pfn + dom->total_pages)
         return INVALID_MFN;
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index 8e06406..7c30f96 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -53,7 +53,7 @@ static int setup_hypercall_page(struct xc_dom_image *dom)
                   dom->parms.virt_hypercall, pfn);
     domctl.cmd =3D XEN_DOMCTL_hypercall_init;
     domctl.domain =3D dom->guest_domid;
-    domctl.u.hypercall_init.gmfn =3D xc_dom_p2m_guest(dom, pfn);
+    domctl.u.hypercall_init.gmfn =3D xc_dom_p2m(dom, pfn);
     rc =3D do_domctl(dom->xch, &domctl);
     if ( rc !=3D 0 )
         xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
@@ -83,7 +83,7 @@ static int clear_page(struct xc_dom_image *dom, xen_pfn_t pfn)
     if ( pfn =3D=3D 0 )
         return 0;
 
-    dst =3D xc_dom_p2m_host(dom, pfn);
+    dst =3D xc_dom_p2m(dom, pfn);
     DOMPRINTF("%s: pfn 0x%" PRIpfn ", mfn 0x%" PRIpfn "",
               __FUNCTION__, pfn, dst);
     rc =3D xc_clear_domain_page(dom->xch, dom->guest_domid, dst);
@@ -177,7 +177,7 @@ void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
     }
 
     for ( i =3D 0; i < count; i++ )
-        entries[i].mfn =3D xc_dom_p2m_host(dom, pfn + i);
+        entries[i].mfn =3D xc_dom_p2m(dom, pfn + i);
 
     ptr =3D xc_map_foreign_ranges(dom->xch, dom->guest_domid,
                 count << page_shift, PROT_READ | PROT_WRITE, 1 << page_shift,
@@ -434,8 +434,8 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
                                       dom->console_domid, dom->xenstore_domid);
     } else {
         return xc_dom_gnttab_seed(dom->xch, dom->guest_domid,
-                                  xc_dom_p2m_host(dom, dom->console_pfn),
-                                  xc_dom_p2m_host(dom, dom->xenstore_pfn),
+                                  xc_dom_p2m(dom, dom->console_pfn),
+                                  xc_dom_p2m(dom, dom->xenstore_pfn),
                                   dom->console_domid, dom->xenstore_domid);
     }
 }
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index a3abb99..5c1f043 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -64,8 +64,8 @@ static int xc_linux_build_internal(struct xc_dom_image *dom,
     if ( (rc =3D xc_dom_gnttab_init(dom)) !=3D 0)
         goto out;
 
-    *console_mfn =3D xc_dom_p2m_host(dom, dom->console_pfn);
-    *store_mfn =3D xc_dom_p2m_host(dom, dom->xenstore_pfn);
+    *console_mfn =3D xc_dom_p2m(dom, dom->console_pfn);
+    *store_mfn =3D xc_dom_p2m(dom, dom->xenstore_pfn);
 
  out:
     return rc;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index e2f3792..f3962cd 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -247,7 +247,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
     unsigned long l3off, l2off =3D 0, l1off;
     xen_vaddr_t addr;
     xen_pfn_t pgpfn;
-    xen_pfn_t l3mfn =3D xc_dom_p2m_guest(dom, l3pfn);
+    xen_pfn_t l3mfn =3D xc_dom_p2m(dom, l3pfn);
 
     if ( dom->parms.pae =3D=3D XEN_PAE_YES )
     {
@@ -279,7 +279,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
                 goto pfn_error;
             l3off =3D l3_table_offset_pae(addr);
             l3tab[l3off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l2pfn)) | L3_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
             l2pfn++;
         }
 
@@ -291,7 +291,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
                 goto pfn_error;
             l2off =3D l2_table_offset_pae(addr);
             l2tab[l2off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l1pfn)) | L2_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l1pfn)) | L2_PROT;
             l1pfn++;
         }
 
@@ -299,7 +299,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
         l1off =3D l1_table_offset_pae(addr);
         pgpfn =3D (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
         l1tab[l1off] =3D
-            pfn_to_paddr(xc_dom_p2m_guest(dom, pgpfn)) | L1_PROT;
+            pfn_to_paddr(xc_dom_p2m(dom, pgpfn)) | L1_PROT;
         if ( (!dom->pvh_enabled)                &&
              (addr >=3D dom->pgtables_seg.vstart) &&
              (addr < dom->pgtables_seg.vend) )
@@ -316,7 +316,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
     if ( dom->virt_pgtab_end <=3D 0xc0000000 )
     {
         DOMPRINTF("%s: PAE: extra l2 page table for l3#3", __FUNCTION__);
-        l3tab[3] =3D pfn_to_paddr(xc_dom_p2m_guest(dom, l2pfn)) | L3_PROT;
+        l3tab[3] =3D pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
     }
     return 0;
 
@@ -375,7 +375,7 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
                 goto pfn_error;
             l4off =3D l4_table_offset_x86_64(addr);
             l4tab[l4off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l3pfn)) | L4_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l3pfn)) | L4_PROT;
             l3pfn++;
         }
 
@@ -387,7 +387,7 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
                 goto pfn_error;
             l3off =3D l3_table_offset_x86_64(addr);
             l3tab[l3off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l2pfn)) | L3_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
             l2pfn++;
         }
 
@@ -399,7 +399,7 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
                 goto pfn_error;
             l2off =3D l2_table_offset_x86_64(addr);
             l2tab[l2off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l1pfn)) | L2_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l1pfn)) | L2_PROT;
             l1pfn++;
         }
 
@@ -407,7 +407,7 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
         l1off =3D l1_table_offset_x86_64(addr);
         pgpfn =3D (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
         l1tab[l1off] =3D
-            pfn_to_paddr(xc_dom_p2m_guest(dom, pgpfn)) | L1_PROT;
+            pfn_to_paddr(xc_dom_p2m(dom, pgpfn)) | L1_PROT;
         if ( (!dom->pvh_enabled)                &&
              (addr >=3D dom->pgtables_seg.vstart) &&
              (addr < dom->pgtables_seg.vend) )
@@ -490,9 +490,9 @@ static int start_info_x86_32(struct xc_dom_image *dom)
     start_info->mfn_list =3D dom->p2m_seg.vstart;
 
     start_info->flags =3D dom->flags;
-    start_info->store_mfn =3D xc_dom_p2m_guest(dom, dom->xenstore_pfn);
+    start_info->store_mfn =3D xc_dom_p2m(dom, dom->xenstore_pfn);
     start_info->store_evtchn =3D dom->xenstore_evtchn;
-    start_info->console.domU.mfn =3D xc_dom_p2m_guest(dom, dom->console_pfn);
+    start_info->console.domU.mfn =3D xc_dom_p2m(dom, dom->console_pfn);
     start_info->console.domU.evtchn =3D dom->console_evtchn;
 
     if ( dom->ramdisk_blob )
@@ -536,9 +536,9 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->mfn_list =3D dom->p2m_seg.vstart;
 
     start_info->flags =3D dom->flags;
-    start_info->store_mfn =3D xc_dom_p2m_guest(dom, dom->xenstore_pfn);
+    start_info->store_mfn =3D xc_dom_p2m(dom, dom->xenstore_pfn);
     start_info->store_evtchn =3D dom->xenstore_evtchn;
-    start_info->console.domU.mfn =3D xc_dom_p2m_guest(dom, dom->console_pfn);
+    start_info->console.domU.mfn =3D xc_dom_p2m(dom, dom->console_pfn);
     start_info->console.domU.evtchn =3D dom->console_evtchn;
 
     if ( dom->ramdisk_blob )
@@ -606,7 +606,7 @@ static int vcpu_x86_32(struct xc_dom_image *dom, void *ptr)
          dom->parms.pae =3D=3D XEN_PAE_BIMODAL )
         ctxt->vm_assist |=3D (1UL << VMASST_TYPE_pae_extended_cr3);
 
-    cr3_pfn =3D xc_dom_p2m_guest(dom, dom->pgtables_seg.pfn);
+    cr3_pfn =3D xc_dom_p2m(dom, dom->pgtables_seg.pfn);
     ctxt->ctrlreg[3] =3D xen_pfn_to_cr3_x86_32(cr3_pfn);
     DOMPRINTF("%s: cr3: pfn 0x%" PRIpfn " mfn 0x%" PRIpfn "",
               __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn);
@@ -645,7 +645,7 @@ static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
     ctxt->user_regs.rflags =3D 1 << 9; /* Interrupt Enable */
 
     ctxt->flags =3D VGCF_in_kernel_X86_64 | VGCF_online_X86_64;
-    cr3_pfn =3D xc_dom_p2m_guest(dom, dom->pgtables_seg.pfn);
+    cr3_pfn =3D xc_dom_p2m(dom, dom->pgtables_seg.pfn);
     ctxt->ctrlreg[3] =3D xen_pfn_to_cr3_x86_64(cr3_pfn);
     DOMPRINTF("%s: cr3: pfn 0x%" PRIpfn " mfn 0x%" PRIpfn "",
               __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn);
@@ -1018,7 +1018,7 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
         /* paravirtualized guest */
         xc_dom_unmap_one(dom, dom->pgtables_seg.pfn);
         rc =3D pin_table(dom->xch, pgd_type,
-                       xc_dom_p2m_host(dom, dom->pgtables_seg.pfn),
+                       xc_dom_p2m(dom, dom->pgtables_seg.pfn),
                        dom->guest_domid);
         if ( rc !=3D 0 )
         {
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b26ce57..4c7698c 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -737,8 +737,8 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
         state->console_mfn =3D dom->console_pfn;
         state->store_mfn =3D dom->xenstore_pfn;
     } else {
-        state->console_mfn =3D xc_dom_p2m_host(dom, dom->console_pfn);
-        state->store_mfn =3D xc_dom_p2m_host(dom, dom->xenstore_pfn);
+        state->console_mfn =3D xc_dom_p2m(dom, dom->console_pfn);
+        state->store_mfn =3D xc_dom_p2m(dom, dom->xenstore_pfn);
     }
 
     libxl__file_reference_unmap(&state->pv_kernel);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1Fw-0001Bo-OY; Mon, 19 Oct 2015 03:37: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 1Zo1Fv-0001Bc-KB
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:03 +0000
Content-Length: 13092
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	83/68-01748-E5564265; Mon, 19 Oct 2015 03:37:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1445225820!53063883!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23628 invoked from network); 19 Oct 2015 03:37:01 -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;
	19 Oct 2015 03:37:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Fs-0005eS-LO
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Fs-0004Ky-J1
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:00 +0000
Date: Mon, 19 Oct 2015 03:37:00 +0000
Message-Id: <E1Zo1Fs-0004Ky-J1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: unify xc_dom_p2m_{host/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: multipart/mixed; boundary="===============3270865742435943489=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3270865742435943489==
Content-Length: 12919
Content-Transfer-Encoding: quoted-printable

commit 2637d04d3b863f6537c109ff966b6734fa320d84
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:34 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:12:04 2015 +0100

    libxc: unify xc_dom_p2m_{host/guest}
    
    Unify both functions into xc_dom_p2m. Should not introduce any functional
    change.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/grub/kexec.c              |    4 ++--
 tools/libxc/include/xc_dom.h      |   14 ++------------
 tools/libxc/xc_dom_boot.c         |   10 +++++-----
 tools/libxc/xc_dom_compat_linux.c |    4 ++--
 tools/libxc/xc_dom_x86.c          |   32 ++++++++++++++++----------------
 tools/libxl/libxl_dom.c           |    4 ++--
 6 files changed, 29 insertions(+), 39 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 4c33b25..0b2f4f3 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -358,9 +358,9 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
 #ifdef __x86_64__
                 MMUEXT_PIN_L4_TABLE,
 #endif
-                xc_dom_p2m_host(dom, dom->pgtables_seg.pfn),
+                xc_dom_p2m(dom, dom->pgtables_seg.pfn),
                 dom->guest_domid)) !=3D 0 ) {
-        grub_printf("pin_table(%lx) returned %d\n", xc_dom_p2m_host(dom,
+        grub_printf("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
                     dom->pgtables_seg.pfn), rc);
         errnum =3D ERR_BOOT_FAILURE;
         goto out_remap;
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 602c5cd..e794a13 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -373,19 +373,9 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
     return ptr + offset;
 }
 
-static inline xen_pfn_t xc_dom_p2m_host(struct xc_dom_image *dom, xen_pfn_t pfn)
+static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
 {
-    if (dom->shadow_enabled)
-        return pfn;
-    if (pfn < dom->rambase_pfn || pfn >=3D dom->rambase_pfn + dom->total_pages)
-        return INVALID_MFN;
-    return dom->p2m_host[pfn - dom->rambase_pfn];
-}
-
-static inline xen_pfn_t xc_dom_p2m_guest(struct xc_dom_image *dom,
-                                         xen_pfn_t pfn)
-{
-    if (xc_dom_feature_translated(dom))
+    if ( dom->shadow_enabled || xc_dom_feature_translated(dom) )
         return pfn;
     if (pfn < dom->rambase_pfn || pfn >=3D dom->rambase_pfn + dom->total_pages)
         return INVALID_MFN;
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index 8e06406..7c30f96 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -53,7 +53,7 @@ static int setup_hypercall_page(struct xc_dom_image *dom)
                   dom->parms.virt_hypercall, pfn);
     domctl.cmd =3D XEN_DOMCTL_hypercall_init;
     domctl.domain =3D dom->guest_domid;
-    domctl.u.hypercall_init.gmfn =3D xc_dom_p2m_guest(dom, pfn);
+    domctl.u.hypercall_init.gmfn =3D xc_dom_p2m(dom, pfn);
     rc =3D do_domctl(dom->xch, &domctl);
     if ( rc !=3D 0 )
         xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
@@ -83,7 +83,7 @@ static int clear_page(struct xc_dom_image *dom, xen_pfn_t pfn)
     if ( pfn =3D=3D 0 )
         return 0;
 
-    dst =3D xc_dom_p2m_host(dom, pfn);
+    dst =3D xc_dom_p2m(dom, pfn);
     DOMPRINTF("%s: pfn 0x%" PRIpfn ", mfn 0x%" PRIpfn "",
               __FUNCTION__, pfn, dst);
     rc =3D xc_clear_domain_page(dom->xch, dom->guest_domid, dst);
@@ -177,7 +177,7 @@ void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
     }
 
     for ( i =3D 0; i < count; i++ )
-        entries[i].mfn =3D xc_dom_p2m_host(dom, pfn + i);
+        entries[i].mfn =3D xc_dom_p2m(dom, pfn + i);
 
     ptr =3D xc_map_foreign_ranges(dom->xch, dom->guest_domid,
                 count << page_shift, PROT_READ | PROT_WRITE, 1 << page_shift,
@@ -434,8 +434,8 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
                                       dom->console_domid, dom->xenstore_domid);
     } else {
         return xc_dom_gnttab_seed(dom->xch, dom->guest_domid,
-                                  xc_dom_p2m_host(dom, dom->console_pfn),
-                                  xc_dom_p2m_host(dom, dom->xenstore_pfn),
+                                  xc_dom_p2m(dom, dom->console_pfn),
+                                  xc_dom_p2m(dom, dom->xenstore_pfn),
                                   dom->console_domid, dom->xenstore_domid);
     }
 }
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index a3abb99..5c1f043 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -64,8 +64,8 @@ static int xc_linux_build_internal(struct xc_dom_image *dom,
     if ( (rc =3D xc_dom_gnttab_init(dom)) !=3D 0)
         goto out;
 
-    *console_mfn =3D xc_dom_p2m_host(dom, dom->console_pfn);
-    *store_mfn =3D xc_dom_p2m_host(dom, dom->xenstore_pfn);
+    *console_mfn =3D xc_dom_p2m(dom, dom->console_pfn);
+    *store_mfn =3D xc_dom_p2m(dom, dom->xenstore_pfn);
 
  out:
     return rc;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index e2f3792..f3962cd 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -247,7 +247,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
     unsigned long l3off, l2off =3D 0, l1off;
     xen_vaddr_t addr;
     xen_pfn_t pgpfn;
-    xen_pfn_t l3mfn =3D xc_dom_p2m_guest(dom, l3pfn);
+    xen_pfn_t l3mfn =3D xc_dom_p2m(dom, l3pfn);
 
     if ( dom->parms.pae =3D=3D XEN_PAE_YES )
     {
@@ -279,7 +279,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
                 goto pfn_error;
             l3off =3D l3_table_offset_pae(addr);
             l3tab[l3off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l2pfn)) | L3_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
             l2pfn++;
         }
 
@@ -291,7 +291,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
                 goto pfn_error;
             l2off =3D l2_table_offset_pae(addr);
             l2tab[l2off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l1pfn)) | L2_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l1pfn)) | L2_PROT;
             l1pfn++;
         }
 
@@ -299,7 +299,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
         l1off =3D l1_table_offset_pae(addr);
         pgpfn =3D (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
         l1tab[l1off] =3D
-            pfn_to_paddr(xc_dom_p2m_guest(dom, pgpfn)) | L1_PROT;
+            pfn_to_paddr(xc_dom_p2m(dom, pgpfn)) | L1_PROT;
         if ( (!dom->pvh_enabled)                &&
              (addr >=3D dom->pgtables_seg.vstart) &&
              (addr < dom->pgtables_seg.vend) )
@@ -316,7 +316,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
     if ( dom->virt_pgtab_end <=3D 0xc0000000 )
     {
         DOMPRINTF("%s: PAE: extra l2 page table for l3#3", __FUNCTION__);
-        l3tab[3] =3D pfn_to_paddr(xc_dom_p2m_guest(dom, l2pfn)) | L3_PROT;
+        l3tab[3] =3D pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
     }
     return 0;
 
@@ -375,7 +375,7 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
                 goto pfn_error;
             l4off =3D l4_table_offset_x86_64(addr);
             l4tab[l4off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l3pfn)) | L4_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l3pfn)) | L4_PROT;
             l3pfn++;
         }
 
@@ -387,7 +387,7 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
                 goto pfn_error;
             l3off =3D l3_table_offset_x86_64(addr);
             l3tab[l3off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l2pfn)) | L3_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
             l2pfn++;
         }
 
@@ -399,7 +399,7 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
                 goto pfn_error;
             l2off =3D l2_table_offset_x86_64(addr);
             l2tab[l2off] =3D
-                pfn_to_paddr(xc_dom_p2m_guest(dom, l1pfn)) | L2_PROT;
+                pfn_to_paddr(xc_dom_p2m(dom, l1pfn)) | L2_PROT;
             l1pfn++;
         }
 
@@ -407,7 +407,7 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
         l1off =3D l1_table_offset_x86_64(addr);
         pgpfn =3D (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
         l1tab[l1off] =3D
-            pfn_to_paddr(xc_dom_p2m_guest(dom, pgpfn)) | L1_PROT;
+            pfn_to_paddr(xc_dom_p2m(dom, pgpfn)) | L1_PROT;
         if ( (!dom->pvh_enabled)                &&
              (addr >=3D dom->pgtables_seg.vstart) &&
              (addr < dom->pgtables_seg.vend) )
@@ -490,9 +490,9 @@ static int start_info_x86_32(struct xc_dom_image *dom)
     start_info->mfn_list =3D dom->p2m_seg.vstart;
 
     start_info->flags =3D dom->flags;
-    start_info->store_mfn =3D xc_dom_p2m_guest(dom, dom->xenstore_pfn);
+    start_info->store_mfn =3D xc_dom_p2m(dom, dom->xenstore_pfn);
     start_info->store_evtchn =3D dom->xenstore_evtchn;
-    start_info->console.domU.mfn =3D xc_dom_p2m_guest(dom, dom->console_pfn);
+    start_info->console.domU.mfn =3D xc_dom_p2m(dom, dom->console_pfn);
     start_info->console.domU.evtchn =3D dom->console_evtchn;
 
     if ( dom->ramdisk_blob )
@@ -536,9 +536,9 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->mfn_list =3D dom->p2m_seg.vstart;
 
     start_info->flags =3D dom->flags;
-    start_info->store_mfn =3D xc_dom_p2m_guest(dom, dom->xenstore_pfn);
+    start_info->store_mfn =3D xc_dom_p2m(dom, dom->xenstore_pfn);
     start_info->store_evtchn =3D dom->xenstore_evtchn;
-    start_info->console.domU.mfn =3D xc_dom_p2m_guest(dom, dom->console_pfn);
+    start_info->console.domU.mfn =3D xc_dom_p2m(dom, dom->console_pfn);
     start_info->console.domU.evtchn =3D dom->console_evtchn;
 
     if ( dom->ramdisk_blob )
@@ -606,7 +606,7 @@ static int vcpu_x86_32(struct xc_dom_image *dom, void *ptr)
          dom->parms.pae =3D=3D XEN_PAE_BIMODAL )
         ctxt->vm_assist |=3D (1UL << VMASST_TYPE_pae_extended_cr3);
 
-    cr3_pfn =3D xc_dom_p2m_guest(dom, dom->pgtables_seg.pfn);
+    cr3_pfn =3D xc_dom_p2m(dom, dom->pgtables_seg.pfn);
     ctxt->ctrlreg[3] =3D xen_pfn_to_cr3_x86_32(cr3_pfn);
     DOMPRINTF("%s: cr3: pfn 0x%" PRIpfn " mfn 0x%" PRIpfn "",
               __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn);
@@ -645,7 +645,7 @@ static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
     ctxt->user_regs.rflags =3D 1 << 9; /* Interrupt Enable */
 
     ctxt->flags =3D VGCF_in_kernel_X86_64 | VGCF_online_X86_64;
-    cr3_pfn =3D xc_dom_p2m_guest(dom, dom->pgtables_seg.pfn);
+    cr3_pfn =3D xc_dom_p2m(dom, dom->pgtables_seg.pfn);
     ctxt->ctrlreg[3] =3D xen_pfn_to_cr3_x86_64(cr3_pfn);
     DOMPRINTF("%s: cr3: pfn 0x%" PRIpfn " mfn 0x%" PRIpfn "",
               __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn);
@@ -1018,7 +1018,7 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
         /* paravirtualized guest */
         xc_dom_unmap_one(dom, dom->pgtables_seg.pfn);
         rc =3D pin_table(dom->xch, pgd_type,
-                       xc_dom_p2m_host(dom, dom->pgtables_seg.pfn),
+                       xc_dom_p2m(dom, dom->pgtables_seg.pfn),
                        dom->guest_domid);
         if ( rc !=3D 0 )
         {
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b26ce57..4c7698c 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -737,8 +737,8 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
         state->console_mfn =3D dom->console_pfn;
         state->store_mfn =3D dom->xenstore_pfn;
     } else {
-        state->console_mfn =3D xc_dom_p2m_host(dom, dom->console_pfn);
-        state->store_mfn =3D xc_dom_p2m_host(dom, dom->xenstore_pfn);
+        state->console_mfn =3D xc_dom_p2m(dom, dom->console_pfn);
+        state->store_mfn =3D xc_dom_p2m(dom, dom->xenstore_pfn);
     }
 
     libxl__file_reference_unmap(&state->pv_kernel);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1G6-0001Dp-TX; Mon, 19 Oct 2015 03:37: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 1Zo1G5-0001De-Hu
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:13 +0000
Content-Length: 3070
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	5E/19-01753-86564265; Mon, 19 Oct 2015 03:37:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1445225831!51887361!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26089 invoked from network); 19 Oct 2015 03:37:11 -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;
	19 Oct 2015 03:37:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1G2-0005f3-Vs
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1G2-0004Lw-UA
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:10 +0000
Date: Mon, 19 Oct 2015 03:37:10 +0000
Message-Id: <E1Zo1G2-0004Lw-UA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce the notion of a
	container type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4109759824340676166=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4109759824340676166==
Content-Length: 2689
Content-Transfer-Encoding: quoted-printable

commit 20dd1725e6bc80cff3c1c7c1b0d842e7dc6d3754
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:35 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:12:05 2015 +0100

    libxc: introduce the notion of a container type
    
    Introduce the notion of a container type into xc_dom_image. This will be
    needed by later changes that will also use xc_dom_image in order to build
    HVM guests.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/include/xc_dom.h |    6 ++++++
 tools/libxc/xc_dom_x86.c     |    4 ++++
 tools/libxl/libxl_dom.c      |    1 +
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index e794a13..30fa8c5 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -177,6 +177,12 @@ struct xc_dom_image {
     struct xc_dom_arch *arch_hooks;
     /* allocate up to virt_alloc_end */
     int (*allocate) (struct xc_dom_image * dom, xen_vaddr_t up_to);
+
+    /* Container type (HVM or PV). */
+    enum {
+        XC_DOM_PV_CONTAINER,
+        XC_DOM_HVM_CONTAINER,
+    } container_type;
 };
 
 /* --- pluggable kernel loader ------------------------------------- */
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index f3962cd..d306475 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -1069,6 +1069,10 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
 
 int xc_dom_feature_translated(struct xc_dom_image *dom)
 {
+    /* Guests running inside HVM containers are always auto-translated. */
+    if ( dom->container_type =3D=3D XC_DOM_HVM_CONTAINER )
+        return 1;
+
     return elf_xen_feature_get(XENFEAT_auto_translated_physmap, dom->f_active);
 }
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 4c7698c..2b92d48 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -618,6 +618,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     }
 
     dom->pvh_enabled =3D state->pvh_enabled;
+    dom->container_type =3D XC_DOM_PV_CONTAINER;
 
     LOG(DEBUG, "pv kernel mapped %d path %s", state->pv_kernel.mapped, state->pv_kernel.path);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1G6-0001Dp-TX; Mon, 19 Oct 2015 03:37: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 1Zo1G5-0001De-Hu
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:13 +0000
Content-Length: 3070
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	5E/19-01753-86564265; Mon, 19 Oct 2015 03:37:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1445225831!51887361!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26089 invoked from network); 19 Oct 2015 03:37:11 -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;
	19 Oct 2015 03:37:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1G2-0005f3-Vs
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1G2-0004Lw-UA
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:10 +0000
Date: Mon, 19 Oct 2015 03:37:10 +0000
Message-Id: <E1Zo1G2-0004Lw-UA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce the notion of a
	container type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4109759824340676166=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4109759824340676166==
Content-Length: 2689
Content-Transfer-Encoding: quoted-printable

commit 20dd1725e6bc80cff3c1c7c1b0d842e7dc6d3754
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:35 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:12:05 2015 +0100

    libxc: introduce the notion of a container type
    
    Introduce the notion of a container type into xc_dom_image. This will be
    needed by later changes that will also use xc_dom_image in order to build
    HVM guests.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/include/xc_dom.h |    6 ++++++
 tools/libxc/xc_dom_x86.c     |    4 ++++
 tools/libxl/libxl_dom.c      |    1 +
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index e794a13..30fa8c5 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -177,6 +177,12 @@ struct xc_dom_image {
     struct xc_dom_arch *arch_hooks;
     /* allocate up to virt_alloc_end */
     int (*allocate) (struct xc_dom_image * dom, xen_vaddr_t up_to);
+
+    /* Container type (HVM or PV). */
+    enum {
+        XC_DOM_PV_CONTAINER,
+        XC_DOM_HVM_CONTAINER,
+    } container_type;
 };
 
 /* --- pluggable kernel loader ------------------------------------- */
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index f3962cd..d306475 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -1069,6 +1069,10 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
 
 int xc_dom_feature_translated(struct xc_dom_image *dom)
 {
+    /* Guests running inside HVM containers are always auto-translated. */
+    if ( dom->container_type =3D=3D XC_DOM_HVM_CONTAINER )
+        return 1;
+
     return elf_xen_feature_get(XENFEAT_auto_translated_physmap, dom->f_active);
 }
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 4c7698c..2b92d48 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -618,6 +618,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     }
 
     dom->pvh_enabled =3D state->pvh_enabled;
+    dom->container_type =3D XC_DOM_PV_CONTAINER;
 
     LOG(DEBUG, "pv kernel mapped %d path %s", state->pv_kernel.mapped, state->pv_kernel.path);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1GH-0001FU-00; Mon, 19 Oct 2015 03:37: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 1Zo1GG-0001FK-3B
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:24 +0000
Content-Length: 13954
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	54/1E-31450-37564265; Mon, 19 Oct 2015 03:37:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1445225841!37737016!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11826 invoked from network); 19 Oct 2015 03:37:22 -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;
	19 Oct 2015 03:37:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GD-0005fB-AR
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GD-0004Mm-8B
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:21 +0000
Date: Mon, 19 Oct 2015 03:37:21 +0000
Message-Id: <E1Zo1GD-0004Mm-8B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce a domain loader for
	HVM guest firmware
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7202128101946261462=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7202128101946261462==
Content-Length: 13938
Content-Transfer-Encoding: quoted-printable

commit ad787bafcd2a3058f0f37f2fe84931bd5136bde9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 7 18:55:38 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:33 2015 +0100

    libxc: introduce a domain loader for HVM guest firmware
    
    Introduce a very simple (and dummy) domain loader to be used to load the
    firmware (hvmloader) into HVM guests. Since hmvloader is just a 32bit elf
    executable the loader is fairly simple.
    
    Since the order in which loaders are tested cannot be arranged, prevent the
    current elfloader from trying to boot a kernel that doesn't contain Xen
    ELFNOTES.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@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: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/Makefile           |    1 +
 tools/libxc/include/xc_dom.h   |    8 +
 tools/libxc/xc_dom_elfloader.c |   22 +++-
 tools/libxc/xc_dom_hvmloader.c |  313 ++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/libelf.h       |    1 +
 5 files changed, 344 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index a0f899b..baaadd6 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -84,6 +84,7 @@ GUEST_SRCS-y                 +=3D xc_dom_core.c xc_dom_boot.c
 GUEST_SRCS-y                 +=3D xc_dom_elfloader.c
 GUEST_SRCS-$(CONFIG_X86)     +=3D xc_dom_bzimageloader.c
 GUEST_SRCS-$(CONFIG_X86)     +=3D xc_dom_decompress_lz4.c
+GUEST_SRCS-$(CONFIG_X86)     +=3D xc_dom_hvmloader.c
 GUEST_SRCS-$(CONFIG_ARM)     +=3D xc_dom_armzimageloader.c
 GUEST_SRCS-y                 +=3D xc_dom_binloader.c
 GUEST_SRCS-y                 +=3D xc_dom_compat_linux.c
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 30fa8c5..88c5c80 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -14,6 +14,7 @@
  */
 
 #include <xen/libelf/libelf.h>
+#include <xenguest.h>
 
 #define INVALID_P2M_ENTRY   ((xen_pfn_t)-1)
 
@@ -183,6 +184,13 @@ struct xc_dom_image {
         XC_DOM_PV_CONTAINER,
         XC_DOM_HVM_CONTAINER,
     } container_type;
+
+    /* HVM specific fields. */
+    /* Extra ACPI tables passed to HVMLOADER */
+    struct xc_hvm_firmware_module acpi_module;
+
+    /* Extra SMBIOS structures passed to HVMLOADER */
+    struct xc_hvm_firmware_module smbios_module;
 };
 
 /* --- pluggable kernel loader ------------------------------------- */
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 82524c9..36a115e 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -106,7 +106,27 @@ static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
 
 static elf_negerrnoval xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
 {
-    return check_elf_kernel(dom, 0);
+    struct elf_binary elf;
+    int rc;
+
+    rc =3D check_elf_kernel(dom, 0);
+    if ( rc !=3D 0 )
+        return rc;
+
+    rc =3D elf_init(&elf, dom->kernel_blob, dom->kernel_size);
+    if ( rc !=3D 0 )
+        return rc;
+
+    /*
+     * We need to check that it contains Xen ELFNOTES,
+     * or else we might be trying to load a plain ELF.
+     */
+    elf_parse_binary(&elf);
+    rc =3D elf_xen_parse(&elf, &dom->parms);
+    if ( rc !=3D 0 )
+        return rc;
+
+    return 0;
 }
 
 static elf_errorstatus xc_dom_load_elf_symtab(struct xc_dom_image *dom,
diff --git a/tools/libxc/xc_dom_hvmloader.c b/tools/libxc/xc_dom_hvmloader.c
new file mode 100644
index 0000000..79a3b99
--- /dev/null
+++ b/tools/libxc/xc_dom_hvmloader.c
@@ -0,0 +1,313 @@
+/*
+ * Xen domain builder -- HVM specific bits.
+ *
+ * Parse and load ELF firmware images for HVM domains.
+ *
+ * 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
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <inttypes.h>
+#include <assert.h>
+
+#include "xg_private.h"
+#include "xc_dom.h"
+#include "xc_bitops.h"
+
+/* ------------------------------------------------------------------------ */
+/* parse elf binary                                                         */
+
+static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
+{
+    if ( dom->kernel_blob =3D=3D NULL )
+    {
+        if ( verbose )
+            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                         "%s: no kernel image loaded", __func__);
+        return -EINVAL;
+    }
+
+    if ( !elf_is_elfbinary(dom->kernel_blob, dom->kernel_size) )
+    {
+        if ( verbose )
+            xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                         "%s: kernel is not an ELF image", __func__);
+        return -EINVAL;
+    }
+    return 0;
+}
+
+static elf_negerrnoval xc_dom_probe_hvm_kernel(struct xc_dom_image *dom)
+{
+    struct elf_binary elf;
+    int rc;
+
+    /* This loader is designed for HVM guest firmware. */
+    if ( dom->container_type !=3D XC_DOM_HVM_CONTAINER )
+        return -EINVAL;
+
+    rc =3D check_elf_kernel(dom, 0);
+    if ( rc !=3D 0 )
+        return rc;
+
+    rc =3D elf_init(&elf, dom->kernel_blob, dom->kernel_size);
+    if ( rc !=3D 0 )
+        return rc;
+
+    /*
+     * We need to check that there are no Xen ELFNOTES, or
+     * else we might be trying to load a PV kernel.
+     */
+    elf_parse_binary(&elf);
+    rc =3D elf_xen_parse(&elf, &dom->parms);
+    if ( rc =3D=3D 0 )
+        return -EINVAL;
+
+    return 0;
+}
+
+static elf_errorstatus xc_dom_parse_hvm_kernel(struct xc_dom_image *dom)
+    /*
+     * This function sometimes returns -1 for error and sometimes
+     * an errno value.  =3F!=3F!
+     */
+{
+    struct elf_binary *elf;
+    elf_errorstatus rc;
+
+    rc =3D check_elf_kernel(dom, 1);
+    if ( rc !=3D 0 )
+        return rc;
+
+    elf =3D xc_dom_malloc(dom, sizeof(*elf));
+    if ( elf =3D=3D NULL )
+        return -1;
+    dom->private_loader =3D elf;
+    rc =3D elf_init(elf, dom->kernel_blob, dom->kernel_size);
+    xc_elf_set_logfile(dom->xch, elf, 1);
+    if ( rc !=3D 0 )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: corrupted ELF image",
+                     __func__);
+        return rc;
+    }
+
+    if ( !elf_32bit(elf) )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: ELF image is not 32bit",
+                     __func__);
+        return -EINVAL;
+    }
+
+    /* parse binary and get xen meta info */
+    elf_parse_binary(elf);
+
+    /* find kernel segment */
+    dom->kernel_seg.vstart =3D elf->pstart;
+    dom->kernel_seg.vend   =3D elf->pend;
+
+    dom->guest_type =3D "hvm-3.0-x86_32";
+
+    if ( elf_check_broken(elf) )
+        DOMPRINTF("%s: ELF broken: %s", __func__, elf_check_broken(elf));
+
+    return rc;
+}
+
+static int modules_init(struct xc_dom_image *dom,
+                        uint64_t vend, struct elf_binary *elf,
+                        uint64_t *mstart_out, uint64_t *mend_out)
+{
+#define MODULE_ALIGN 1UL << 7
+#define MB_ALIGN     1UL << 20
+#define MKALIGN(x, a) (((uint64_t)(x) + (a) - 1) & ~(uint64_t)((a) - 1))
+    uint64_t total_len =3D 0, offset1 =3D 0;
+
+    if ( dom->acpi_module.length =3D=3D 0 && dom->smbios_module.length =3D=3D 0 )
+        return 0;
+
+    /* Find the total length for the firmware modules with a reasonable large
+     * alignment size to align each the modules.
+     */
+    total_len =3D MKALIGN(dom->acpi_module.length, MODULE_ALIGN);
+    offset1 =3D total_len;
+    total_len +=3D MKALIGN(dom->smbios_module.length, MODULE_ALIGN);
+
+    /* Want to place the modules 1Mb+change behind the loader image. */
+    *mstart_out =3D MKALIGN(elf->pend, MB_ALIGN) + (MB_ALIGN);
+    *mend_out =3D *mstart_out + total_len;
+
+    if ( *mend_out > vend )
+        return -1;
+
+    if ( dom->acpi_module.length !=3D 0 )
+        dom->acpi_module.guest_addr_out =3D *mstart_out;
+    if ( dom->smbios_module.length !=3D 0 )
+        dom->smbios_module.guest_addr_out =3D *mstart_out + offset1;
+
+    return 0;
+}
+
+static int loadmodules(struct xc_dom_image *dom,
+                       uint64_t mstart, uint64_t mend,
+                       uint32_t domid)
+{
+    privcmd_mmap_entry_t *entries =3D NULL;
+    unsigned long pfn_start;
+    unsigned long pfn_end;
+    size_t pages;
+    uint32_t i;
+    uint8_t *dest;
+    int rc =3D -1;
+    xc_interface *xch =3D dom->xch;
+
+    if ( mstart =3D=3D 0 || mend =3D=3D 0 )
+        return 0;
+
+    pfn_start =3D (unsigned long)(mstart >> PAGE_SHIFT);
+    pfn_end =3D (unsigned long)((mend + PAGE_SIZE - 1) >> PAGE_SHIFT);
+    pages =3D pfn_end - pfn_start;
+
+    /* Map address space for module list. */
+    entries =3D calloc(pages, sizeof(privcmd_mmap_entry_t));
+    if ( entries =3D=3D NULL )
+        goto error_out;
+
+    for ( i =3D 0; i < pages; i++ )
+        entries[i].mfn =3D (mstart >> PAGE_SHIFT) + i;
+
+    dest =3D xc_map_foreign_ranges(
+        xch, domid, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
+        entries, pages);
+    if ( dest =3D=3D NULL )
+        goto error_out;
+
+    /* Zero the range so padding is clear between modules */
+    memset(dest, 0, pages << PAGE_SHIFT);
+
+    /* Load modules into range */
+    if ( dom->acpi_module.length !=3D 0 )
+    {
+        memcpy(dest,
+               dom->acpi_module.data,
+               dom->acpi_module.length);
+    }
+    if ( dom->smbios_module.length !=3D 0 )
+    {
+        memcpy(dest + (dom->smbios_module.guest_addr_out - mstart),
+               dom->smbios_module.data,
+               dom->smbios_module.length);
+    }
+
+    munmap(dest, pages << PAGE_SHIFT);
+    rc =3D 0;
+
+ error_out:
+    free(entries);
+
+    return rc;
+}
+
+static elf_errorstatus xc_dom_load_hvm_kernel(struct xc_dom_image *dom)
+{
+    struct elf_binary *elf =3D dom->private_loader;
+    privcmd_mmap_entry_t *entries =3D NULL;
+    size_t pages =3D (elf->pend - elf->pstart + PAGE_SIZE - 1) >> PAGE_SHIFT;
+    elf_errorstatus rc;
+    uint64_t m_start =3D 0, m_end =3D 0;
+    int i;
+
+    /* Map address space for initial elf image. */
+    entries =3D calloc(pages, sizeof(privcmd_mmap_entry_t));
+    if ( entries =3D=3D NULL )
+        return -ENOMEM;
+
+    for ( i =3D 0; i < pages; i++ )
+        entries[i].mfn =3D (elf->pstart >> PAGE_SHIFT) + i;
+
+    elf->dest_base =3D xc_map_foreign_ranges(
+        dom->xch, dom->guest_domid, pages << PAGE_SHIFT,
+        PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
+        entries, pages);
+    if ( elf->dest_base =3D=3D NULL )
+    {
+        DOMPRINTF("%s: unable to map guest memory space", __func__);
+        rc =3D -EFAULT;
+        goto error;
+    }
+
+    elf->dest_size =3D pages * XC_DOM_PAGE_SIZE(dom);
+
+    rc =3D elf_load_binary(elf);
+    if ( rc < 0 )
+    {
+        DOMPRINTF("%s: failed to load elf binary", __func__);
+        return rc;
+    }
+
+    munmap(elf->dest_base, elf->dest_size);
+
+    rc =3D modules_init(dom, dom->total_pages << PAGE_SHIFT, elf, &m_start,
+                      &m_end);
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("%s: insufficient space to load modules.", __func__);
+        return rc;
+    }
+
+    rc =3D loadmodules(dom, m_start, m_end, dom->guest_domid);
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("%s: unable to load modules.", __func__);
+        return rc;
+    }
+
+    dom->parms.phys_entry =3D elf_uval(elf, elf->ehdr, e_entry);
+
+    free(entries);
+    return 0;
+
+ error:
+    assert(rc !=3D 0);
+    free(entries);
+    return rc;
+}
+
+/* ------------------------------------------------------------------------ */
+
+struct xc_dom_loader hvm_loader =3D {
+    .name =3D "HVM-generic",
+    .probe =3D xc_dom_probe_hvm_kernel,
+    .parser =3D xc_dom_parse_hvm_kernel,
+    .loader =3D xc_dom_load_hvm_kernel,
+};
+
+static void __init register_loader(void)
+{
+    xc_dom_register_loader(&hvm_loader);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index d7045f6..de788c7 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -431,6 +431,7 @@ struct elf_dom_parms {
     uint64_t elf_paddr_offset;
     uint32_t f_supported[XENFEAT_NR_SUBMAPS];
     uint32_t f_required[XENFEAT_NR_SUBMAPS];
+    uint32_t phys_entry;
 
     /* calculated */
     uint64_t virt_offset;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1GH-0001FU-00; Mon, 19 Oct 2015 03:37: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 1Zo1GG-0001FK-3B
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:24 +0000
Content-Length: 13954
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	54/1E-31450-37564265; Mon, 19 Oct 2015 03:37:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1445225841!37737016!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11826 invoked from network); 19 Oct 2015 03:37:22 -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;
	19 Oct 2015 03:37:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GD-0005fB-AR
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GD-0004Mm-8B
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:21 +0000
Date: Mon, 19 Oct 2015 03:37:21 +0000
Message-Id: <E1Zo1GD-0004Mm-8B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce a domain loader for
	HVM guest firmware
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7202128101946261462=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7202128101946261462==
Content-Length: 13938
Content-Transfer-Encoding: quoted-printable

commit ad787bafcd2a3058f0f37f2fe84931bd5136bde9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 7 18:55:38 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:33 2015 +0100

    libxc: introduce a domain loader for HVM guest firmware
    
    Introduce a very simple (and dummy) domain loader to be used to load the
    firmware (hvmloader) into HVM guests. Since hmvloader is just a 32bit elf
    executable the loader is fairly simple.
    
    Since the order in which loaders are tested cannot be arranged, prevent the
    current elfloader from trying to boot a kernel that doesn't contain Xen
    ELFNOTES.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@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: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/Makefile           |    1 +
 tools/libxc/include/xc_dom.h   |    8 +
 tools/libxc/xc_dom_elfloader.c |   22 +++-
 tools/libxc/xc_dom_hvmloader.c |  313 ++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/libelf.h       |    1 +
 5 files changed, 344 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index a0f899b..baaadd6 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -84,6 +84,7 @@ GUEST_SRCS-y                 +=3D xc_dom_core.c xc_dom_boot.c
 GUEST_SRCS-y                 +=3D xc_dom_elfloader.c
 GUEST_SRCS-$(CONFIG_X86)     +=3D xc_dom_bzimageloader.c
 GUEST_SRCS-$(CONFIG_X86)     +=3D xc_dom_decompress_lz4.c
+GUEST_SRCS-$(CONFIG_X86)     +=3D xc_dom_hvmloader.c
 GUEST_SRCS-$(CONFIG_ARM)     +=3D xc_dom_armzimageloader.c
 GUEST_SRCS-y                 +=3D xc_dom_binloader.c
 GUEST_SRCS-y                 +=3D xc_dom_compat_linux.c
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 30fa8c5..88c5c80 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -14,6 +14,7 @@
  */
 
 #include <xen/libelf/libelf.h>
+#include <xenguest.h>
 
 #define INVALID_P2M_ENTRY   ((xen_pfn_t)-1)
 
@@ -183,6 +184,13 @@ struct xc_dom_image {
         XC_DOM_PV_CONTAINER,
         XC_DOM_HVM_CONTAINER,
     } container_type;
+
+    /* HVM specific fields. */
+    /* Extra ACPI tables passed to HVMLOADER */
+    struct xc_hvm_firmware_module acpi_module;
+
+    /* Extra SMBIOS structures passed to HVMLOADER */
+    struct xc_hvm_firmware_module smbios_module;
 };
 
 /* --- pluggable kernel loader ------------------------------------- */
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 82524c9..36a115e 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -106,7 +106,27 @@ static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
 
 static elf_negerrnoval xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
 {
-    return check_elf_kernel(dom, 0);
+    struct elf_binary elf;
+    int rc;
+
+    rc =3D check_elf_kernel(dom, 0);
+    if ( rc !=3D 0 )
+        return rc;
+
+    rc =3D elf_init(&elf, dom->kernel_blob, dom->kernel_size);
+    if ( rc !=3D 0 )
+        return rc;
+
+    /*
+     * We need to check that it contains Xen ELFNOTES,
+     * or else we might be trying to load a plain ELF.
+     */
+    elf_parse_binary(&elf);
+    rc =3D elf_xen_parse(&elf, &dom->parms);
+    if ( rc !=3D 0 )
+        return rc;
+
+    return 0;
 }
 
 static elf_errorstatus xc_dom_load_elf_symtab(struct xc_dom_image *dom,
diff --git a/tools/libxc/xc_dom_hvmloader.c b/tools/libxc/xc_dom_hvmloader.c
new file mode 100644
index 0000000..79a3b99
--- /dev/null
+++ b/tools/libxc/xc_dom_hvmloader.c
@@ -0,0 +1,313 @@
+/*
+ * Xen domain builder -- HVM specific bits.
+ *
+ * Parse and load ELF firmware images for HVM domains.
+ *
+ * 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
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <inttypes.h>
+#include <assert.h>
+
+#include "xg_private.h"
+#include "xc_dom.h"
+#include "xc_bitops.h"
+
+/* ------------------------------------------------------------------------ */
+/* parse elf binary                                                         */
+
+static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
+{
+    if ( dom->kernel_blob =3D=3D NULL )
+    {
+        if ( verbose )
+            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                         "%s: no kernel image loaded", __func__);
+        return -EINVAL;
+    }
+
+    if ( !elf_is_elfbinary(dom->kernel_blob, dom->kernel_size) )
+    {
+        if ( verbose )
+            xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                         "%s: kernel is not an ELF image", __func__);
+        return -EINVAL;
+    }
+    return 0;
+}
+
+static elf_negerrnoval xc_dom_probe_hvm_kernel(struct xc_dom_image *dom)
+{
+    struct elf_binary elf;
+    int rc;
+
+    /* This loader is designed for HVM guest firmware. */
+    if ( dom->container_type !=3D XC_DOM_HVM_CONTAINER )
+        return -EINVAL;
+
+    rc =3D check_elf_kernel(dom, 0);
+    if ( rc !=3D 0 )
+        return rc;
+
+    rc =3D elf_init(&elf, dom->kernel_blob, dom->kernel_size);
+    if ( rc !=3D 0 )
+        return rc;
+
+    /*
+     * We need to check that there are no Xen ELFNOTES, or
+     * else we might be trying to load a PV kernel.
+     */
+    elf_parse_binary(&elf);
+    rc =3D elf_xen_parse(&elf, &dom->parms);
+    if ( rc =3D=3D 0 )
+        return -EINVAL;
+
+    return 0;
+}
+
+static elf_errorstatus xc_dom_parse_hvm_kernel(struct xc_dom_image *dom)
+    /*
+     * This function sometimes returns -1 for error and sometimes
+     * an errno value.  =3F!=3F!
+     */
+{
+    struct elf_binary *elf;
+    elf_errorstatus rc;
+
+    rc =3D check_elf_kernel(dom, 1);
+    if ( rc !=3D 0 )
+        return rc;
+
+    elf =3D xc_dom_malloc(dom, sizeof(*elf));
+    if ( elf =3D=3D NULL )
+        return -1;
+    dom->private_loader =3D elf;
+    rc =3D elf_init(elf, dom->kernel_blob, dom->kernel_size);
+    xc_elf_set_logfile(dom->xch, elf, 1);
+    if ( rc !=3D 0 )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: corrupted ELF image",
+                     __func__);
+        return rc;
+    }
+
+    if ( !elf_32bit(elf) )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: ELF image is not 32bit",
+                     __func__);
+        return -EINVAL;
+    }
+
+    /* parse binary and get xen meta info */
+    elf_parse_binary(elf);
+
+    /* find kernel segment */
+    dom->kernel_seg.vstart =3D elf->pstart;
+    dom->kernel_seg.vend   =3D elf->pend;
+
+    dom->guest_type =3D "hvm-3.0-x86_32";
+
+    if ( elf_check_broken(elf) )
+        DOMPRINTF("%s: ELF broken: %s", __func__, elf_check_broken(elf));
+
+    return rc;
+}
+
+static int modules_init(struct xc_dom_image *dom,
+                        uint64_t vend, struct elf_binary *elf,
+                        uint64_t *mstart_out, uint64_t *mend_out)
+{
+#define MODULE_ALIGN 1UL << 7
+#define MB_ALIGN     1UL << 20
+#define MKALIGN(x, a) (((uint64_t)(x) + (a) - 1) & ~(uint64_t)((a) - 1))
+    uint64_t total_len =3D 0, offset1 =3D 0;
+
+    if ( dom->acpi_module.length =3D=3D 0 && dom->smbios_module.length =3D=3D 0 )
+        return 0;
+
+    /* Find the total length for the firmware modules with a reasonable large
+     * alignment size to align each the modules.
+     */
+    total_len =3D MKALIGN(dom->acpi_module.length, MODULE_ALIGN);
+    offset1 =3D total_len;
+    total_len +=3D MKALIGN(dom->smbios_module.length, MODULE_ALIGN);
+
+    /* Want to place the modules 1Mb+change behind the loader image. */
+    *mstart_out =3D MKALIGN(elf->pend, MB_ALIGN) + (MB_ALIGN);
+    *mend_out =3D *mstart_out + total_len;
+
+    if ( *mend_out > vend )
+        return -1;
+
+    if ( dom->acpi_module.length !=3D 0 )
+        dom->acpi_module.guest_addr_out =3D *mstart_out;
+    if ( dom->smbios_module.length !=3D 0 )
+        dom->smbios_module.guest_addr_out =3D *mstart_out + offset1;
+
+    return 0;
+}
+
+static int loadmodules(struct xc_dom_image *dom,
+                       uint64_t mstart, uint64_t mend,
+                       uint32_t domid)
+{
+    privcmd_mmap_entry_t *entries =3D NULL;
+    unsigned long pfn_start;
+    unsigned long pfn_end;
+    size_t pages;
+    uint32_t i;
+    uint8_t *dest;
+    int rc =3D -1;
+    xc_interface *xch =3D dom->xch;
+
+    if ( mstart =3D=3D 0 || mend =3D=3D 0 )
+        return 0;
+
+    pfn_start =3D (unsigned long)(mstart >> PAGE_SHIFT);
+    pfn_end =3D (unsigned long)((mend + PAGE_SIZE - 1) >> PAGE_SHIFT);
+    pages =3D pfn_end - pfn_start;
+
+    /* Map address space for module list. */
+    entries =3D calloc(pages, sizeof(privcmd_mmap_entry_t));
+    if ( entries =3D=3D NULL )
+        goto error_out;
+
+    for ( i =3D 0; i < pages; i++ )
+        entries[i].mfn =3D (mstart >> PAGE_SHIFT) + i;
+
+    dest =3D xc_map_foreign_ranges(
+        xch, domid, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
+        entries, pages);
+    if ( dest =3D=3D NULL )
+        goto error_out;
+
+    /* Zero the range so padding is clear between modules */
+    memset(dest, 0, pages << PAGE_SHIFT);
+
+    /* Load modules into range */
+    if ( dom->acpi_module.length !=3D 0 )
+    {
+        memcpy(dest,
+               dom->acpi_module.data,
+               dom->acpi_module.length);
+    }
+    if ( dom->smbios_module.length !=3D 0 )
+    {
+        memcpy(dest + (dom->smbios_module.guest_addr_out - mstart),
+               dom->smbios_module.data,
+               dom->smbios_module.length);
+    }
+
+    munmap(dest, pages << PAGE_SHIFT);
+    rc =3D 0;
+
+ error_out:
+    free(entries);
+
+    return rc;
+}
+
+static elf_errorstatus xc_dom_load_hvm_kernel(struct xc_dom_image *dom)
+{
+    struct elf_binary *elf =3D dom->private_loader;
+    privcmd_mmap_entry_t *entries =3D NULL;
+    size_t pages =3D (elf->pend - elf->pstart + PAGE_SIZE - 1) >> PAGE_SHIFT;
+    elf_errorstatus rc;
+    uint64_t m_start =3D 0, m_end =3D 0;
+    int i;
+
+    /* Map address space for initial elf image. */
+    entries =3D calloc(pages, sizeof(privcmd_mmap_entry_t));
+    if ( entries =3D=3D NULL )
+        return -ENOMEM;
+
+    for ( i =3D 0; i < pages; i++ )
+        entries[i].mfn =3D (elf->pstart >> PAGE_SHIFT) + i;
+
+    elf->dest_base =3D xc_map_foreign_ranges(
+        dom->xch, dom->guest_domid, pages << PAGE_SHIFT,
+        PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
+        entries, pages);
+    if ( elf->dest_base =3D=3D NULL )
+    {
+        DOMPRINTF("%s: unable to map guest memory space", __func__);
+        rc =3D -EFAULT;
+        goto error;
+    }
+
+    elf->dest_size =3D pages * XC_DOM_PAGE_SIZE(dom);
+
+    rc =3D elf_load_binary(elf);
+    if ( rc < 0 )
+    {
+        DOMPRINTF("%s: failed to load elf binary", __func__);
+        return rc;
+    }
+
+    munmap(elf->dest_base, elf->dest_size);
+
+    rc =3D modules_init(dom, dom->total_pages << PAGE_SHIFT, elf, &m_start,
+                      &m_end);
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("%s: insufficient space to load modules.", __func__);
+        return rc;
+    }
+
+    rc =3D loadmodules(dom, m_start, m_end, dom->guest_domid);
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("%s: unable to load modules.", __func__);
+        return rc;
+    }
+
+    dom->parms.phys_entry =3D elf_uval(elf, elf->ehdr, e_entry);
+
+    free(entries);
+    return 0;
+
+ error:
+    assert(rc !=3D 0);
+    free(entries);
+    return rc;
+}
+
+/* ------------------------------------------------------------------------ */
+
+struct xc_dom_loader hvm_loader =3D {
+    .name =3D "HVM-generic",
+    .probe =3D xc_dom_probe_hvm_kernel,
+    .parser =3D xc_dom_parse_hvm_kernel,
+    .loader =3D xc_dom_load_hvm_kernel,
+};
+
+static void __init register_loader(void)
+{
+    xc_dom_register_loader(&hvm_loader);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index d7045f6..de788c7 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -431,6 +431,7 @@ struct elf_dom_parms {
     uint64_t elf_paddr_offset;
     uint32_t f_supported[XENFEAT_NR_SUBMAPS];
     uint32_t f_required[XENFEAT_NR_SUBMAPS];
+    uint32_t phys_entry;
 
     /* calculated */
     uint64_t virt_offset;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1GS-0001HQ-3S; Mon, 19 Oct 2015 03:37:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GQ-0001HA-HH
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:34 +0000
Content-Length: 9192
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	86/70-22142-D7564265; Mon, 19 Oct 2015 03:37:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445225851!43128023!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 31937 invoked from network); 19 Oct 2015 03:37:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:37:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GN-0005fJ-My
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GN-0004NX-K6
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:31 +0000
Date: Mon, 19 Oct 2015 03:37:31 +0000
Message-Id: <E1Zo1GN-0004NX-K6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: make arch_setup_meminit a
	xc_dom_arch hook
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6424830647089481917=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6424830647089481917==
Content-Length: 9000
Content-Transfer-Encoding: quoted-printable

commit 392478215aab8c87e041d00765cf5f8572ac3f3f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:37 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:44 2015 +0100

    libxc: make arch_setup_meminit a xc_dom_arch hook
    
    This allows having different arch_setup_meminit implementations based on the
    guest type. It should not introduce any functional changes.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/include/xc_dom.h |    4 ++-
 tools/libxc/xc_dom_arm.c     |   70 ++++++++++++++++++++++-------------------
 tools/libxc/xc_dom_boot.c    |    2 +-
 tools/libxc/xc_dom_x86.c     |   71 ++++++++++++++++++++++--------------------
 4 files changed, 78 insertions(+), 69 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 88c5c80..01739fa 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -221,6 +221,9 @@ struct xc_dom_arch {
     int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
     int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
 
+    /* arch-specific memory initialization. */
+    int (*meminit) (struct xc_dom_image * dom);
+
     char *guest_type;
     char *native_protocol;
     int page_shift;
@@ -398,7 +401,6 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
 
 /* --- arch bits --------------------------------------------------- */
 
-int arch_setup_meminit(struct xc_dom_image *dom);
 int arch_setup_bootearly(struct xc_dom_image *dom);
 int arch_setup_bootlate(struct xc_dom_image *dom);
 
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index aeaba54..e8a0756 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -194,38 +194,6 @@ static int vcpu_arm64(struct xc_dom_image *dom, void *ptr)
 
 /* ------------------------------------------------------------------------ */
 
-static struct xc_dom_arch xc_dom_32 =3D {
-    .guest_type =3D "xen-3.0-armv7l",
-    .native_protocol =3D XEN_IO_PROTO_ABI_ARM,
-    .page_shift =3D PAGE_SHIFT_ARM,
-    .sizeof_pfn =3D 8,
-    .alloc_magic_pages =3D alloc_magic_pages,
-    .count_pgtables =3D count_pgtables_arm,
-    .setup_pgtables =3D setup_pgtables_arm,
-    .start_info =3D start_info_arm,
-    .shared_info =3D shared_info_arm,
-    .vcpu =3D vcpu_arm32,
-};
-
-static struct xc_dom_arch xc_dom_64 =3D {
-    .guest_type =3D "xen-3.0-aarch64",
-    .native_protocol =3D XEN_IO_PROTO_ABI_ARM,
-    .page_shift =3D PAGE_SHIFT_ARM,
-    .sizeof_pfn =3D 8,
-    .alloc_magic_pages =3D alloc_magic_pages,
-    .count_pgtables =3D count_pgtables_arm,
-    .setup_pgtables =3D setup_pgtables_arm,
-    .start_info =3D start_info_arm,
-    .shared_info =3D shared_info_arm,
-    .vcpu =3D vcpu_arm64,
-};
-
-static void __init register_arch_hooks(void)
-{
-    xc_dom_register_arch_hooks(&xc_dom_32);
-    xc_dom_register_arch_hooks(&xc_dom_64);
-}
-
 static int set_mode(xc_interface *xch, domid_t domid, char *guest_type)
 {
     static const struct {
@@ -384,7 +352,7 @@ out:
     return rc < 0 =3F rc : 0;
 }
 
-int arch_setup_meminit(struct xc_dom_image *dom)
+static int meminit(struct xc_dom_image *dom)
 {
     int i, rc;
     xen_pfn_t pfn;
@@ -542,6 +510,42 @@ int xc_dom_feature_translated(struct xc_dom_image *dom)
     return 1;
 }
 
+/* ------------------------------------------------------------------------ */
+
+static struct xc_dom_arch xc_dom_32 =3D {
+    .guest_type =3D "xen-3.0-armv7l",
+    .native_protocol =3D XEN_IO_PROTO_ABI_ARM,
+    .page_shift =3D PAGE_SHIFT_ARM,
+    .sizeof_pfn =3D 8,
+    .alloc_magic_pages =3D alloc_magic_pages,
+    .count_pgtables =3D count_pgtables_arm,
+    .setup_pgtables =3D setup_pgtables_arm,
+    .start_info =3D start_info_arm,
+    .shared_info =3D shared_info_arm,
+    .vcpu =3D vcpu_arm32,
+    .meminit =3D meminit,
+};
+
+static struct xc_dom_arch xc_dom_64 =3D {
+    .guest_type =3D "xen-3.0-aarch64",
+    .native_protocol =3D XEN_IO_PROTO_ABI_ARM,
+    .page_shift =3D PAGE_SHIFT_ARM,
+    .sizeof_pfn =3D 8,
+    .alloc_magic_pages =3D alloc_magic_pages,
+    .count_pgtables =3D count_pgtables_arm,
+    .setup_pgtables =3D setup_pgtables_arm,
+    .start_info =3D start_info_arm,
+    .shared_info =3D shared_info_arm,
+    .vcpu =3D vcpu_arm64,
+    .meminit =3D meminit,
+};
+
+static void __init register_arch_hooks(void)
+{
+    xc_dom_register_arch_hooks(&xc_dom_32);
+    xc_dom_register_arch_hooks(&xc_dom_64);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index 7c30f96..bf2cd7b 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -146,7 +146,7 @@ int xc_dom_boot_mem_init(struct xc_dom_image *dom)
 
     DOMPRINTF_CALLED(dom->xch);
 
-    rc =3D arch_setup_meminit(dom);
+    rc =3D dom->arch_hooks->meminit(dom);
     if ( rc !=3D 0 )
     {
         xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index d306475..fbedf85 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -668,38 +668,6 @@ static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
 
 /* ------------------------------------------------------------------------ */
 
-static struct xc_dom_arch xc_dom_32_pae =3D {
-    .guest_type =3D "xen-3.0-x86_32p",
-    .native_protocol =3D XEN_IO_PROTO_ABI_X86_32,
-    .page_shift =3D PAGE_SHIFT_X86,
-    .sizeof_pfn =3D 4,
-    .alloc_magic_pages =3D alloc_magic_pages,
-    .count_pgtables =3D count_pgtables_x86_32_pae,
-    .setup_pgtables =3D setup_pgtables_x86_32_pae,
-    .start_info =3D start_info_x86_32,
-    .shared_info =3D shared_info_x86_32,
-    .vcpu =3D vcpu_x86_32,
-};
-
-static struct xc_dom_arch xc_dom_64 =3D {
-    .guest_type =3D "xen-3.0-x86_64",
-    .native_protocol =3D XEN_IO_PROTO_ABI_X86_64,
-    .page_shift =3D PAGE_SHIFT_X86,
-    .sizeof_pfn =3D 8,
-    .alloc_magic_pages =3D alloc_magic_pages,
-    .count_pgtables =3D count_pgtables_x86_64,
-    .setup_pgtables =3D setup_pgtables_x86_64,
-    .start_info =3D start_info_x86_64,
-    .shared_info =3D shared_info_x86_64,
-    .vcpu =3D vcpu_x86_64,
-};
-
-static void __init register_arch_hooks(void)
-{
-    xc_dom_register_arch_hooks(&xc_dom_32_pae);
-    xc_dom_register_arch_hooks(&xc_dom_64);
-}
-
 static int x86_compat(xc_interface *xch, domid_t domid, char *guest_type)
 {
     static const struct {
@@ -731,7 +699,6 @@ static int x86_compat(xc_interface *xch, domid_t domid, char *guest_type)
     return rc;
 }
 
-
 static int x86_shadow(xc_interface *xch, domid_t domid)
 {
     int rc, mode;
@@ -755,7 +722,7 @@ static int x86_shadow(xc_interface *xch, domid_t domid)
     return rc;
 }
 
-int arch_setup_meminit(struct xc_dom_image *dom)
+static int meminit_pv(struct xc_dom_image *dom)
 {
     int rc;
     xen_pfn_t pfn, allocsz, mfn, total, pfn_base;
@@ -1076,6 +1043,42 @@ int xc_dom_feature_translated(struct xc_dom_image *dom)
     return elf_xen_feature_get(XENFEAT_auto_translated_physmap, dom->f_active);
 }
 
+/* ------------------------------------------------------------------------ */
+
+static struct xc_dom_arch xc_dom_32_pae =3D {
+    .guest_type =3D "xen-3.0-x86_32p",
+    .native_protocol =3D XEN_IO_PROTO_ABI_X86_32,
+    .page_shift =3D PAGE_SHIFT_X86,
+    .sizeof_pfn =3D 4,
+    .alloc_magic_pages =3D alloc_magic_pages,
+    .count_pgtables =3D count_pgtables_x86_32_pae,
+    .setup_pgtables =3D setup_pgtables_x86_32_pae,
+    .start_info =3D start_info_x86_32,
+    .shared_info =3D shared_info_x86_32,
+    .vcpu =3D vcpu_x86_32,
+    .meminit =3D meminit_pv,
+};
+
+static struct xc_dom_arch xc_dom_64 =3D {
+    .guest_type =3D "xen-3.0-x86_64",
+    .native_protocol =3D XEN_IO_PROTO_ABI_X86_64,
+    .page_shift =3D PAGE_SHIFT_X86,
+    .sizeof_pfn =3D 8,
+    .alloc_magic_pages =3D alloc_magic_pages,
+    .count_pgtables =3D count_pgtables_x86_64,
+    .setup_pgtables =3D setup_pgtables_x86_64,
+    .start_info =3D start_info_x86_64,
+    .shared_info =3D shared_info_x86_64,
+    .vcpu =3D vcpu_x86_64,
+    .meminit =3D meminit_pv,
+};
+
+static void __init register_arch_hooks(void)
+{
+    xc_dom_register_arch_hooks(&xc_dom_32_pae);
+    xc_dom_register_arch_hooks(&xc_dom_64);
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1GS-0001HQ-3S; Mon, 19 Oct 2015 03:37:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GQ-0001HA-HH
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:34 +0000
Content-Length: 9192
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	86/70-22142-D7564265; Mon, 19 Oct 2015 03:37:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445225851!43128023!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 31937 invoked from network); 19 Oct 2015 03:37:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:37:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GN-0005fJ-My
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GN-0004NX-K6
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:31 +0000
Date: Mon, 19 Oct 2015 03:37:31 +0000
Message-Id: <E1Zo1GN-0004NX-K6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: make arch_setup_meminit a
	xc_dom_arch hook
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6424830647089481917=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6424830647089481917==
Content-Length: 9000
Content-Transfer-Encoding: quoted-printable

commit 392478215aab8c87e041d00765cf5f8572ac3f3f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:37 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:44 2015 +0100

    libxc: make arch_setup_meminit a xc_dom_arch hook
    
    This allows having different arch_setup_meminit implementations based on the
    guest type. It should not introduce any functional changes.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/include/xc_dom.h |    4 ++-
 tools/libxc/xc_dom_arm.c     |   70 ++++++++++++++++++++++-------------------
 tools/libxc/xc_dom_boot.c    |    2 +-
 tools/libxc/xc_dom_x86.c     |   71 ++++++++++++++++++++++--------------------
 4 files changed, 78 insertions(+), 69 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 88c5c80..01739fa 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -221,6 +221,9 @@ struct xc_dom_arch {
     int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
     int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
 
+    /* arch-specific memory initialization. */
+    int (*meminit) (struct xc_dom_image * dom);
+
     char *guest_type;
     char *native_protocol;
     int page_shift;
@@ -398,7 +401,6 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
 
 /* --- arch bits --------------------------------------------------- */
 
-int arch_setup_meminit(struct xc_dom_image *dom);
 int arch_setup_bootearly(struct xc_dom_image *dom);
 int arch_setup_bootlate(struct xc_dom_image *dom);
 
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index aeaba54..e8a0756 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -194,38 +194,6 @@ static int vcpu_arm64(struct xc_dom_image *dom, void *ptr)
 
 /* ------------------------------------------------------------------------ */
 
-static struct xc_dom_arch xc_dom_32 =3D {
-    .guest_type =3D "xen-3.0-armv7l",
-    .native_protocol =3D XEN_IO_PROTO_ABI_ARM,
-    .page_shift =3D PAGE_SHIFT_ARM,
-    .sizeof_pfn =3D 8,
-    .alloc_magic_pages =3D alloc_magic_pages,
-    .count_pgtables =3D count_pgtables_arm,
-    .setup_pgtables =3D setup_pgtables_arm,
-    .start_info =3D start_info_arm,
-    .shared_info =3D shared_info_arm,
-    .vcpu =3D vcpu_arm32,
-};
-
-static struct xc_dom_arch xc_dom_64 =3D {
-    .guest_type =3D "xen-3.0-aarch64",
-    .native_protocol =3D XEN_IO_PROTO_ABI_ARM,
-    .page_shift =3D PAGE_SHIFT_ARM,
-    .sizeof_pfn =3D 8,
-    .alloc_magic_pages =3D alloc_magic_pages,
-    .count_pgtables =3D count_pgtables_arm,
-    .setup_pgtables =3D setup_pgtables_arm,
-    .start_info =3D start_info_arm,
-    .shared_info =3D shared_info_arm,
-    .vcpu =3D vcpu_arm64,
-};
-
-static void __init register_arch_hooks(void)
-{
-    xc_dom_register_arch_hooks(&xc_dom_32);
-    xc_dom_register_arch_hooks(&xc_dom_64);
-}
-
 static int set_mode(xc_interface *xch, domid_t domid, char *guest_type)
 {
     static const struct {
@@ -384,7 +352,7 @@ out:
     return rc < 0 =3F rc : 0;
 }
 
-int arch_setup_meminit(struct xc_dom_image *dom)
+static int meminit(struct xc_dom_image *dom)
 {
     int i, rc;
     xen_pfn_t pfn;
@@ -542,6 +510,42 @@ int xc_dom_feature_translated(struct xc_dom_image *dom)
     return 1;
 }
 
+/* ------------------------------------------------------------------------ */
+
+static struct xc_dom_arch xc_dom_32 =3D {
+    .guest_type =3D "xen-3.0-armv7l",
+    .native_protocol =3D XEN_IO_PROTO_ABI_ARM,
+    .page_shift =3D PAGE_SHIFT_ARM,
+    .sizeof_pfn =3D 8,
+    .alloc_magic_pages =3D alloc_magic_pages,
+    .count_pgtables =3D count_pgtables_arm,
+    .setup_pgtables =3D setup_pgtables_arm,
+    .start_info =3D start_info_arm,
+    .shared_info =3D shared_info_arm,
+    .vcpu =3D vcpu_arm32,
+    .meminit =3D meminit,
+};
+
+static struct xc_dom_arch xc_dom_64 =3D {
+    .guest_type =3D "xen-3.0-aarch64",
+    .native_protocol =3D XEN_IO_PROTO_ABI_ARM,
+    .page_shift =3D PAGE_SHIFT_ARM,
+    .sizeof_pfn =3D 8,
+    .alloc_magic_pages =3D alloc_magic_pages,
+    .count_pgtables =3D count_pgtables_arm,
+    .setup_pgtables =3D setup_pgtables_arm,
+    .start_info =3D start_info_arm,
+    .shared_info =3D shared_info_arm,
+    .vcpu =3D vcpu_arm64,
+    .meminit =3D meminit,
+};
+
+static void __init register_arch_hooks(void)
+{
+    xc_dom_register_arch_hooks(&xc_dom_32);
+    xc_dom_register_arch_hooks(&xc_dom_64);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index 7c30f96..bf2cd7b 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -146,7 +146,7 @@ int xc_dom_boot_mem_init(struct xc_dom_image *dom)
 
     DOMPRINTF_CALLED(dom->xch);
 
-    rc =3D arch_setup_meminit(dom);
+    rc =3D dom->arch_hooks->meminit(dom);
     if ( rc !=3D 0 )
     {
         xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index d306475..fbedf85 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -668,38 +668,6 @@ static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
 
 /* ------------------------------------------------------------------------ */
 
-static struct xc_dom_arch xc_dom_32_pae =3D {
-    .guest_type =3D "xen-3.0-x86_32p",
-    .native_protocol =3D XEN_IO_PROTO_ABI_X86_32,
-    .page_shift =3D PAGE_SHIFT_X86,
-    .sizeof_pfn =3D 4,
-    .alloc_magic_pages =3D alloc_magic_pages,
-    .count_pgtables =3D count_pgtables_x86_32_pae,
-    .setup_pgtables =3D setup_pgtables_x86_32_pae,
-    .start_info =3D start_info_x86_32,
-    .shared_info =3D shared_info_x86_32,
-    .vcpu =3D vcpu_x86_32,
-};
-
-static struct xc_dom_arch xc_dom_64 =3D {
-    .guest_type =3D "xen-3.0-x86_64",
-    .native_protocol =3D XEN_IO_PROTO_ABI_X86_64,
-    .page_shift =3D PAGE_SHIFT_X86,
-    .sizeof_pfn =3D 8,
-    .alloc_magic_pages =3D alloc_magic_pages,
-    .count_pgtables =3D count_pgtables_x86_64,
-    .setup_pgtables =3D setup_pgtables_x86_64,
-    .start_info =3D start_info_x86_64,
-    .shared_info =3D shared_info_x86_64,
-    .vcpu =3D vcpu_x86_64,
-};
-
-static void __init register_arch_hooks(void)
-{
-    xc_dom_register_arch_hooks(&xc_dom_32_pae);
-    xc_dom_register_arch_hooks(&xc_dom_64);
-}
-
 static int x86_compat(xc_interface *xch, domid_t domid, char *guest_type)
 {
     static const struct {
@@ -731,7 +699,6 @@ static int x86_compat(xc_interface *xch, domid_t domid, char *guest_type)
     return rc;
 }
 
-
 static int x86_shadow(xc_interface *xch, domid_t domid)
 {
     int rc, mode;
@@ -755,7 +722,7 @@ static int x86_shadow(xc_interface *xch, domid_t domid)
     return rc;
 }
 
-int arch_setup_meminit(struct xc_dom_image *dom)
+static int meminit_pv(struct xc_dom_image *dom)
 {
     int rc;
     xen_pfn_t pfn, allocsz, mfn, total, pfn_base;
@@ -1076,6 +1043,42 @@ int xc_dom_feature_translated(struct xc_dom_image *dom)
     return elf_xen_feature_get(XENFEAT_auto_translated_physmap, dom->f_active);
 }
 
+/* ------------------------------------------------------------------------ */
+
+static struct xc_dom_arch xc_dom_32_pae =3D {
+    .guest_type =3D "xen-3.0-x86_32p",
+    .native_protocol =3D XEN_IO_PROTO_ABI_X86_32,
+    .page_shift =3D PAGE_SHIFT_X86,
+    .sizeof_pfn =3D 4,
+    .alloc_magic_pages =3D alloc_magic_pages,
+    .count_pgtables =3D count_pgtables_x86_32_pae,
+    .setup_pgtables =3D setup_pgtables_x86_32_pae,
+    .start_info =3D start_info_x86_32,
+    .shared_info =3D shared_info_x86_32,
+    .vcpu =3D vcpu_x86_32,
+    .meminit =3D meminit_pv,
+};
+
+static struct xc_dom_arch xc_dom_64 =3D {
+    .guest_type =3D "xen-3.0-x86_64",
+    .native_protocol =3D XEN_IO_PROTO_ABI_X86_64,
+    .page_shift =3D PAGE_SHIFT_X86,
+    .sizeof_pfn =3D 8,
+    .alloc_magic_pages =3D alloc_magic_pages,
+    .count_pgtables =3D count_pgtables_x86_64,
+    .setup_pgtables =3D setup_pgtables_x86_64,
+    .start_info =3D start_info_x86_64,
+    .shared_info =3D shared_info_x86_64,
+    .vcpu =3D vcpu_x86_64,
+    .meminit =3D meminit_pv,
+};
+
+static void __init register_arch_hooks(void)
+{
+    xc_dom_register_arch_hooks(&xc_dom_32_pae);
+    xc_dom_register_arch_hooks(&xc_dom_64);
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1Gc-0001JT-8V; Mon, 19 Oct 2015 03:37:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ga-0001J7-MW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:44 +0000
Content-Length: 6059
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	87/29-10715-88564265; Mon, 19 Oct 2015 03:37:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1445225862!47956026!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30003 invoked from network); 19 Oct 2015 03:37:43 -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;
	19 Oct 2015 03:37:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GY-0005fW-2k
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GY-0004OO-0M
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:42 +0000
Date: Mon, 19 Oct 2015 03:37:42 +0000
Message-Id: <E1Zo1GY-0004OO-0M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: make arch_setup_boot{init/late}
	xc_dom_arch hooks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6749406768543923715=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6749406768543923715==
Content-Length: 5779
Content-Transfer-Encoding: quoted-printable

commit b4ec1faa91aeaa99e655d16549e2d830a38fb026
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:38 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:44 2015 +0100

    libxc: make arch_setup_boot{init/late} xc_dom_arch hooks
    
    This should not introduce any functional change.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Acked-by: Wei Liu <wei.liu2@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>
---
 tools/libxc/include/xc_dom.h |    7 ++-----
 tools/libxc/xc_dom_arm.c     |   20 +++++++++++++-------
 tools/libxc/xc_dom_boot.c    |    4 ++--
 tools/libxc/xc_dom_x86.c     |   10 ++++++++--
 4 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 01739fa..ced6ae2 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -220,6 +220,8 @@ struct xc_dom_arch {
     int (*start_info) (struct xc_dom_image * dom);
     int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
     int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
+    int (*bootearly) (struct xc_dom_image * dom);
+    int (*bootlate) (struct xc_dom_image * dom);
 
     /* arch-specific memory initialization. */
     int (*meminit) (struct xc_dom_image * dom);
@@ -399,11 +401,6 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
     return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
-/* --- arch bits --------------------------------------------------- */
-
-int arch_setup_bootearly(struct xc_dom_image *dom);
-int arch_setup_bootlate(struct xc_dom_image *dom);
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index e8a0756..ec3a757 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -489,13 +489,20 @@ static int meminit(struct xc_dom_image *dom)
     return 0;
 }
 
-int arch_setup_bootearly(struct xc_dom_image *dom)
+int xc_dom_feature_translated(struct xc_dom_image *dom)
+{
+    return 1;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int bootearly(struct xc_dom_image *dom)
 {
     DOMPRINTF("%s: doing nothing", __FUNCTION__);
     return 0;
 }
 
-int arch_setup_bootlate(struct xc_dom_image *dom)
+static int bootlate(struct xc_dom_image *dom)
 {
     /* XXX
      *   map shared info
@@ -505,11 +512,6 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
     return 0;
 }
 
-int xc_dom_feature_translated(struct xc_dom_image *dom)
-{
-    return 1;
-}
-
 /* ------------------------------------------------------------------------ */
 
 static struct xc_dom_arch xc_dom_32 =3D {
@@ -524,6 +526,8 @@ static struct xc_dom_arch xc_dom_32 =3D {
     .shared_info =3D shared_info_arm,
     .vcpu =3D vcpu_arm32,
     .meminit =3D meminit,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate,
 };
 
 static struct xc_dom_arch xc_dom_64 =3D {
@@ -538,6 +542,8 @@ static struct xc_dom_arch xc_dom_64 =3D {
     .shared_info =3D shared_info_arm,
     .vcpu =3D vcpu_arm64,
     .meminit =3D meminit,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate,
 };
 
 static void __init register_arch_hooks(void)
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index bf2cd7b..e6f7794 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -208,7 +208,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
     DOMPRINTF_CALLED(dom->xch);
 
     /* misc stuff*/
-    if ( (rc =3D arch_setup_bootearly(dom)) !=3D 0 )
+    if ( (rc =3D dom->arch_hooks->bootearly(dom)) !=3D 0 )
         return rc;
 
     /* collect some info */
@@ -255,7 +255,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
     xc_dom_log_memory_footprint(dom);
 
     /* misc x86 stuff */
-    if ( (rc =3D arch_setup_bootlate(dom)) !=3D 0 )
+    if ( (rc =3D dom->arch_hooks->bootlate(dom)) !=3D 0 )
         return rc;
 
     /* let the vm run */
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index fbedf85..b48dc1b 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -922,7 +922,9 @@ static int meminit_pv(struct xc_dom_image *dom)
     return rc;
 }
 
-int arch_setup_bootearly(struct xc_dom_image *dom)
+/* ------------------------------------------------------------------------ */
+
+static int bootearly(struct xc_dom_image *dom)
 {
     DOMPRINTF("%s: doing nothing", __FUNCTION__);
     return 0;
@@ -961,7 +963,7 @@ static int map_grant_table_frames(struct xc_dom_image *dom)
     return 0;
 }
 
-int arch_setup_bootlate(struct xc_dom_image *dom)
+static int bootlate_pv(struct xc_dom_image *dom)
 {
     static const struct {
         char *guest;
@@ -1057,6 +1059,8 @@ static struct xc_dom_arch xc_dom_32_pae =3D {
     .shared_info =3D shared_info_x86_32,
     .vcpu =3D vcpu_x86_32,
     .meminit =3D meminit_pv,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate_pv,
 };
 
 static struct xc_dom_arch xc_dom_64 =3D {
@@ -1071,6 +1075,8 @@ static struct xc_dom_arch xc_dom_64 =3D {
     .shared_info =3D shared_info_x86_64,
     .vcpu =3D vcpu_x86_64,
     .meminit =3D meminit_pv,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate_pv,
 };
 
 static void __init register_arch_hooks(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1Gc-0001JT-8V; Mon, 19 Oct 2015 03:37:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ga-0001J7-MW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:44 +0000
Content-Length: 6059
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	87/29-10715-88564265; Mon, 19 Oct 2015 03:37:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1445225862!47956026!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30003 invoked from network); 19 Oct 2015 03:37:43 -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;
	19 Oct 2015 03:37:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GY-0005fW-2k
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1GY-0004OO-0M
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:42 +0000
Date: Mon, 19 Oct 2015 03:37:42 +0000
Message-Id: <E1Zo1GY-0004OO-0M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: make arch_setup_boot{init/late}
	xc_dom_arch hooks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6749406768543923715=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6749406768543923715==
Content-Length: 5779
Content-Transfer-Encoding: quoted-printable

commit b4ec1faa91aeaa99e655d16549e2d830a38fb026
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:38 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:44 2015 +0100

    libxc: make arch_setup_boot{init/late} xc_dom_arch hooks
    
    This should not introduce any functional change.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Acked-by: Wei Liu <wei.liu2@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>
---
 tools/libxc/include/xc_dom.h |    7 ++-----
 tools/libxc/xc_dom_arm.c     |   20 +++++++++++++-------
 tools/libxc/xc_dom_boot.c    |    4 ++--
 tools/libxc/xc_dom_x86.c     |   10 ++++++++--
 4 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 01739fa..ced6ae2 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -220,6 +220,8 @@ struct xc_dom_arch {
     int (*start_info) (struct xc_dom_image * dom);
     int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
     int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
+    int (*bootearly) (struct xc_dom_image * dom);
+    int (*bootlate) (struct xc_dom_image * dom);
 
     /* arch-specific memory initialization. */
     int (*meminit) (struct xc_dom_image * dom);
@@ -399,11 +401,6 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
     return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
-/* --- arch bits --------------------------------------------------- */
-
-int arch_setup_bootearly(struct xc_dom_image *dom);
-int arch_setup_bootlate(struct xc_dom_image *dom);
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index e8a0756..ec3a757 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -489,13 +489,20 @@ static int meminit(struct xc_dom_image *dom)
     return 0;
 }
 
-int arch_setup_bootearly(struct xc_dom_image *dom)
+int xc_dom_feature_translated(struct xc_dom_image *dom)
+{
+    return 1;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int bootearly(struct xc_dom_image *dom)
 {
     DOMPRINTF("%s: doing nothing", __FUNCTION__);
     return 0;
 }
 
-int arch_setup_bootlate(struct xc_dom_image *dom)
+static int bootlate(struct xc_dom_image *dom)
 {
     /* XXX
      *   map shared info
@@ -505,11 +512,6 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
     return 0;
 }
 
-int xc_dom_feature_translated(struct xc_dom_image *dom)
-{
-    return 1;
-}
-
 /* ------------------------------------------------------------------------ */
 
 static struct xc_dom_arch xc_dom_32 =3D {
@@ -524,6 +526,8 @@ static struct xc_dom_arch xc_dom_32 =3D {
     .shared_info =3D shared_info_arm,
     .vcpu =3D vcpu_arm32,
     .meminit =3D meminit,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate,
 };
 
 static struct xc_dom_arch xc_dom_64 =3D {
@@ -538,6 +542,8 @@ static struct xc_dom_arch xc_dom_64 =3D {
     .shared_info =3D shared_info_arm,
     .vcpu =3D vcpu_arm64,
     .meminit =3D meminit,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate,
 };
 
 static void __init register_arch_hooks(void)
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index bf2cd7b..e6f7794 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -208,7 +208,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
     DOMPRINTF_CALLED(dom->xch);
 
     /* misc stuff*/
-    if ( (rc =3D arch_setup_bootearly(dom)) !=3D 0 )
+    if ( (rc =3D dom->arch_hooks->bootearly(dom)) !=3D 0 )
         return rc;
 
     /* collect some info */
@@ -255,7 +255,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
     xc_dom_log_memory_footprint(dom);
 
     /* misc x86 stuff */
-    if ( (rc =3D arch_setup_bootlate(dom)) !=3D 0 )
+    if ( (rc =3D dom->arch_hooks->bootlate(dom)) !=3D 0 )
         return rc;
 
     /* let the vm run */
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index fbedf85..b48dc1b 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -922,7 +922,9 @@ static int meminit_pv(struct xc_dom_image *dom)
     return rc;
 }
 
-int arch_setup_bootearly(struct xc_dom_image *dom)
+/* ------------------------------------------------------------------------ */
+
+static int bootearly(struct xc_dom_image *dom)
 {
     DOMPRINTF("%s: doing nothing", __FUNCTION__);
     return 0;
@@ -961,7 +963,7 @@ static int map_grant_table_frames(struct xc_dom_image *dom)
     return 0;
 }
 
-int arch_setup_bootlate(struct xc_dom_image *dom)
+static int bootlate_pv(struct xc_dom_image *dom)
 {
     static const struct {
         char *guest;
@@ -1057,6 +1059,8 @@ static struct xc_dom_arch xc_dom_32_pae =3D {
     .shared_info =3D shared_info_x86_32,
     .vcpu =3D vcpu_x86_32,
     .meminit =3D meminit_pv,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate_pv,
 };
 
 static struct xc_dom_arch xc_dom_64 =3D {
@@ -1071,6 +1075,8 @@ static struct xc_dom_arch xc_dom_64 =3D {
     .shared_info =3D shared_info_x86_64,
     .vcpu =3D vcpu_x86_64,
     .meminit =3D meminit_pv,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate_pv,
 };
 
 static void __init register_arch_hooks(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1Gm-0001Kz-BB; Mon, 19 Oct 2015 03:37:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gl-0001Ko-5k
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:55 +0000
Content-Length: 8874
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	94/3C-18886-29564265; Mon, 19 Oct 2015 03:37:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1445225872!59335857!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27315 invoked from network); 19 Oct 2015 03:37:53 -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;
	19 Oct 2015 03:37:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gi-0005fe-D7
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gi-0004Q2-Af
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:52 +0000
Date: Mon, 19 Oct 2015 03:37:52 +0000
Message-Id: <E1Zo1Gi-0004Q2-Af@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: rework BSP initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3079067575551790348=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3079067575551790348==
Content-Length: 8656
Content-Transfer-Encoding: quoted-printable

commit 5b921b49f08f9751100d8cb503a5dbc53de74886
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:39 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:44 2015 +0100

    libxc: rework BSP initialization
    
    Place the calls to xc_vcpu_setcontext and the allocation of the hypercall
    buffer into the arch-specific vcpu hooks. This is needed in order to
    introduce a new builder, so x86 HVM guests can initialize the BSP using
    XEN_DOMCTL_sethvmcontext instead of XEN_DOMCTL_setvcpucontext.
    
    This patch should not introduce any functional change.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/include/xc_dom.h |    2 +-
 tools/libxc/xc_dom_arm.c     |   26 +++++++++++++++++-----
 tools/libxc/xc_dom_boot.c    |   23 +-------------------
 tools/libxc/xc_dom_x86.c     |   48 +++++++++++++++++++++++++++--------------
 4 files changed, 53 insertions(+), 46 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index ced6ae2..2498cf7 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -219,7 +219,7 @@ struct xc_dom_arch {
     /* arch-specific data structs setup */
     int (*start_info) (struct xc_dom_image * dom);
     int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
-    int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
+    int (*vcpu) (struct xc_dom_image * dom);
     int (*bootearly) (struct xc_dom_image * dom);
     int (*bootlate) (struct xc_dom_image * dom);
 
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index ec3a757..397eef0 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -119,9 +119,11 @@ static int shared_info_arm(struct xc_dom_image *dom, void *ptr)
 
 /* ------------------------------------------------------------------------ */
 
-static int vcpu_arm32(struct xc_dom_image *dom, void *ptr)
+static int vcpu_arm32(struct xc_dom_image *dom)
 {
-    vcpu_guest_context_t *ctxt =3D ptr;
+    vcpu_guest_context_any_t any_ctx;
+    vcpu_guest_context_t *ctxt =3D &any_ctx.c;
+    int rc;
 
     DOMPRINTF_CALLED(dom->xch);
 
@@ -154,12 +156,19 @@ static int vcpu_arm32(struct xc_dom_image *dom, void *ptr)
     DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx32,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc32);
 
-    return 0;
+    rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __func__, rc);
+
+    return rc;
 }
 
-static int vcpu_arm64(struct xc_dom_image *dom, void *ptr)
+static int vcpu_arm64(struct xc_dom_image *dom)
 {
-    vcpu_guest_context_t *ctxt =3D ptr;
+    vcpu_guest_context_any_t any_ctx;
+    vcpu_guest_context_t *ctxt =3D &any_ctx.c;
+    int rc;
 
     DOMPRINTF_CALLED(dom->xch);
     /* clear everything */
@@ -189,7 +198,12 @@ static int vcpu_arm64(struct xc_dom_image *dom, void *ptr)
     DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx64,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc64);
 
-    return 0;
+    rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __func__, rc);
+
+    return rc;
 }
 
 /* ------------------------------------------------------------------------ */
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index e6f7794..791041b 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -62,19 +62,6 @@ static int setup_hypercall_page(struct xc_dom_image *dom)
     return rc;
 }
 
-static int launch_vm(xc_interface *xch, domid_t domid,
-                     vcpu_guest_context_any_t *ctxt)
-{
-    int rc;
-
-    xc_dom_printf(xch, "%s: called, ctxt=3D%p", __FUNCTION__, ctxt);
-    rc =3D xc_vcpu_setcontext(xch, domid, 0, ctxt);
-    if ( rc !=3D 0 )
-        xc_dom_panic(xch, XC_INTERNAL_ERROR,
-                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __FUNCTION__, rc);
-    return rc;
-}
-
 static int clear_page(struct xc_dom_image *dom, xen_pfn_t pfn)
 {
     xen_pfn_t dst;
@@ -197,14 +184,9 @@ void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
 
 int xc_dom_boot_image(struct xc_dom_image *dom)
 {
-    DECLARE_HYPERCALL_BUFFER(vcpu_guest_context_any_t, ctxt);
     xc_dominfo_t info;
     int rc;
 
-    ctxt =3D xc_hypercall_buffer_alloc(dom->xch, ctxt, sizeof(*ctxt));
-    if ( ctxt =3D=3D NULL )
-        return -1;
-
     DOMPRINTF_CALLED(dom->xch);
 
     /* misc stuff*/
@@ -259,13 +241,10 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
         return rc;
 
     /* let the vm run */
-    memset(ctxt, 0, sizeof(*ctxt));
-    if ( (rc =3D dom->arch_hooks->vcpu(dom, ctxt)) !=3D 0 )
+    if ( (rc =3D dom->arch_hooks->vcpu(dom)) !=3D 0 )
         return rc;
     xc_dom_unmap_all(dom);
-    rc =3D launch_vm(dom->xch, dom->guest_domid, ctxt);
 
-    xc_hypercall_buffer_free(dom->xch, ctxt);
     return rc;
 }
 
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index b48dc1b..ab88996 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -584,10 +584,12 @@ static int shared_info_x86_64(struct xc_dom_image *dom, void *ptr)
 
 /* ------------------------------------------------------------------------ */
 
-static int vcpu_x86_32(struct xc_dom_image *dom, void *ptr)
+static int vcpu_x86_32(struct xc_dom_image *dom)
 {
-    vcpu_guest_context_x86_32_t *ctxt =3D ptr;
+    vcpu_guest_context_any_t any_ctx;
+    vcpu_guest_context_x86_32_t *ctxt =3D &any_ctx.x32;
     xen_pfn_t cr3_pfn;
+    int rc;
 
     DOMPRINTF_CALLED(dom->xch);
 
@@ -611,26 +613,33 @@ static int vcpu_x86_32(struct xc_dom_image *dom, void *ptr)
     DOMPRINTF("%s: cr3: pfn 0x%" PRIpfn " mfn 0x%" PRIpfn "",
               __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn);
 
-    if ( dom->pvh_enabled )
-        return 0;
-
-    ctxt->user_regs.ds =3D FLAT_KERNEL_DS_X86_32;
-    ctxt->user_regs.es =3D FLAT_KERNEL_DS_X86_32;
-    ctxt->user_regs.fs =3D FLAT_KERNEL_DS_X86_32;
-    ctxt->user_regs.gs =3D FLAT_KERNEL_DS_X86_32;
-    ctxt->user_regs.ss =3D FLAT_KERNEL_SS_X86_32;
-    ctxt->user_regs.cs =3D FLAT_KERNEL_CS_X86_32;
+    if ( !dom->pvh_enabled )
+    {
+        ctxt->user_regs.ds =3D FLAT_KERNEL_DS_X86_32;
+        ctxt->user_regs.es =3D FLAT_KERNEL_DS_X86_32;
+        ctxt->user_regs.fs =3D FLAT_KERNEL_DS_X86_32;
+        ctxt->user_regs.gs =3D FLAT_KERNEL_DS_X86_32;
+        ctxt->user_regs.ss =3D FLAT_KERNEL_SS_X86_32;
+        ctxt->user_regs.cs =3D FLAT_KERNEL_CS_X86_32;
+
+        ctxt->kernel_ss =3D ctxt->user_regs.ss;
+        ctxt->kernel_sp =3D ctxt->user_regs.esp;
+    }
 
-    ctxt->kernel_ss =3D ctxt->user_regs.ss;
-    ctxt->kernel_sp =3D ctxt->user_regs.esp;
+    rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __func__, rc);
 
-    return 0;
+    return rc;
 }
 
-static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
+static int vcpu_x86_64(struct xc_dom_image *dom)
 {
-    vcpu_guest_context_x86_64_t *ctxt =3D ptr;
+    vcpu_guest_context_any_t any_ctx;
+    vcpu_guest_context_x86_64_t *ctxt =3D &any_ctx.x64;
     xen_pfn_t cr3_pfn;
+    int rc;
 
     DOMPRINTF_CALLED(dom->xch);
 
@@ -663,7 +672,12 @@ static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
     ctxt->kernel_ss =3D ctxt->user_regs.ss;
     ctxt->kernel_sp =3D ctxt->user_regs.esp;
 
-    return 0;
+    rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __func__, rc);
+
+    return rc;
 }
 
 /* ------------------------------------------------------------------------ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:37:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:37: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 1Zo1Gm-0001Kz-BB; Mon, 19 Oct 2015 03:37:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gl-0001Ko-5k
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:55 +0000
Content-Length: 8874
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	94/3C-18886-29564265; Mon, 19 Oct 2015 03:37:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1445225872!59335857!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27315 invoked from network); 19 Oct 2015 03:37:53 -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;
	19 Oct 2015 03:37:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gi-0005fe-D7
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gi-0004Q2-Af
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:37:52 +0000
Date: Mon, 19 Oct 2015 03:37:52 +0000
Message-Id: <E1Zo1Gi-0004Q2-Af@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: rework BSP initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3079067575551790348=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3079067575551790348==
Content-Length: 8656
Content-Transfer-Encoding: quoted-printable

commit 5b921b49f08f9751100d8cb503a5dbc53de74886
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:39 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:44 2015 +0100

    libxc: rework BSP initialization
    
    Place the calls to xc_vcpu_setcontext and the allocation of the hypercall
    buffer into the arch-specific vcpu hooks. This is needed in order to
    introduce a new builder, so x86 HVM guests can initialize the BSP using
    XEN_DOMCTL_sethvmcontext instead of XEN_DOMCTL_setvcpucontext.
    
    This patch should not introduce any functional change.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/include/xc_dom.h |    2 +-
 tools/libxc/xc_dom_arm.c     |   26 +++++++++++++++++-----
 tools/libxc/xc_dom_boot.c    |   23 +-------------------
 tools/libxc/xc_dom_x86.c     |   48 +++++++++++++++++++++++++++--------------
 4 files changed, 53 insertions(+), 46 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index ced6ae2..2498cf7 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -219,7 +219,7 @@ struct xc_dom_arch {
     /* arch-specific data structs setup */
     int (*start_info) (struct xc_dom_image * dom);
     int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
-    int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
+    int (*vcpu) (struct xc_dom_image * dom);
     int (*bootearly) (struct xc_dom_image * dom);
     int (*bootlate) (struct xc_dom_image * dom);
 
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index ec3a757..397eef0 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -119,9 +119,11 @@ static int shared_info_arm(struct xc_dom_image *dom, void *ptr)
 
 /* ------------------------------------------------------------------------ */
 
-static int vcpu_arm32(struct xc_dom_image *dom, void *ptr)
+static int vcpu_arm32(struct xc_dom_image *dom)
 {
-    vcpu_guest_context_t *ctxt =3D ptr;
+    vcpu_guest_context_any_t any_ctx;
+    vcpu_guest_context_t *ctxt =3D &any_ctx.c;
+    int rc;
 
     DOMPRINTF_CALLED(dom->xch);
 
@@ -154,12 +156,19 @@ static int vcpu_arm32(struct xc_dom_image *dom, void *ptr)
     DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx32,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc32);
 
-    return 0;
+    rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __func__, rc);
+
+    return rc;
 }
 
-static int vcpu_arm64(struct xc_dom_image *dom, void *ptr)
+static int vcpu_arm64(struct xc_dom_image *dom)
 {
-    vcpu_guest_context_t *ctxt =3D ptr;
+    vcpu_guest_context_any_t any_ctx;
+    vcpu_guest_context_t *ctxt =3D &any_ctx.c;
+    int rc;
 
     DOMPRINTF_CALLED(dom->xch);
     /* clear everything */
@@ -189,7 +198,12 @@ static int vcpu_arm64(struct xc_dom_image *dom, void *ptr)
     DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx64,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc64);
 
-    return 0;
+    rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __func__, rc);
+
+    return rc;
 }
 
 /* ------------------------------------------------------------------------ */
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index e6f7794..791041b 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -62,19 +62,6 @@ static int setup_hypercall_page(struct xc_dom_image *dom)
     return rc;
 }
 
-static int launch_vm(xc_interface *xch, domid_t domid,
-                     vcpu_guest_context_any_t *ctxt)
-{
-    int rc;
-
-    xc_dom_printf(xch, "%s: called, ctxt=3D%p", __FUNCTION__, ctxt);
-    rc =3D xc_vcpu_setcontext(xch, domid, 0, ctxt);
-    if ( rc !=3D 0 )
-        xc_dom_panic(xch, XC_INTERNAL_ERROR,
-                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __FUNCTION__, rc);
-    return rc;
-}
-
 static int clear_page(struct xc_dom_image *dom, xen_pfn_t pfn)
 {
     xen_pfn_t dst;
@@ -197,14 +184,9 @@ void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
 
 int xc_dom_boot_image(struct xc_dom_image *dom)
 {
-    DECLARE_HYPERCALL_BUFFER(vcpu_guest_context_any_t, ctxt);
     xc_dominfo_t info;
     int rc;
 
-    ctxt =3D xc_hypercall_buffer_alloc(dom->xch, ctxt, sizeof(*ctxt));
-    if ( ctxt =3D=3D NULL )
-        return -1;
-
     DOMPRINTF_CALLED(dom->xch);
 
     /* misc stuff*/
@@ -259,13 +241,10 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
         return rc;
 
     /* let the vm run */
-    memset(ctxt, 0, sizeof(*ctxt));
-    if ( (rc =3D dom->arch_hooks->vcpu(dom, ctxt)) !=3D 0 )
+    if ( (rc =3D dom->arch_hooks->vcpu(dom)) !=3D 0 )
         return rc;
     xc_dom_unmap_all(dom);
-    rc =3D launch_vm(dom->xch, dom->guest_domid, ctxt);
 
-    xc_hypercall_buffer_free(dom->xch, ctxt);
     return rc;
 }
 
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index b48dc1b..ab88996 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -584,10 +584,12 @@ static int shared_info_x86_64(struct xc_dom_image *dom, void *ptr)
 
 /* ------------------------------------------------------------------------ */
 
-static int vcpu_x86_32(struct xc_dom_image *dom, void *ptr)
+static int vcpu_x86_32(struct xc_dom_image *dom)
 {
-    vcpu_guest_context_x86_32_t *ctxt =3D ptr;
+    vcpu_guest_context_any_t any_ctx;
+    vcpu_guest_context_x86_32_t *ctxt =3D &any_ctx.x32;
     xen_pfn_t cr3_pfn;
+    int rc;
 
     DOMPRINTF_CALLED(dom->xch);
 
@@ -611,26 +613,33 @@ static int vcpu_x86_32(struct xc_dom_image *dom, void *ptr)
     DOMPRINTF("%s: cr3: pfn 0x%" PRIpfn " mfn 0x%" PRIpfn "",
               __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn);
 
-    if ( dom->pvh_enabled )
-        return 0;
-
-    ctxt->user_regs.ds =3D FLAT_KERNEL_DS_X86_32;
-    ctxt->user_regs.es =3D FLAT_KERNEL_DS_X86_32;
-    ctxt->user_regs.fs =3D FLAT_KERNEL_DS_X86_32;
-    ctxt->user_regs.gs =3D FLAT_KERNEL_DS_X86_32;
-    ctxt->user_regs.ss =3D FLAT_KERNEL_SS_X86_32;
-    ctxt->user_regs.cs =3D FLAT_KERNEL_CS_X86_32;
+    if ( !dom->pvh_enabled )
+    {
+        ctxt->user_regs.ds =3D FLAT_KERNEL_DS_X86_32;
+        ctxt->user_regs.es =3D FLAT_KERNEL_DS_X86_32;
+        ctxt->user_regs.fs =3D FLAT_KERNEL_DS_X86_32;
+        ctxt->user_regs.gs =3D FLAT_KERNEL_DS_X86_32;
+        ctxt->user_regs.ss =3D FLAT_KERNEL_SS_X86_32;
+        ctxt->user_regs.cs =3D FLAT_KERNEL_CS_X86_32;
+
+        ctxt->kernel_ss =3D ctxt->user_regs.ss;
+        ctxt->kernel_sp =3D ctxt->user_regs.esp;
+    }
 
-    ctxt->kernel_ss =3D ctxt->user_regs.ss;
-    ctxt->kernel_sp =3D ctxt->user_regs.esp;
+    rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __func__, rc);
 
-    return 0;
+    return rc;
 }
 
-static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
+static int vcpu_x86_64(struct xc_dom_image *dom)
 {
-    vcpu_guest_context_x86_64_t *ctxt =3D ptr;
+    vcpu_guest_context_any_t any_ctx;
+    vcpu_guest_context_x86_64_t *ctxt =3D &any_ctx.x64;
     xen_pfn_t cr3_pfn;
+    int rc;
 
     DOMPRINTF_CALLED(dom->xch);
 
@@ -663,7 +672,12 @@ static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
     ctxt->kernel_ss =3D ctxt->user_regs.ss;
     ctxt->kernel_sp =3D ctxt->user_regs.esp;
 
-    return 0;
+    rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETVCPUCONTEXT failed (rc=3D%d)", __func__, rc);
+
+    return rc;
 }
 
 /* ------------------------------------------------------------------------ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1Gy-0001Mj-E3; Mon, 19 Oct 2015 03:38:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gw-0001MR-9e
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:06 +0000
Content-Length: 27923
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	71/BC-16618-D9564265; Mon, 19 Oct 2015 03:38:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1445225882!26492730!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30824 invoked from network); 19 Oct 2015 03:38:03 -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;
	19 Oct 2015 03:38:03 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gs-0005gF-OK
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gs-0004Qv-Jo
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:02 +0000
Date: Mon, 19 Oct 2015 03:38:02 +0000
Message-Id: <E1Zo1Gs-0004Qv-Jo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce a xc_dom_arch for
	hvm-3.0-x86_32 guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5072794958439774453=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5072794958439774453==
Content-Length: 28228
Content-Transfer-Encoding: quoted-printable

commit 68e1183411be71a8daa71b8abdd1f4fb843eb28a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:40 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:44 2015 +0100

    libxc: introduce a xc_dom_arch for hvm-3.0-x86_32 guests
    
    This xc_dom_arch will be used in order to build HVM domains. The code is
    based on the existing xc_hvm_populate_memory and xc_hvm_populate_params
    functions.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/include/xc_dom.h |    6 +
 tools/libxc/xc_dom_x86.c     |  618 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 613 insertions(+), 11 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 2498cf7..e52b023 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -186,6 +186,12 @@ struct xc_dom_image {
     } container_type;
 
     /* HVM specific fields. */
+    xen_pfn_t target_pages;
+    xen_pfn_t mmio_start;
+    xen_pfn_t mmio_size;
+    xen_pfn_t lowmem_end;
+    xen_pfn_t highmem_end;
+
     /* Extra ACPI tables passed to HVMLOADER */
     struct xc_hvm_firmware_module acpi_module;
 
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index ab88996..dd331bf 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -39,10 +39,32 @@
 
 /* ------------------------------------------------------------------------ */
 
-#define SUPERPAGE_PFN_SHIFT  9
-#define SUPERPAGE_NR_PFNS    (1UL << SUPERPAGE_PFN_SHIFT)
 #define SUPERPAGE_BATCH_SIZE 512
 
+#define SUPERPAGE_2MB_SHIFT   9
+#define SUPERPAGE_2MB_NR_PFNS (1UL << SUPERPAGE_2MB_SHIFT)
+#define SUPERPAGE_1GB_SHIFT   18
+#define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
+
+#define X86_CR0_PE 0x01
+#define X86_CR0_ET 0x10
+
+#define VGA_HOLE_SIZE (0x20)
+
+#define SPECIALPAGE_PAGING   0
+#define SPECIALPAGE_ACCESS   1
+#define SPECIALPAGE_SHARING  2
+#define SPECIALPAGE_BUFIOREQ 3
+#define SPECIALPAGE_XENSTORE 4
+#define SPECIALPAGE_IOREQ    5
+#define SPECIALPAGE_IDENT_PT 6
+#define SPECIALPAGE_CONSOLE  7
+#define NR_SPECIAL_PAGES     8
+#define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
+
+#define NR_IOREQ_SERVER_PAGES 8
+#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
+
 #define bits_to_mask(bits)       (((xen_vaddr_t)1 << (bits))-1)
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
@@ -462,6 +484,135 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
     return 0;
 }
 
+static void build_hvm_info(void *hvm_info_page, struct xc_dom_image *dom)
+{
+    struct hvm_info_table *hvm_info =3D (struct hvm_info_table *)
+        (((unsigned char *)hvm_info_page) + HVM_INFO_OFFSET);
+    uint8_t sum;
+    int i;
+
+    memset(hvm_info_page, 0, PAGE_SIZE);
+
+    /* Fill in the header. */
+    memcpy(hvm_info->signature, "HVM INFO", sizeof(hvm_info->signature));
+    hvm_info->length =3D sizeof(struct hvm_info_table);
+
+    /* Sensible defaults: these can be overridden by the caller. */
+    hvm_info->apic_mode =3D 1;
+    hvm_info->nr_vcpus =3D 1;
+    memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online));
+
+    /* Memory parameters. */
+    hvm_info->low_mem_pgend =3D dom->lowmem_end >> PAGE_SHIFT;
+    hvm_info->high_mem_pgend =3D dom->highmem_end >> PAGE_SHIFT;
+    hvm_info->reserved_mem_pgstart =3D ioreq_server_pfn(0);
+
+    /* Finish with the checksum. */
+    for ( i =3D 0, sum =3D 0; i < hvm_info->length; i++ )
+        sum +=3D ((uint8_t *)hvm_info)[i];
+    hvm_info->checksum =3D -sum;
+}
+
+static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
+{
+    unsigned long i;
+    void *hvm_info_page;
+    uint32_t *ident_pt, domid =3D dom->guest_domid;
+    int rc;
+    xen_pfn_t special_array[NR_SPECIAL_PAGES];
+    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
+    xc_interface *xch =3D dom->xch;
+
+    if ( (hvm_info_page =3D xc_map_foreign_range(
+              xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+              HVM_INFO_PFN)) =3D=3D NULL )
+        goto error_out;
+    build_hvm_info(hvm_info_page, dom);
+    munmap(hvm_info_page, PAGE_SIZE);
+
+    /* Allocate and clear special pages. */
+    for ( i =3D 0; i < NR_SPECIAL_PAGES; i++ )
+        special_array[i] =3D special_pfn(i);
+
+    rc =3D xc_domain_populate_physmap_exact(xch, domid, NR_SPECIAL_PAGES, 0, 0,
+                                          special_array);
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("Could not allocate special pages.");
+        goto error_out;
+    }
+
+    if ( xc_clear_domain_pages(xch, domid, special_pfn(0), NR_SPECIAL_PAGES) )
+            goto error_out;
+
+    xc_hvm_param_set(xch, domid, HVM_PARAM_STORE_PFN,
+                     special_pfn(SPECIALPAGE_XENSTORE));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_BUFIOREQ_PFN,
+                     special_pfn(SPECIALPAGE_BUFIOREQ));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_IOREQ_PFN,
+                     special_pfn(SPECIALPAGE_IOREQ));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_CONSOLE_PFN,
+                     special_pfn(SPECIALPAGE_CONSOLE));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_PAGING_RING_PFN,
+                     special_pfn(SPECIALPAGE_PAGING));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_MONITOR_RING_PFN,
+                     special_pfn(SPECIALPAGE_ACCESS));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_SHARING_RING_PFN,
+                     special_pfn(SPECIALPAGE_SHARING));
+
+    /*
+     * Allocate and clear additional ioreq server pages. The default
+     * server will use the IOREQ and BUFIOREQ special pages above.
+     */
+    for ( i =3D 0; i < NR_IOREQ_SERVER_PAGES; i++ )
+        ioreq_server_array[i] =3D ioreq_server_pfn(i);
+
+    rc =3D xc_domain_populate_physmap_exact(xch, domid, NR_IOREQ_SERVER_PAGES, 0,
+                                          0, ioreq_server_array);
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("Could not allocate ioreq server pages.");
+        goto error_out;
+    }
+
+    if ( xc_clear_domain_pages(xch, domid, ioreq_server_pfn(0),
+                               NR_IOREQ_SERVER_PAGES) )
+            goto error_out;
+
+    /* Tell the domain where the pages are and how many there are */
+    xc_hvm_param_set(xch, domid, HVM_PARAM_IOREQ_SERVER_PFN,
+                     ioreq_server_pfn(0));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
+                     NR_IOREQ_SERVER_PAGES);
+
+    /*
+     * Identity-map page table is required for running with CR0.PG=3D0 when
+     * using Intel EPT. Create a 32-bit non-PAE page directory of superpages.
+     */
+    if ( (ident_pt =3D xc_map_foreign_range(
+              xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+              special_pfn(SPECIALPAGE_IDENT_PT))) =3D=3D NULL )
+        goto error_out;
+    for ( i =3D 0; i < PAGE_SIZE / sizeof(*ident_pt); i++ )
+        ident_pt[i] =3D ((i << 22) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER |
+                       _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE);
+    munmap(ident_pt, PAGE_SIZE);
+    xc_hvm_param_set(xch, domid, HVM_PARAM_IDENT_PT,
+                     special_pfn(SPECIALPAGE_IDENT_PT) << PAGE_SHIFT);
+
+    dom->console_pfn =3D special_pfn(SPECIALPAGE_CONSOLE);
+    dom->xenstore_pfn =3D special_pfn(SPECIALPAGE_XENSTORE);
+    dom->parms.virt_hypercall =3D -1;
+
+    rc =3D 0;
+    goto out;
+ error_out:
+    rc =3D -1;
+ out:
+
+    return rc;
+}
+
 /* ------------------------------------------------------------------------ */
 
 static int start_info_x86_32(struct xc_dom_image *dom)
@@ -680,6 +831,102 @@ static int vcpu_x86_64(struct xc_dom_image *dom)
     return rc;
 }
 
+static int vcpu_hvm(struct xc_dom_image *dom)
+{
+    struct {
+        struct hvm_save_descriptor header_d;
+        HVM_SAVE_TYPE(HEADER) header;
+        struct hvm_save_descriptor cpu_d;
+        HVM_SAVE_TYPE(CPU) cpu;
+        struct hvm_save_descriptor end_d;
+        HVM_SAVE_TYPE(END) end;
+    } bsp_ctx;
+    uint8_t *full_ctx =3D NULL;
+    int rc;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    /*
+     * Get the full HVM context in order to have the header, it is not
+     * possible to get the header with getcontext_partial, and crafting one
+     * from userspace is also not an option since cpuid is trapped and
+     * modified by Xen.
+     */
+
+    rc =3D xc_domain_hvm_getcontext(dom->xch, dom->guest_domid, NULL, 0);
+    if ( rc <=3D 0 )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: unable to fetch HVM context size (rc=3D%d)",
+                     __func__, rc);
+        goto out;
+    }
+
+    full_ctx =3D calloc(1, rc);
+    if ( full_ctx =3D=3D NULL )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: unable to allocate memory for HVM context (rc=3D%d)",
+                     __func__, rc);
+        rc =3D -ENOMEM;
+        goto out;
+    }
+
+    rc =3D xc_domain_hvm_getcontext(dom->xch, dom->guest_domid, full_ctx, rc);
+    if ( rc <=3D 0 )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: unable to fetch HVM context (rc=3D%d)",
+                     __func__, rc);
+        goto out;
+    }
+
+    /* Copy the header to our partial context. */
+    memset(&bsp_ctx, 0, sizeof(bsp_ctx));
+    memcpy(&bsp_ctx, full_ctx,
+           sizeof(struct hvm_save_descriptor) + HVM_SAVE_LENGTH(HEADER));
+
+    /* Set the CPU descriptor. */
+    bsp_ctx.cpu_d.typecode =3D HVM_SAVE_CODE(CPU);
+    bsp_ctx.cpu_d.instance =3D 0;
+    bsp_ctx.cpu_d.length =3D HVM_SAVE_LENGTH(CPU);
+
+    /* Set the cached part of the relevant segment registers. */
+    bsp_ctx.cpu.cs_base =3D 0;
+    bsp_ctx.cpu.ds_base =3D 0;
+    bsp_ctx.cpu.ss_base =3D 0;
+    bsp_ctx.cpu.tr_base =3D 0;
+    bsp_ctx.cpu.cs_limit =3D ~0u;
+    bsp_ctx.cpu.ds_limit =3D ~0u;
+    bsp_ctx.cpu.ss_limit =3D ~0u;
+    bsp_ctx.cpu.tr_limit =3D 0x67;
+    bsp_ctx.cpu.cs_arbytes =3D 0xc9b;
+    bsp_ctx.cpu.ds_arbytes =3D 0xc93;
+    bsp_ctx.cpu.ss_arbytes =3D 0xc93;
+    bsp_ctx.cpu.tr_arbytes =3D 0x8b;
+
+    /* Set the control registers. */
+    bsp_ctx.cpu.cr0 =3D X86_CR0_PE | X86_CR0_ET;
+
+    /* Set the IP. */
+    bsp_ctx.cpu.rip =3D dom->parms.phys_entry;
+
+    /* Set the end descriptor. */
+    bsp_ctx.end_d.typecode =3D HVM_SAVE_CODE(END);
+    bsp_ctx.end_d.instance =3D 0;
+    bsp_ctx.end_d.length =3D HVM_SAVE_LENGTH(END);
+
+    rc =3D xc_domain_hvm_setcontext(dom->xch, dom->guest_domid,
+                                  (uint8_t *)&bsp_ctx, sizeof(bsp_ctx));
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETHVMCONTEXT failed (rc=3D%d)", __func__, rc);
+
+ out:
+    free(full_ctx);
+    return rc;
+}
+
 /* ------------------------------------------------------------------------ */
 
 static int x86_compat(xc_interface *xch, domid_t domid, char *guest_type)
@@ -760,7 +1007,7 @@ static int meminit_pv(struct xc_dom_image *dom)
 
     if ( dom->superpages )
     {
-        int count =3D dom->total_pages >> SUPERPAGE_PFN_SHIFT;
+        int count =3D dom->total_pages >> SUPERPAGE_2MB_SHIFT;
         xen_pfn_t extents[count];
 
         dom->p2m_size =3D dom->total_pages;
@@ -771,9 +1018,9 @@ static int meminit_pv(struct xc_dom_image *dom)
 
         DOMPRINTF("Populating memory with %d superpages", count);
         for ( pfn =3D 0; pfn < count; pfn++ )
-            extents[pfn] =3D pfn << SUPERPAGE_PFN_SHIFT;
+            extents[pfn] =3D pfn << SUPERPAGE_2MB_SHIFT;
         rc =3D xc_domain_populate_physmap_exact(dom->xch, dom->guest_domid,
-                                               count, SUPERPAGE_PFN_SHIFT, 0,
+                                               count, SUPERPAGE_2MB_SHIFT, 0,
                                                extents);
         if ( rc )
             return rc;
@@ -783,7 +1030,7 @@ static int meminit_pv(struct xc_dom_image *dom)
         for ( i =3D 0; i < count; i++ )
         {
             mfn =3D extents[i];
-            for ( j =3D 0; j < SUPERPAGE_NR_PFNS; j++, pfn++ )
+            for ( j =3D 0; j < SUPERPAGE_2MB_NR_PFNS; j++, pfn++ )
                 dom->p2m_host[pfn] =3D mfn + j;
         }
     }
@@ -868,7 +1115,7 @@ static int meminit_pv(struct xc_dom_image *dom)
 
             pages =3D (vmemranges[i].end - vmemranges[i].start)
                 >> PAGE_SHIFT;
-            super_pages =3D pages >> SUPERPAGE_PFN_SHIFT;
+            super_pages =3D pages >> SUPERPAGE_2MB_SHIFT;
             pfn_base =3D vmemranges[i].start >> PAGE_SHIFT;
 
             for ( pfn =3D pfn_base; pfn < pfn_base+pages; pfn++ )
@@ -881,11 +1128,11 @@ static int meminit_pv(struct xc_dom_image *dom)
                 super_pages -=3D count;
 
                 for ( pfn =3D pfn_base_idx, j =3D 0;
-                      pfn < pfn_base_idx + (count << SUPERPAGE_PFN_SHIFT);
-                      pfn +=3D SUPERPAGE_NR_PFNS, j++ )
+                      pfn < pfn_base_idx + (count << SUPERPAGE_2MB_SHIFT);
+                      pfn +=3D SUPERPAGE_2MB_NR_PFNS, j++ )
                     extents[j] =3D dom->p2m_host[pfn];
                 rc =3D xc_domain_populate_physmap(dom->xch, dom->guest_domid, count,
-                                                SUPERPAGE_PFN_SHIFT, memflags,
+                                                SUPERPAGE_2MB_SHIFT, memflags,
                                                 extents);
                 if ( rc < 0 )
                     return rc;
@@ -895,7 +1142,7 @@ static int meminit_pv(struct xc_dom_image *dom)
                 for ( j =3D 0; j < rc; j++ )
                 {
                     mfn =3D extents[j];
-                    for ( k =3D 0; k < SUPERPAGE_NR_PFNS; k++, pfn++ )
+                    for ( k =3D 0; k < SUPERPAGE_2MB_NR_PFNS; k++, pfn++ )
                         dom->p2m_host[pfn] =3D mfn + k;
                 }
                 pfn_base_idx =3D pfn;
@@ -936,6 +1183,332 @@ static int meminit_pv(struct xc_dom_image *dom)
     return rc;
 }
 
+/*
+ * Check whether there exists mmio hole in the specified memory range.
+ * Returns 1 if exists, else returns 0.
+ */
+static int check_mmio_hole(uint64_t start, uint64_t memsize,
+                           uint64_t mmio_start, uint64_t mmio_size)
+{
+    if ( start + memsize <=3D mmio_start || start >=3D mmio_start + mmio_size )
+        return 0;
+    else
+        return 1;
+}
+
+static int meminit_hvm(struct xc_dom_image *dom)
+{
+    unsigned long i, vmemid, nr_pages =3D dom->total_pages;
+    unsigned long p2m_size;
+    unsigned long target_pages =3D dom->target_pages;
+    unsigned long cur_pages, cur_pfn;
+    int rc;
+    xen_capabilities_info_t caps;
+    unsigned long stat_normal_pages =3D 0, stat_2mb_pages =3D 0, 
+        stat_1gb_pages =3D 0;
+    unsigned int memflags =3D 0;
+    int claim_enabled =3D dom->claim_enabled;
+    uint64_t total_pages;
+    xen_vmemrange_t dummy_vmemrange[2];
+    unsigned int dummy_vnode_to_pnode[1];
+    xen_vmemrange_t *vmemranges;
+    unsigned int *vnode_to_pnode;
+    unsigned int nr_vmemranges, nr_vnodes;
+    xc_interface *xch =3D dom->xch;
+    uint32_t domid =3D dom->guest_domid;
+
+    if ( nr_pages > target_pages )
+        memflags |=3D XENMEMF_populate_on_demand;
+
+    if ( dom->nr_vmemranges =3D=3D 0 )
+    {
+        /* Build dummy vnode information
+         *
+         * Guest physical address space layout:
+         * [0, hole_start) [hole_start, 4G) [4G, highmem_end)
+         *
+         * Of course if there is no high memory, the second vmemrange
+         * has no effect on the actual result.
+         */
+
+        dummy_vmemrange[0].start =3D 0;
+        dummy_vmemrange[0].end   =3D dom->lowmem_end;
+        dummy_vmemrange[0].flags =3D 0;
+        dummy_vmemrange[0].nid   =3D 0;
+        nr_vmemranges =3D 1;
+
+        if ( dom->highmem_end > (1ULL << 32) )
+        {
+            dummy_vmemrange[1].start =3D 1ULL << 32;
+            dummy_vmemrange[1].end   =3D dom->highmem_end;
+            dummy_vmemrange[1].flags =3D 0;
+            dummy_vmemrange[1].nid   =3D 0;
+
+            nr_vmemranges++;
+        }
+
+        dummy_vnode_to_pnode[0] =3D XC_NUMA_NO_NODE;
+        nr_vnodes =3D 1;
+        vmemranges =3D dummy_vmemrange;
+        vnode_to_pnode =3D dummy_vnode_to_pnode;
+    }
+    else
+    {
+        if ( nr_pages > target_pages )
+        {
+            DOMPRINTF("Cannot enable vNUMA and PoD at the same time");
+            goto error_out;
+        }
+
+        nr_vmemranges =3D dom->nr_vmemranges;
+        nr_vnodes =3D dom->nr_vnodes;
+        vmemranges =3D dom->vmemranges;
+        vnode_to_pnode =3D dom->vnode_to_pnode;
+    }
+
+    total_pages =3D 0;
+    p2m_size =3D 0;
+    for ( i =3D 0; i < nr_vmemranges; i++ )
+    {
+        total_pages +=3D ((vmemranges[i].end - vmemranges[i].start)
+                        >> PAGE_SHIFT);
+        p2m_size =3D p2m_size > (vmemranges[i].end >> PAGE_SHIFT) =3F
+            p2m_size : (vmemranges[i].end >> PAGE_SHIFT);
+    }
+
+    if ( total_pages !=3D nr_pages )
+    {
+        DOMPRINTF("vNUMA memory pages mismatch (0x%"PRIx64" !=3D 0x%lx)",
+               total_pages, nr_pages);
+        goto error_out;
+    }
+
+    if ( xc_version(xch, XENVER_capabilities, &caps) !=3D 0 )
+    {
+        DOMPRINTF("Could not get Xen capabilities");
+        goto error_out;
+    }
+
+    dom->p2m_size =3D p2m_size;
+    dom->p2m_host =3D xc_dom_malloc(dom, sizeof(xen_pfn_t) *
+                                      dom->p2m_size);
+    if ( dom->p2m_host =3D=3D NULL )
+    {
+        DOMPRINTF("Could not allocate p2m");
+        goto error_out;
+    }
+
+    for ( i =3D 0; i < p2m_size; i++ )
+        dom->p2m_host[i] =3D ((xen_pfn_t)-1);
+    for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
+    {
+        uint64_t pfn;
+
+        for ( pfn =3D vmemranges[vmemid].start >> PAGE_SHIFT;
+              pfn < vmemranges[vmemid].end >> PAGE_SHIFT;
+              pfn++ )
+            dom->p2m_host[pfn] =3D pfn;
+    }
+
+    /*
+     * Try to claim pages for early warning of insufficient memory available.
+     * This should go before xc_domain_set_pod_target, becuase that function
+     * actually allocates memory for the guest. Claiming after memory has been
+     * allocated is pointless.
+     */
+    if ( claim_enabled ) {
+        rc =3D xc_domain_claim_pages(xch, domid, target_pages - VGA_HOLE_SIZE);
+        if ( rc !=3D 0 )
+        {
+            DOMPRINTF("Could not allocate memory for HVM guest as we cannot claim memory!");
+            goto error_out;
+        }
+    }
+
+    if ( memflags & XENMEMF_populate_on_demand )
+    {
+        /*
+         * Subtract VGA_HOLE_SIZE from target_pages for the VGA
+         * "hole".  Xen will adjust the PoD cache size so that domain
+         * tot_pages will be target_pages - VGA_HOLE_SIZE after
+         * this call.
+         */
+        rc =3D xc_domain_set_pod_target(xch, domid, target_pages - VGA_HOLE_SIZE,
+                                      NULL, NULL, NULL);
+        if ( rc !=3D 0 )
+        {
+            DOMPRINTF("Could not set PoD target for HVM guest.\n");
+            goto error_out;
+        }
+    }
+
+    /*
+     * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
+     *
+     * We attempt to allocate 1GB pages if possible. It falls back on 2MB
+     * pages if 1GB allocation fails. 4KB pages will be used eventually if
+     * both fail.
+     * 
+     * Under 2MB mode, we allocate pages in batches of no more than 8MB to 
+     * ensure that we can be preempted and hence dom0 remains responsive.
+     */
+    rc =3D xc_domain_populate_physmap_exact(
+        xch, domid, 0xa0, 0, memflags, &dom->p2m_host[0x00]);
+
+    stat_normal_pages =3D 0;
+    for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
+    {
+        unsigned int new_memflags =3D memflags;
+        uint64_t end_pages;
+        unsigned int vnode =3D vmemranges[vmemid].nid;
+        unsigned int pnode =3D vnode_to_pnode[vnode];
+
+        if ( pnode !=3D XC_NUMA_NO_NODE )
+            new_memflags |=3D XENMEMF_exact_node(pnode);
+
+        end_pages =3D vmemranges[vmemid].end >> PAGE_SHIFT;
+        /*
+         * Consider vga hole belongs to the vmemrange that covers
+         * 0xA0000-0xC0000. Note that 0x00000-0xA0000 is populated just
+         * before this loop.
+         */
+        if ( vmemranges[vmemid].start =3D=3D 0 )
+        {
+            cur_pages =3D 0xc0;
+            stat_normal_pages +=3D 0xc0;
+        }
+        else
+            cur_pages =3D vmemranges[vmemid].start >> PAGE_SHIFT;
+
+        while ( (rc =3D=3D 0) && (end_pages > cur_pages) )
+        {
+            /* Clip count to maximum 1GB extent. */
+            unsigned long count =3D end_pages - cur_pages;
+            unsigned long max_pages =3D SUPERPAGE_1GB_NR_PFNS;
+
+            if ( count > max_pages )
+                count =3D max_pages;
+
+            cur_pfn =3D dom->p2m_host[cur_pages];
+
+            /* Take care the corner cases of super page tails */
+            if ( ((cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1)) !=3D 0) &&
+                 (count > (-cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1))) )
+                count =3D -cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1);
+            else if ( ((count & (SUPERPAGE_1GB_NR_PFNS-1)) !=3D 0) &&
+                      (count > SUPERPAGE_1GB_NR_PFNS) )
+                count &=3D ~(SUPERPAGE_1GB_NR_PFNS - 1);
+
+            /* Attemp to allocate 1GB super page. Because in each pass
+             * we only allocate at most 1GB, we don't have to clip
+             * super page boundaries.
+             */
+            if ( ((count | cur_pfn) & (SUPERPAGE_1GB_NR_PFNS - 1)) =3D=3D 0 &&
+                 /* Check if there exists MMIO hole in the 1GB memory
+                  * range */
+                 !check_mmio_hole(cur_pfn << PAGE_SHIFT,
+                                  SUPERPAGE_1GB_NR_PFNS << PAGE_SHIFT,
+                                  dom->mmio_start, dom->mmio_size) )
+            {
+                long done;
+                unsigned long nr_extents =3D count >> SUPERPAGE_1GB_SHIFT;
+                xen_pfn_t sp_extents[nr_extents];
+
+                for ( i =3D 0; i < nr_extents; i++ )
+                    sp_extents[i] =3D
+                        dom->p2m_host[cur_pages+(i<<SUPERPAGE_1GB_SHIFT)];
+
+                done =3D xc_domain_populate_physmap(xch, domid, nr_extents,
+                                                  SUPERPAGE_1GB_SHIFT,
+                                                  new_memflags, sp_extents);
+
+                if ( done > 0 )
+                {
+                    stat_1gb_pages +=3D done;
+                    done <<=3D SUPERPAGE_1GB_SHIFT;
+                    cur_pages +=3D done;
+                    count -=3D done;
+                }
+            }
+
+            if ( count !=3D 0 )
+            {
+                /* Clip count to maximum 8MB extent. */
+                max_pages =3D SUPERPAGE_2MB_NR_PFNS * 4;
+                if ( count > max_pages )
+                    count =3D max_pages;
+
+                /* Clip partial superpage extents to superpage
+                 * boundaries. */
+                if ( ((cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1)) !=3D 0) &&
+                     (count > (-cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1))) )
+                    count =3D -cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1);
+                else if ( ((count & (SUPERPAGE_2MB_NR_PFNS-1)) !=3D 0) &&
+                          (count > SUPERPAGE_2MB_NR_PFNS) )
+                    count &=3D ~(SUPERPAGE_2MB_NR_PFNS - 1); /* clip non-s.p. tail */
+
+                /* Attempt to allocate superpage extents. */
+                if ( ((count | cur_pfn) & (SUPERPAGE_2MB_NR_PFNS - 1)) =3D=3D 0 )
+                {
+                    long done;
+                    unsigned long nr_extents =3D count >> SUPERPAGE_2MB_SHIFT;
+                    xen_pfn_t sp_extents[nr_extents];
+
+                    for ( i =3D 0; i < nr_extents; i++ )
+                        sp_extents[i] =3D
+                            dom->p2m_host[cur_pages+(i<<SUPERPAGE_2MB_SHIFT)];
+
+                    done =3D xc_domain_populate_physmap(xch, domid, nr_extents,
+                                                      SUPERPAGE_2MB_SHIFT,
+                                                      new_memflags, sp_extents);
+
+                    if ( done > 0 )
+                    {
+                        stat_2mb_pages +=3D done;
+                        done <<=3D SUPERPAGE_2MB_SHIFT;
+                        cur_pages +=3D done;
+                        count -=3D done;
+                    }
+                }
+            }
+
+            /* Fall back to 4kB extents. */
+            if ( count !=3D 0 )
+            {
+                rc =3D xc_domain_populate_physmap_exact(
+                    xch, domid, count, 0, new_memflags, &dom->p2m_host[cur_pages]);
+                cur_pages +=3D count;
+                stat_normal_pages +=3D count;
+            }
+        }
+
+        if ( rc !=3D 0 )
+            break;
+    }
+
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("Could not allocate memory for HVM guest.");
+        goto error_out;
+    }
+
+    DPRINTF("PHYSICAL MEMORY ALLOCATION:\n");
+    DPRINTF("  4KB PAGES: 0x%016lx\n", stat_normal_pages);
+    DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
+    DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
+
+    rc =3D 0;
+    goto out;
+ error_out:
+    rc =3D -1;
+ out:
+
+    /* ensure no unclaimed pages are left unused */
+    xc_domain_claim_pages(xch, domid, 0 /* cancels the claim */);
+
+    return rc;
+}
+
 /* ------------------------------------------------------------------------ */
 
 static int bootearly(struct xc_dom_image *dom)
@@ -1050,6 +1623,12 @@ static int bootlate_pv(struct xc_dom_image *dom)
     return 0;
 }
 
+static int bootlate_hvm(struct xc_dom_image *dom)
+{
+    DOMPRINTF("%s: doing nothing", __func__);
+    return 0;
+}
+
 int xc_dom_feature_translated(struct xc_dom_image *dom)
 {
     /* Guests running inside HVM containers are always auto-translated. */
@@ -1093,10 +1672,27 @@ static struct xc_dom_arch xc_dom_64 =3D {
     .bootlate =3D bootlate_pv,
 };
 
+static struct xc_dom_arch xc_hvm_32 =3D {
+    .guest_type =3D "hvm-3.0-x86_32",
+    .native_protocol =3D XEN_IO_PROTO_ABI_X86_32,
+    .page_shift =3D PAGE_SHIFT_X86,
+    .sizeof_pfn =3D 4,
+    .alloc_magic_pages =3D alloc_magic_pages_hvm,
+    .count_pgtables =3D NULL,
+    .setup_pgtables =3D NULL,
+    .start_info =3D NULL,
+    .shared_info =3D NULL,
+    .vcpu =3D vcpu_hvm,
+    .meminit =3D meminit_hvm,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate_hvm,
+};
+
 static void __init register_arch_hooks(void)
 {
     xc_dom_register_arch_hooks(&xc_dom_32_pae);
     xc_dom_register_arch_hooks(&xc_dom_64);
+    xc_dom_register_arch_hooks(&xc_hvm_32);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1Gy-0001Mj-E3; Mon, 19 Oct 2015 03:38:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gw-0001MR-9e
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:06 +0000
Content-Length: 27923
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	71/BC-16618-D9564265; Mon, 19 Oct 2015 03:38:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1445225882!26492730!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30824 invoked from network); 19 Oct 2015 03:38:03 -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;
	19 Oct 2015 03:38:03 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gs-0005gF-OK
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Gs-0004Qv-Jo
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:02 +0000
Date: Mon, 19 Oct 2015 03:38:02 +0000
Message-Id: <E1Zo1Gs-0004Qv-Jo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce a xc_dom_arch for
	hvm-3.0-x86_32 guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5072794958439774453=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5072794958439774453==
Content-Length: 28228
Content-Transfer-Encoding: quoted-printable

commit 68e1183411be71a8daa71b8abdd1f4fb843eb28a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:40 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:44 2015 +0100

    libxc: introduce a xc_dom_arch for hvm-3.0-x86_32 guests
    
    This xc_dom_arch will be used in order to build HVM domains. The code is
    based on the existing xc_hvm_populate_memory and xc_hvm_populate_params
    functions.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    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>
---
 tools/libxc/include/xc_dom.h |    6 +
 tools/libxc/xc_dom_x86.c     |  618 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 613 insertions(+), 11 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 2498cf7..e52b023 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -186,6 +186,12 @@ struct xc_dom_image {
     } container_type;
 
     /* HVM specific fields. */
+    xen_pfn_t target_pages;
+    xen_pfn_t mmio_start;
+    xen_pfn_t mmio_size;
+    xen_pfn_t lowmem_end;
+    xen_pfn_t highmem_end;
+
     /* Extra ACPI tables passed to HVMLOADER */
     struct xc_hvm_firmware_module acpi_module;
 
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index ab88996..dd331bf 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -39,10 +39,32 @@
 
 /* ------------------------------------------------------------------------ */
 
-#define SUPERPAGE_PFN_SHIFT  9
-#define SUPERPAGE_NR_PFNS    (1UL << SUPERPAGE_PFN_SHIFT)
 #define SUPERPAGE_BATCH_SIZE 512
 
+#define SUPERPAGE_2MB_SHIFT   9
+#define SUPERPAGE_2MB_NR_PFNS (1UL << SUPERPAGE_2MB_SHIFT)
+#define SUPERPAGE_1GB_SHIFT   18
+#define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
+
+#define X86_CR0_PE 0x01
+#define X86_CR0_ET 0x10
+
+#define VGA_HOLE_SIZE (0x20)
+
+#define SPECIALPAGE_PAGING   0
+#define SPECIALPAGE_ACCESS   1
+#define SPECIALPAGE_SHARING  2
+#define SPECIALPAGE_BUFIOREQ 3
+#define SPECIALPAGE_XENSTORE 4
+#define SPECIALPAGE_IOREQ    5
+#define SPECIALPAGE_IDENT_PT 6
+#define SPECIALPAGE_CONSOLE  7
+#define NR_SPECIAL_PAGES     8
+#define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
+
+#define NR_IOREQ_SERVER_PAGES 8
+#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
+
 #define bits_to_mask(bits)       (((xen_vaddr_t)1 << (bits))-1)
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
@@ -462,6 +484,135 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
     return 0;
 }
 
+static void build_hvm_info(void *hvm_info_page, struct xc_dom_image *dom)
+{
+    struct hvm_info_table *hvm_info =3D (struct hvm_info_table *)
+        (((unsigned char *)hvm_info_page) + HVM_INFO_OFFSET);
+    uint8_t sum;
+    int i;
+
+    memset(hvm_info_page, 0, PAGE_SIZE);
+
+    /* Fill in the header. */
+    memcpy(hvm_info->signature, "HVM INFO", sizeof(hvm_info->signature));
+    hvm_info->length =3D sizeof(struct hvm_info_table);
+
+    /* Sensible defaults: these can be overridden by the caller. */
+    hvm_info->apic_mode =3D 1;
+    hvm_info->nr_vcpus =3D 1;
+    memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online));
+
+    /* Memory parameters. */
+    hvm_info->low_mem_pgend =3D dom->lowmem_end >> PAGE_SHIFT;
+    hvm_info->high_mem_pgend =3D dom->highmem_end >> PAGE_SHIFT;
+    hvm_info->reserved_mem_pgstart =3D ioreq_server_pfn(0);
+
+    /* Finish with the checksum. */
+    for ( i =3D 0, sum =3D 0; i < hvm_info->length; i++ )
+        sum +=3D ((uint8_t *)hvm_info)[i];
+    hvm_info->checksum =3D -sum;
+}
+
+static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
+{
+    unsigned long i;
+    void *hvm_info_page;
+    uint32_t *ident_pt, domid =3D dom->guest_domid;
+    int rc;
+    xen_pfn_t special_array[NR_SPECIAL_PAGES];
+    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
+    xc_interface *xch =3D dom->xch;
+
+    if ( (hvm_info_page =3D xc_map_foreign_range(
+              xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+              HVM_INFO_PFN)) =3D=3D NULL )
+        goto error_out;
+    build_hvm_info(hvm_info_page, dom);
+    munmap(hvm_info_page, PAGE_SIZE);
+
+    /* Allocate and clear special pages. */
+    for ( i =3D 0; i < NR_SPECIAL_PAGES; i++ )
+        special_array[i] =3D special_pfn(i);
+
+    rc =3D xc_domain_populate_physmap_exact(xch, domid, NR_SPECIAL_PAGES, 0, 0,
+                                          special_array);
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("Could not allocate special pages.");
+        goto error_out;
+    }
+
+    if ( xc_clear_domain_pages(xch, domid, special_pfn(0), NR_SPECIAL_PAGES) )
+            goto error_out;
+
+    xc_hvm_param_set(xch, domid, HVM_PARAM_STORE_PFN,
+                     special_pfn(SPECIALPAGE_XENSTORE));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_BUFIOREQ_PFN,
+                     special_pfn(SPECIALPAGE_BUFIOREQ));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_IOREQ_PFN,
+                     special_pfn(SPECIALPAGE_IOREQ));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_CONSOLE_PFN,
+                     special_pfn(SPECIALPAGE_CONSOLE));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_PAGING_RING_PFN,
+                     special_pfn(SPECIALPAGE_PAGING));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_MONITOR_RING_PFN,
+                     special_pfn(SPECIALPAGE_ACCESS));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_SHARING_RING_PFN,
+                     special_pfn(SPECIALPAGE_SHARING));
+
+    /*
+     * Allocate and clear additional ioreq server pages. The default
+     * server will use the IOREQ and BUFIOREQ special pages above.
+     */
+    for ( i =3D 0; i < NR_IOREQ_SERVER_PAGES; i++ )
+        ioreq_server_array[i] =3D ioreq_server_pfn(i);
+
+    rc =3D xc_domain_populate_physmap_exact(xch, domid, NR_IOREQ_SERVER_PAGES, 0,
+                                          0, ioreq_server_array);
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("Could not allocate ioreq server pages.");
+        goto error_out;
+    }
+
+    if ( xc_clear_domain_pages(xch, domid, ioreq_server_pfn(0),
+                               NR_IOREQ_SERVER_PAGES) )
+            goto error_out;
+
+    /* Tell the domain where the pages are and how many there are */
+    xc_hvm_param_set(xch, domid, HVM_PARAM_IOREQ_SERVER_PFN,
+                     ioreq_server_pfn(0));
+    xc_hvm_param_set(xch, domid, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
+                     NR_IOREQ_SERVER_PAGES);
+
+    /*
+     * Identity-map page table is required for running with CR0.PG=3D0 when
+     * using Intel EPT. Create a 32-bit non-PAE page directory of superpages.
+     */
+    if ( (ident_pt =3D xc_map_foreign_range(
+              xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+              special_pfn(SPECIALPAGE_IDENT_PT))) =3D=3D NULL )
+        goto error_out;
+    for ( i =3D 0; i < PAGE_SIZE / sizeof(*ident_pt); i++ )
+        ident_pt[i] =3D ((i << 22) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER |
+                       _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE);
+    munmap(ident_pt, PAGE_SIZE);
+    xc_hvm_param_set(xch, domid, HVM_PARAM_IDENT_PT,
+                     special_pfn(SPECIALPAGE_IDENT_PT) << PAGE_SHIFT);
+
+    dom->console_pfn =3D special_pfn(SPECIALPAGE_CONSOLE);
+    dom->xenstore_pfn =3D special_pfn(SPECIALPAGE_XENSTORE);
+    dom->parms.virt_hypercall =3D -1;
+
+    rc =3D 0;
+    goto out;
+ error_out:
+    rc =3D -1;
+ out:
+
+    return rc;
+}
+
 /* ------------------------------------------------------------------------ */
 
 static int start_info_x86_32(struct xc_dom_image *dom)
@@ -680,6 +831,102 @@ static int vcpu_x86_64(struct xc_dom_image *dom)
     return rc;
 }
 
+static int vcpu_hvm(struct xc_dom_image *dom)
+{
+    struct {
+        struct hvm_save_descriptor header_d;
+        HVM_SAVE_TYPE(HEADER) header;
+        struct hvm_save_descriptor cpu_d;
+        HVM_SAVE_TYPE(CPU) cpu;
+        struct hvm_save_descriptor end_d;
+        HVM_SAVE_TYPE(END) end;
+    } bsp_ctx;
+    uint8_t *full_ctx =3D NULL;
+    int rc;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    /*
+     * Get the full HVM context in order to have the header, it is not
+     * possible to get the header with getcontext_partial, and crafting one
+     * from userspace is also not an option since cpuid is trapped and
+     * modified by Xen.
+     */
+
+    rc =3D xc_domain_hvm_getcontext(dom->xch, dom->guest_domid, NULL, 0);
+    if ( rc <=3D 0 )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: unable to fetch HVM context size (rc=3D%d)",
+                     __func__, rc);
+        goto out;
+    }
+
+    full_ctx =3D calloc(1, rc);
+    if ( full_ctx =3D=3D NULL )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: unable to allocate memory for HVM context (rc=3D%d)",
+                     __func__, rc);
+        rc =3D -ENOMEM;
+        goto out;
+    }
+
+    rc =3D xc_domain_hvm_getcontext(dom->xch, dom->guest_domid, full_ctx, rc);
+    if ( rc <=3D 0 )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: unable to fetch HVM context (rc=3D%d)",
+                     __func__, rc);
+        goto out;
+    }
+
+    /* Copy the header to our partial context. */
+    memset(&bsp_ctx, 0, sizeof(bsp_ctx));
+    memcpy(&bsp_ctx, full_ctx,
+           sizeof(struct hvm_save_descriptor) + HVM_SAVE_LENGTH(HEADER));
+
+    /* Set the CPU descriptor. */
+    bsp_ctx.cpu_d.typecode =3D HVM_SAVE_CODE(CPU);
+    bsp_ctx.cpu_d.instance =3D 0;
+    bsp_ctx.cpu_d.length =3D HVM_SAVE_LENGTH(CPU);
+
+    /* Set the cached part of the relevant segment registers. */
+    bsp_ctx.cpu.cs_base =3D 0;
+    bsp_ctx.cpu.ds_base =3D 0;
+    bsp_ctx.cpu.ss_base =3D 0;
+    bsp_ctx.cpu.tr_base =3D 0;
+    bsp_ctx.cpu.cs_limit =3D ~0u;
+    bsp_ctx.cpu.ds_limit =3D ~0u;
+    bsp_ctx.cpu.ss_limit =3D ~0u;
+    bsp_ctx.cpu.tr_limit =3D 0x67;
+    bsp_ctx.cpu.cs_arbytes =3D 0xc9b;
+    bsp_ctx.cpu.ds_arbytes =3D 0xc93;
+    bsp_ctx.cpu.ss_arbytes =3D 0xc93;
+    bsp_ctx.cpu.tr_arbytes =3D 0x8b;
+
+    /* Set the control registers. */
+    bsp_ctx.cpu.cr0 =3D X86_CR0_PE | X86_CR0_ET;
+
+    /* Set the IP. */
+    bsp_ctx.cpu.rip =3D dom->parms.phys_entry;
+
+    /* Set the end descriptor. */
+    bsp_ctx.end_d.typecode =3D HVM_SAVE_CODE(END);
+    bsp_ctx.end_d.instance =3D 0;
+    bsp_ctx.end_d.length =3D HVM_SAVE_LENGTH(END);
+
+    rc =3D xc_domain_hvm_setcontext(dom->xch, dom->guest_domid,
+                                  (uint8_t *)&bsp_ctx, sizeof(bsp_ctx));
+    if ( rc !=3D 0 )
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: SETHVMCONTEXT failed (rc=3D%d)", __func__, rc);
+
+ out:
+    free(full_ctx);
+    return rc;
+}
+
 /* ------------------------------------------------------------------------ */
 
 static int x86_compat(xc_interface *xch, domid_t domid, char *guest_type)
@@ -760,7 +1007,7 @@ static int meminit_pv(struct xc_dom_image *dom)
 
     if ( dom->superpages )
     {
-        int count =3D dom->total_pages >> SUPERPAGE_PFN_SHIFT;
+        int count =3D dom->total_pages >> SUPERPAGE_2MB_SHIFT;
         xen_pfn_t extents[count];
 
         dom->p2m_size =3D dom->total_pages;
@@ -771,9 +1018,9 @@ static int meminit_pv(struct xc_dom_image *dom)
 
         DOMPRINTF("Populating memory with %d superpages", count);
         for ( pfn =3D 0; pfn < count; pfn++ )
-            extents[pfn] =3D pfn << SUPERPAGE_PFN_SHIFT;
+            extents[pfn] =3D pfn << SUPERPAGE_2MB_SHIFT;
         rc =3D xc_domain_populate_physmap_exact(dom->xch, dom->guest_domid,
-                                               count, SUPERPAGE_PFN_SHIFT, 0,
+                                               count, SUPERPAGE_2MB_SHIFT, 0,
                                                extents);
         if ( rc )
             return rc;
@@ -783,7 +1030,7 @@ static int meminit_pv(struct xc_dom_image *dom)
         for ( i =3D 0; i < count; i++ )
         {
             mfn =3D extents[i];
-            for ( j =3D 0; j < SUPERPAGE_NR_PFNS; j++, pfn++ )
+            for ( j =3D 0; j < SUPERPAGE_2MB_NR_PFNS; j++, pfn++ )
                 dom->p2m_host[pfn] =3D mfn + j;
         }
     }
@@ -868,7 +1115,7 @@ static int meminit_pv(struct xc_dom_image *dom)
 
             pages =3D (vmemranges[i].end - vmemranges[i].start)
                 >> PAGE_SHIFT;
-            super_pages =3D pages >> SUPERPAGE_PFN_SHIFT;
+            super_pages =3D pages >> SUPERPAGE_2MB_SHIFT;
             pfn_base =3D vmemranges[i].start >> PAGE_SHIFT;
 
             for ( pfn =3D pfn_base; pfn < pfn_base+pages; pfn++ )
@@ -881,11 +1128,11 @@ static int meminit_pv(struct xc_dom_image *dom)
                 super_pages -=3D count;
 
                 for ( pfn =3D pfn_base_idx, j =3D 0;
-                      pfn < pfn_base_idx + (count << SUPERPAGE_PFN_SHIFT);
-                      pfn +=3D SUPERPAGE_NR_PFNS, j++ )
+                      pfn < pfn_base_idx + (count << SUPERPAGE_2MB_SHIFT);
+                      pfn +=3D SUPERPAGE_2MB_NR_PFNS, j++ )
                     extents[j] =3D dom->p2m_host[pfn];
                 rc =3D xc_domain_populate_physmap(dom->xch, dom->guest_domid, count,
-                                                SUPERPAGE_PFN_SHIFT, memflags,
+                                                SUPERPAGE_2MB_SHIFT, memflags,
                                                 extents);
                 if ( rc < 0 )
                     return rc;
@@ -895,7 +1142,7 @@ static int meminit_pv(struct xc_dom_image *dom)
                 for ( j =3D 0; j < rc; j++ )
                 {
                     mfn =3D extents[j];
-                    for ( k =3D 0; k < SUPERPAGE_NR_PFNS; k++, pfn++ )
+                    for ( k =3D 0; k < SUPERPAGE_2MB_NR_PFNS; k++, pfn++ )
                         dom->p2m_host[pfn] =3D mfn + k;
                 }
                 pfn_base_idx =3D pfn;
@@ -936,6 +1183,332 @@ static int meminit_pv(struct xc_dom_image *dom)
     return rc;
 }
 
+/*
+ * Check whether there exists mmio hole in the specified memory range.
+ * Returns 1 if exists, else returns 0.
+ */
+static int check_mmio_hole(uint64_t start, uint64_t memsize,
+                           uint64_t mmio_start, uint64_t mmio_size)
+{
+    if ( start + memsize <=3D mmio_start || start >=3D mmio_start + mmio_size )
+        return 0;
+    else
+        return 1;
+}
+
+static int meminit_hvm(struct xc_dom_image *dom)
+{
+    unsigned long i, vmemid, nr_pages =3D dom->total_pages;
+    unsigned long p2m_size;
+    unsigned long target_pages =3D dom->target_pages;
+    unsigned long cur_pages, cur_pfn;
+    int rc;
+    xen_capabilities_info_t caps;
+    unsigned long stat_normal_pages =3D 0, stat_2mb_pages =3D 0, 
+        stat_1gb_pages =3D 0;
+    unsigned int memflags =3D 0;
+    int claim_enabled =3D dom->claim_enabled;
+    uint64_t total_pages;
+    xen_vmemrange_t dummy_vmemrange[2];
+    unsigned int dummy_vnode_to_pnode[1];
+    xen_vmemrange_t *vmemranges;
+    unsigned int *vnode_to_pnode;
+    unsigned int nr_vmemranges, nr_vnodes;
+    xc_interface *xch =3D dom->xch;
+    uint32_t domid =3D dom->guest_domid;
+
+    if ( nr_pages > target_pages )
+        memflags |=3D XENMEMF_populate_on_demand;
+
+    if ( dom->nr_vmemranges =3D=3D 0 )
+    {
+        /* Build dummy vnode information
+         *
+         * Guest physical address space layout:
+         * [0, hole_start) [hole_start, 4G) [4G, highmem_end)
+         *
+         * Of course if there is no high memory, the second vmemrange
+         * has no effect on the actual result.
+         */
+
+        dummy_vmemrange[0].start =3D 0;
+        dummy_vmemrange[0].end   =3D dom->lowmem_end;
+        dummy_vmemrange[0].flags =3D 0;
+        dummy_vmemrange[0].nid   =3D 0;
+        nr_vmemranges =3D 1;
+
+        if ( dom->highmem_end > (1ULL << 32) )
+        {
+            dummy_vmemrange[1].start =3D 1ULL << 32;
+            dummy_vmemrange[1].end   =3D dom->highmem_end;
+            dummy_vmemrange[1].flags =3D 0;
+            dummy_vmemrange[1].nid   =3D 0;
+
+            nr_vmemranges++;
+        }
+
+        dummy_vnode_to_pnode[0] =3D XC_NUMA_NO_NODE;
+        nr_vnodes =3D 1;
+        vmemranges =3D dummy_vmemrange;
+        vnode_to_pnode =3D dummy_vnode_to_pnode;
+    }
+    else
+    {
+        if ( nr_pages > target_pages )
+        {
+            DOMPRINTF("Cannot enable vNUMA and PoD at the same time");
+            goto error_out;
+        }
+
+        nr_vmemranges =3D dom->nr_vmemranges;
+        nr_vnodes =3D dom->nr_vnodes;
+        vmemranges =3D dom->vmemranges;
+        vnode_to_pnode =3D dom->vnode_to_pnode;
+    }
+
+    total_pages =3D 0;
+    p2m_size =3D 0;
+    for ( i =3D 0; i < nr_vmemranges; i++ )
+    {
+        total_pages +=3D ((vmemranges[i].end - vmemranges[i].start)
+                        >> PAGE_SHIFT);
+        p2m_size =3D p2m_size > (vmemranges[i].end >> PAGE_SHIFT) =3F
+            p2m_size : (vmemranges[i].end >> PAGE_SHIFT);
+    }
+
+    if ( total_pages !=3D nr_pages )
+    {
+        DOMPRINTF("vNUMA memory pages mismatch (0x%"PRIx64" !=3D 0x%lx)",
+               total_pages, nr_pages);
+        goto error_out;
+    }
+
+    if ( xc_version(xch, XENVER_capabilities, &caps) !=3D 0 )
+    {
+        DOMPRINTF("Could not get Xen capabilities");
+        goto error_out;
+    }
+
+    dom->p2m_size =3D p2m_size;
+    dom->p2m_host =3D xc_dom_malloc(dom, sizeof(xen_pfn_t) *
+                                      dom->p2m_size);
+    if ( dom->p2m_host =3D=3D NULL )
+    {
+        DOMPRINTF("Could not allocate p2m");
+        goto error_out;
+    }
+
+    for ( i =3D 0; i < p2m_size; i++ )
+        dom->p2m_host[i] =3D ((xen_pfn_t)-1);
+    for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
+    {
+        uint64_t pfn;
+
+        for ( pfn =3D vmemranges[vmemid].start >> PAGE_SHIFT;
+              pfn < vmemranges[vmemid].end >> PAGE_SHIFT;
+              pfn++ )
+            dom->p2m_host[pfn] =3D pfn;
+    }
+
+    /*
+     * Try to claim pages for early warning of insufficient memory available.
+     * This should go before xc_domain_set_pod_target, becuase that function
+     * actually allocates memory for the guest. Claiming after memory has been
+     * allocated is pointless.
+     */
+    if ( claim_enabled ) {
+        rc =3D xc_domain_claim_pages(xch, domid, target_pages - VGA_HOLE_SIZE);
+        if ( rc !=3D 0 )
+        {
+            DOMPRINTF("Could not allocate memory for HVM guest as we cannot claim memory!");
+            goto error_out;
+        }
+    }
+
+    if ( memflags & XENMEMF_populate_on_demand )
+    {
+        /*
+         * Subtract VGA_HOLE_SIZE from target_pages for the VGA
+         * "hole".  Xen will adjust the PoD cache size so that domain
+         * tot_pages will be target_pages - VGA_HOLE_SIZE after
+         * this call.
+         */
+        rc =3D xc_domain_set_pod_target(xch, domid, target_pages - VGA_HOLE_SIZE,
+                                      NULL, NULL, NULL);
+        if ( rc !=3D 0 )
+        {
+            DOMPRINTF("Could not set PoD target for HVM guest.\n");
+            goto error_out;
+        }
+    }
+
+    /*
+     * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
+     *
+     * We attempt to allocate 1GB pages if possible. It falls back on 2MB
+     * pages if 1GB allocation fails. 4KB pages will be used eventually if
+     * both fail.
+     * 
+     * Under 2MB mode, we allocate pages in batches of no more than 8MB to 
+     * ensure that we can be preempted and hence dom0 remains responsive.
+     */
+    rc =3D xc_domain_populate_physmap_exact(
+        xch, domid, 0xa0, 0, memflags, &dom->p2m_host[0x00]);
+
+    stat_normal_pages =3D 0;
+    for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
+    {
+        unsigned int new_memflags =3D memflags;
+        uint64_t end_pages;
+        unsigned int vnode =3D vmemranges[vmemid].nid;
+        unsigned int pnode =3D vnode_to_pnode[vnode];
+
+        if ( pnode !=3D XC_NUMA_NO_NODE )
+            new_memflags |=3D XENMEMF_exact_node(pnode);
+
+        end_pages =3D vmemranges[vmemid].end >> PAGE_SHIFT;
+        /*
+         * Consider vga hole belongs to the vmemrange that covers
+         * 0xA0000-0xC0000. Note that 0x00000-0xA0000 is populated just
+         * before this loop.
+         */
+        if ( vmemranges[vmemid].start =3D=3D 0 )
+        {
+            cur_pages =3D 0xc0;
+            stat_normal_pages +=3D 0xc0;
+        }
+        else
+            cur_pages =3D vmemranges[vmemid].start >> PAGE_SHIFT;
+
+        while ( (rc =3D=3D 0) && (end_pages > cur_pages) )
+        {
+            /* Clip count to maximum 1GB extent. */
+            unsigned long count =3D end_pages - cur_pages;
+            unsigned long max_pages =3D SUPERPAGE_1GB_NR_PFNS;
+
+            if ( count > max_pages )
+                count =3D max_pages;
+
+            cur_pfn =3D dom->p2m_host[cur_pages];
+
+            /* Take care the corner cases of super page tails */
+            if ( ((cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1)) !=3D 0) &&
+                 (count > (-cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1))) )
+                count =3D -cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1);
+            else if ( ((count & (SUPERPAGE_1GB_NR_PFNS-1)) !=3D 0) &&
+                      (count > SUPERPAGE_1GB_NR_PFNS) )
+                count &=3D ~(SUPERPAGE_1GB_NR_PFNS - 1);
+
+            /* Attemp to allocate 1GB super page. Because in each pass
+             * we only allocate at most 1GB, we don't have to clip
+             * super page boundaries.
+             */
+            if ( ((count | cur_pfn) & (SUPERPAGE_1GB_NR_PFNS - 1)) =3D=3D 0 &&
+                 /* Check if there exists MMIO hole in the 1GB memory
+                  * range */
+                 !check_mmio_hole(cur_pfn << PAGE_SHIFT,
+                                  SUPERPAGE_1GB_NR_PFNS << PAGE_SHIFT,
+                                  dom->mmio_start, dom->mmio_size) )
+            {
+                long done;
+                unsigned long nr_extents =3D count >> SUPERPAGE_1GB_SHIFT;
+                xen_pfn_t sp_extents[nr_extents];
+
+                for ( i =3D 0; i < nr_extents; i++ )
+                    sp_extents[i] =3D
+                        dom->p2m_host[cur_pages+(i<<SUPERPAGE_1GB_SHIFT)];
+
+                done =3D xc_domain_populate_physmap(xch, domid, nr_extents,
+                                                  SUPERPAGE_1GB_SHIFT,
+                                                  new_memflags, sp_extents);
+
+                if ( done > 0 )
+                {
+                    stat_1gb_pages +=3D done;
+                    done <<=3D SUPERPAGE_1GB_SHIFT;
+                    cur_pages +=3D done;
+                    count -=3D done;
+                }
+            }
+
+            if ( count !=3D 0 )
+            {
+                /* Clip count to maximum 8MB extent. */
+                max_pages =3D SUPERPAGE_2MB_NR_PFNS * 4;
+                if ( count > max_pages )
+                    count =3D max_pages;
+
+                /* Clip partial superpage extents to superpage
+                 * boundaries. */
+                if ( ((cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1)) !=3D 0) &&
+                     (count > (-cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1))) )
+                    count =3D -cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1);
+                else if ( ((count & (SUPERPAGE_2MB_NR_PFNS-1)) !=3D 0) &&
+                          (count > SUPERPAGE_2MB_NR_PFNS) )
+                    count &=3D ~(SUPERPAGE_2MB_NR_PFNS - 1); /* clip non-s.p. tail */
+
+                /* Attempt to allocate superpage extents. */
+                if ( ((count | cur_pfn) & (SUPERPAGE_2MB_NR_PFNS - 1)) =3D=3D 0 )
+                {
+                    long done;
+                    unsigned long nr_extents =3D count >> SUPERPAGE_2MB_SHIFT;
+                    xen_pfn_t sp_extents[nr_extents];
+
+                    for ( i =3D 0; i < nr_extents; i++ )
+                        sp_extents[i] =3D
+                            dom->p2m_host[cur_pages+(i<<SUPERPAGE_2MB_SHIFT)];
+
+                    done =3D xc_domain_populate_physmap(xch, domid, nr_extents,
+                                                      SUPERPAGE_2MB_SHIFT,
+                                                      new_memflags, sp_extents);
+
+                    if ( done > 0 )
+                    {
+                        stat_2mb_pages +=3D done;
+                        done <<=3D SUPERPAGE_2MB_SHIFT;
+                        cur_pages +=3D done;
+                        count -=3D done;
+                    }
+                }
+            }
+
+            /* Fall back to 4kB extents. */
+            if ( count !=3D 0 )
+            {
+                rc =3D xc_domain_populate_physmap_exact(
+                    xch, domid, count, 0, new_memflags, &dom->p2m_host[cur_pages]);
+                cur_pages +=3D count;
+                stat_normal_pages +=3D count;
+            }
+        }
+
+        if ( rc !=3D 0 )
+            break;
+    }
+
+    if ( rc !=3D 0 )
+    {
+        DOMPRINTF("Could not allocate memory for HVM guest.");
+        goto error_out;
+    }
+
+    DPRINTF("PHYSICAL MEMORY ALLOCATION:\n");
+    DPRINTF("  4KB PAGES: 0x%016lx\n", stat_normal_pages);
+    DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
+    DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
+
+    rc =3D 0;
+    goto out;
+ error_out:
+    rc =3D -1;
+ out:
+
+    /* ensure no unclaimed pages are left unused */
+    xc_domain_claim_pages(xch, domid, 0 /* cancels the claim */);
+
+    return rc;
+}
+
 /* ------------------------------------------------------------------------ */
 
 static int bootearly(struct xc_dom_image *dom)
@@ -1050,6 +1623,12 @@ static int bootlate_pv(struct xc_dom_image *dom)
     return 0;
 }
 
+static int bootlate_hvm(struct xc_dom_image *dom)
+{
+    DOMPRINTF("%s: doing nothing", __func__);
+    return 0;
+}
+
 int xc_dom_feature_translated(struct xc_dom_image *dom)
 {
     /* Guests running inside HVM containers are always auto-translated. */
@@ -1093,10 +1672,27 @@ static struct xc_dom_arch xc_dom_64 =3D {
     .bootlate =3D bootlate_pv,
 };
 
+static struct xc_dom_arch xc_hvm_32 =3D {
+    .guest_type =3D "hvm-3.0-x86_32",
+    .native_protocol =3D XEN_IO_PROTO_ABI_X86_32,
+    .page_shift =3D PAGE_SHIFT_X86,
+    .sizeof_pfn =3D 4,
+    .alloc_magic_pages =3D alloc_magic_pages_hvm,
+    .count_pgtables =3D NULL,
+    .setup_pgtables =3D NULL,
+    .start_info =3D NULL,
+    .shared_info =3D NULL,
+    .vcpu =3D vcpu_hvm,
+    .meminit =3D meminit_hvm,
+    .bootearly =3D bootearly,
+    .bootlate =3D bootlate_hvm,
+};
+
 static void __init register_arch_hooks(void)
 {
     xc_dom_register_arch_hooks(&xc_dom_32_pae);
     xc_dom_register_arch_hooks(&xc_dom_64);
+    xc_dom_register_arch_hooks(&xc_hvm_32);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1H8-0001Ob-JK; Mon, 19 Oct 2015 03:38: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 1Zo1H6-0001OJ-V6
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:17 +0000
Content-Length: 24797
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	51/ED-01421-8A564265; Mon, 19 Oct 2015 03:38:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445225893!49915342!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32609 invoked from network); 19 Oct 2015 03:38:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:38:14 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1H3-0005gN-3v
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1H3-0004Rg-1t
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:13 +0000
Date: Mon, 19 Oct 2015 03:38:13 +0000
Message-Id: <E1Zo1H3-0004Rg-1t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: switch HVM domain building to
	use xc_dom_* helpers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2658985522782697062=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2658985522782697062==
Content-Length: 24951
Content-Transfer-Encoding: quoted-printable

commit 1ee15d73326a10484bc3b679582fb2000e0219fa
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:41 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    libxl: switch HVM domain building to use xc_dom_* helpers
    
    Now that we have all the code in place HVM domain building in libxl can be
    switched to use the xc_dom_* family of functions, just like they are used in
    order to build PV guests.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@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>
---
 tools/libxl/libxl_arch.h     |    2 +-
 tools/libxl/libxl_arm.c      |    2 +-
 tools/libxl/libxl_dm.c       |   18 ++--
 tools/libxl/libxl_dom.c      |  228 ++++++++++++++++++++++++------------------
 tools/libxl/libxl_internal.h |    4 +-
 tools/libxl/libxl_vnuma.c    |   12 ++-
 tools/libxl/libxl_x86.c      |    8 +-
 7 files changed, 157 insertions(+), 117 deletions(-)

diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h
index bd030b6..34a853c 100644
--- a/tools/libxl/libxl_arch.h
+++ b/tools/libxl/libxl_arch.h
@@ -60,6 +60,6 @@ _hidden
 int libxl__arch_domain_construct_memmap(libxl__gc *gc,
                                         libxl_domain_config *d_config,
                                         uint32_t domid,
-                                        struct xc_hvm_build_args *args);
+                                        struct xc_dom_image *dom);
 
 #endif
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 0af8010..1195b37 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -974,7 +974,7 @@ int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
 int libxl__arch_domain_construct_memmap(libxl__gc *gc,
                                         libxl_domain_config *d_config,
                                         uint32_t domid,
-                                        struct xc_hvm_build_args *args)
+                                        struct xc_dom_image *dom)
 {
     return 0;
 }
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index cf8b535..e33d492 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -18,6 +18,8 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
+
+#include <xc_dom.h>
 #include <xen/hvm/e820.h>
 
 static const char *libxl_tapif_script(libxl__gc *gc)
@@ -179,7 +181,7 @@ add_rdm_entry(libxl__gc *gc, libxl_domain_config *d_config,
 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)
+                                       struct xc_dom_image *dom)
 {
     int i, j, conflict, rc;
     struct xen_reserved_device_memory *xrdm =3D NULL;
@@ -187,7 +189,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
     uint16_t seg;
     uint8_t bus, devfn;
     uint64_t rdm_start, rdm_size;
-    uint64_t highmem_end =3D args->highmem_end =3F args->highmem_end : (1ull<<32);
+    uint64_t highmem_end =3D dom->highmem_end =3F dom->highmem_end : (1ull<<32);
 
     /*
      * We just want to construct RDM once since RDM is specific to the
@@ -301,7 +303,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
     for (i =3D 0; i < d_config->num_rdms; i++) {
         rdm_start =3D d_config->rdms[i].start;
         rdm_size =3D d_config->rdms[i].size;
-        conflict =3D overlaps_rdm(0, args->lowmem_end, rdm_start, rdm_size);
+        conflict =3D overlaps_rdm(0, dom->lowmem_end, rdm_start, rdm_size);
 
         if (!conflict)
             continue;
@@ -312,14 +314,14 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
              * We will move downwards lowmem_end so we have to expand
              * highmem_end.
              */
-            highmem_end +=3D (args->lowmem_end - rdm_start);
+            highmem_end +=3D (dom->lowmem_end - rdm_start);
             /* Now move downwards lowmem_end. */
-            args->lowmem_end =3D rdm_start;
+            dom->lowmem_end =3D rdm_start;
         }
     }
 
     /* Sync highmem_end. */
-    args->highmem_end =3D highmem_end;
+    dom->highmem_end =3D highmem_end;
 
     /*
      * Finally we can take same policy to check lowmem(< 2G) and
@@ -329,11 +331,11 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
         rdm_start =3D d_config->rdms[i].start;
         rdm_size =3D d_config->rdms[i].size;
         /* Does this entry conflict with lowmem=3F */
-        conflict =3D overlaps_rdm(0, args->lowmem_end,
+        conflict =3D overlaps_rdm(0, dom->lowmem_end,
                                 rdm_start, rdm_size);
         /* Does this entry conflict with highmem=3F */
         conflict |=3D overlaps_rdm((1ULL<<32),
-                                 args->highmem_end - (1ULL<<32),
+                                 dom->highmem_end - (1ULL<<32),
                                  rdm_start, rdm_size);
 
         if (!conflict)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 2b92d48..43e527a 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -601,6 +601,63 @@ static int set_vnuma_info(libxl__gc *gc, uint32_t domid,
     return rc;
 }
 
+static int libxl__build_dom(libxl__gc *gc, uint32_t domid,
+             libxl_domain_build_info *info, libxl__domain_build_state *state,
+             struct xc_dom_image *dom)
+{
+    uint64_t mem_kb;
+    int ret;
+
+    if ( (ret =3D xc_dom_boot_xen_init(dom, CTX->xch, domid)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_boot_xen_init failed");
+        goto out;
+    }
+#ifdef GUEST_RAM_BASE
+    if ( (ret =3D xc_dom_rambase_init(dom, GUEST_RAM_BASE)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_rambase failed");
+        goto out;
+    }
+#endif
+    if ( (ret =3D xc_dom_parse_image(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_parse_image failed");
+        goto out;
+    }
+    if ( (ret =3D libxl__arch_domain_init_hw_description(gc, info, state, dom)) !=3D 0 ) {
+        LOGE(ERROR, "libxl__arch_domain_init_hw_description failed");
+        goto out;
+    }
+
+    mem_kb =3D dom->container_type =3D=3D XC_DOM_HVM_CONTAINER =3F
+             (info->max_memkb - info->video_memkb) : info->target_memkb;
+    if ( (ret =3D xc_dom_mem_init(dom, mem_kb / 1024)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_mem_init failed");
+        goto out;
+    }
+    if ( (ret =3D xc_dom_boot_mem_init(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_boot_mem_init failed");
+        goto out;
+    }
+    if ( (ret =3D libxl__arch_domain_finalise_hw_description(gc, info, dom)) !=3D 0 ) {
+        LOGE(ERROR, "libxl__arch_domain_finalise_hw_description failed");
+        goto out;
+    }
+    if ( (ret =3D xc_dom_build_image(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_build_image failed");
+        goto out;
+    }
+    if ( (ret =3D xc_dom_boot_image(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_boot_image failed");
+        goto out;
+    }
+    if ( (ret =3D xc_dom_gnttab_init(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_gnttab_init failed");
+        goto out;
+    }
+
+out:
+    return ret !=3D 0 =3F ERROR_FAIL : 0;
+}
+
 int libxl__build_pv(libxl__gc *gc, uint32_t domid,
              libxl_domain_build_info *info, libxl__domain_build_state *state)
 {
@@ -691,48 +748,9 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
             dom->vnode_to_pnode[i] =3D info->vnuma_nodes[i].pnode;
     }
 
-    if ( (ret =3D xc_dom_boot_xen_init(dom, ctx->xch, domid)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_boot_xen_init failed");
-        goto out;
-    }
-#ifdef GUEST_RAM_BASE
-    if ( (ret =3D xc_dom_rambase_init(dom, GUEST_RAM_BASE)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_rambase failed");
+    ret =3D libxl__build_dom(gc, domid, info, state, dom);
+    if (ret !=3D 0)
         goto out;
-    }
-#endif
-    if ( (ret =3D xc_dom_parse_image(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_parse_image failed");
-        goto out;
-    }
-    if ( (ret =3D libxl__arch_domain_init_hw_description(gc, info, state, dom)) !=3D 0 ) {
-        LOGE(ERROR, "libxl__arch_domain_init_hw_description failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_mem_init(dom, info->target_memkb / 1024)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_mem_init failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_boot_mem_init(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_boot_mem_init failed");
-        goto out;
-    }
-    if ( (ret =3D libxl__arch_domain_finalise_hw_description(gc, info, dom)) !=3D 0 ) {
-        LOGE(ERROR, "libxl__arch_domain_finalise_hw_description failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_build_image(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_build_image failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_boot_image(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_boot_image failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_gnttab_init(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_gnttab_init failed");
-        goto out;
-    }
 
     if (xc_dom_feature_translated(dom)) {
         state->console_mfn =3D dom->console_pfn;
@@ -792,39 +810,39 @@ static int hvm_build_set_params(xc_interface *handle, uint32_t domid,
 
 static int hvm_build_set_xs_values(libxl__gc *gc,
                                    uint32_t domid,
-                                   struct xc_hvm_build_args *args)
+                                   struct xc_dom_image *dom)
 {
     char *path =3D NULL;
     int ret =3D 0;
 
-    if (args->smbios_module.guest_addr_out) {
+    if (dom->smbios_module.guest_addr_out) {
         path =3D GCSPRINTF("/local/domain/%d/"HVM_XS_SMBIOS_PT_ADDRESS, domid);
 
         ret =3D libxl__xs_write(gc, XBT_NULL, path, "0x%"PRIx64,
-                              args->smbios_module.guest_addr_out);
+                              dom->smbios_module.guest_addr_out);
         if (ret)
             goto err;
 
         path =3D GCSPRINTF("/local/domain/%d/"HVM_XS_SMBIOS_PT_LENGTH, domid);
 
         ret =3D libxl__xs_write(gc, XBT_NULL, path, "0x%x",
-                              args->smbios_module.length);
+                              dom->smbios_module.length);
         if (ret)
             goto err;
     }
 
-    if (args->acpi_module.guest_addr_out) {
+    if (dom->acpi_module.guest_addr_out) {
         path =3D GCSPRINTF("/local/domain/%d/"HVM_XS_ACPI_PT_ADDRESS, domid);
 
         ret =3D libxl__xs_write(gc, XBT_NULL, path, "0x%"PRIx64,
-                              args->acpi_module.guest_addr_out);
+                              dom->acpi_module.guest_addr_out);
         if (ret)
             goto err;
 
         path =3D GCSPRINTF("/local/domain/%d/"HVM_XS_ACPI_PT_LENGTH, domid);
 
         ret =3D libxl__xs_write(gc, XBT_NULL, path, "0x%x",
-                              args->acpi_module.length);
+                              dom->acpi_module.length);
         if (ret)
             goto err;
     }
@@ -838,7 +856,7 @@ err:
 
 static int libxl__domain_firmware(libxl__gc *gc,
                                   libxl_domain_build_info *info,
-                                  struct xc_hvm_build_args *args)
+                                  struct xc_dom_image *dom)
 {
     libxl_ctx *ctx =3D libxl__gc_owner(gc);
     const char *firmware;
@@ -864,8 +882,13 @@ static int libxl__domain_firmware(libxl__gc *gc,
             break;
         }
     }
-    args->image_file_name =3D libxl__abs_path(gc, firmware,
-                                            libxl__xenfirmwaredir_path());
+
+    rc =3D xc_dom_kernel_file(dom, libxl__abs_path(gc, firmware,
+                                                 libxl__xenfirmwaredir_path()));
+    if (rc !=3D 0) {
+        LOGE(ERROR, "xc_dom_kernel_file failed");
+        goto out;
+    }
 
     if (info->u.hvm.smbios_firmware) {
         data =3D NULL;
@@ -879,8 +902,8 @@ static int libxl__domain_firmware(libxl__gc *gc,
         libxl__ptr_add(gc, data);
         if (datalen) {
             /* Only accept non-empty files */
-            args->smbios_module.data =3D data;
-            args->smbios_module.length =3D (uint32_t)datalen;
+            dom->smbios_module.data =3D data;
+            dom->smbios_module.length =3D (uint32_t)datalen;
         }
     }
 
@@ -896,8 +919,8 @@ static int libxl__domain_firmware(libxl__gc *gc,
         libxl__ptr_add(gc, data);
         if (datalen) {
             /* Only accept non-empty files */
-            args->acpi_module.data =3D data;
-            args->acpi_module.length =3D (uint32_t)datalen;
+            dom->acpi_module.data =3D data;
+            dom->acpi_module.length =3D (uint32_t)datalen;
         }
     }
 
@@ -911,52 +934,63 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
               libxl__domain_build_state *state)
 {
     libxl_ctx *ctx =3D libxl__gc_owner(gc);
-    struct xc_hvm_build_args args =3D {};
-    int ret, rc;
-    uint64_t mmio_start, lowmem_end, highmem_end;
+    int rc;
+    uint64_t mmio_start, lowmem_end, highmem_end, mem_size;
     libxl_domain_build_info *const info =3D &d_config->b_info;
+    struct xc_dom_image *dom =3D NULL;
+
+    xc_dom_loginit(ctx->xch);
+
+    dom =3D xc_dom_allocate(ctx->xch, NULL, NULL);
+    if (!dom) {
+        LOGE(ERROR, "xc_dom_allocate failed");
+        rc =3D ERROR_NOMEM;
+        goto out;
+    }
+
+    dom->container_type =3D XC_DOM_HVM_CONTAINER;
 
-    memset(&args, 0, sizeof(struct xc_hvm_build_args));
     /* The params from the configuration file are in Mb, which are then
      * multiplied by 1 Kb. This was then divided off when calling
      * the old xc_hvm_build_target_mem() which then turned them to bytes.
      * Do all this in one step here...
      */
-    args.mem_size =3D (uint64_t)(info->max_memkb - info->video_memkb) << 10;
-    args.mem_target =3D (uint64_t)(info->target_memkb - info->video_memkb) << 10;
-    args.claim_enabled =3D libxl_defbool_val(info->claim_mode);
+    mem_size =3D (uint64_t)(info->max_memkb - info->video_memkb) << 10;
+    dom->target_pages =3D (uint64_t)(info->target_memkb - info->video_memkb) >> 2;
+    dom->claim_enabled =3D libxl_defbool_val(info->claim_mode);
     if (info->u.hvm.mmio_hole_memkb) {
         uint64_t max_ram_below_4g =3D (1ULL << 32) -
             (info->u.hvm.mmio_hole_memkb << 10);
 
         if (max_ram_below_4g < HVM_BELOW_4G_MMIO_START)
-            args.mmio_size =3D info->u.hvm.mmio_hole_memkb << 10;
+            dom->mmio_size =3D info->u.hvm.mmio_hole_memkb << 10;
     }
 
-    rc =3D libxl__domain_firmware(gc, info, &args);
+    rc =3D libxl__domain_firmware(gc, info, dom);
     if (rc !=3D 0) {
         LOG(ERROR, "initializing domain firmware failed");
         goto out;
     }
-    if (args.mem_target =3D=3D 0)
-        args.mem_target =3D args.mem_size;
-    if (args.mmio_size =3D=3D 0)
-        args.mmio_size =3D HVM_BELOW_4G_MMIO_LENGTH;
-    lowmem_end =3D args.mem_size;
+
+    if (dom->target_pages =3D=3D 0)
+        dom->target_pages =3D mem_size >> XC_PAGE_SHIFT;
+    if (dom->mmio_size =3D=3D 0)
+        dom->mmio_size =3D HVM_BELOW_4G_MMIO_LENGTH;
+    lowmem_end =3D mem_size;
     highmem_end =3D 0;
-    mmio_start =3D (1ull << 32) - args.mmio_size;
+    mmio_start =3D (1ull << 32) - dom->mmio_size;
     if (lowmem_end > mmio_start)
     {
         highmem_end =3D (1ull << 32) + (lowmem_end - mmio_start);
         lowmem_end =3D mmio_start;
     }
-    args.lowmem_end =3D lowmem_end;
-    args.highmem_end =3D highmem_end;
-    args.mmio_start =3D mmio_start;
+    dom->lowmem_end =3D lowmem_end;
+    dom->highmem_end =3D highmem_end;
+    dom->mmio_start =3D mmio_start;
 
     rc =3D libxl__domain_device_construct_rdm(gc, d_config,
                                             info->u.hvm.rdm_mem_boundary_memkb*1024,
-                                            &args);
+                                            dom);
     if (rc) {
         LOG(ERROR, "checking reserved device memory failed");
         goto out;
@@ -965,7 +999,7 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     if (info->num_vnuma_nodes !=3D 0) {
         int i;
 
-        rc =3D libxl__vnuma_build_vmemrange_hvm(gc, domid, info, state, &args);
+        rc =3D libxl__vnuma_build_vmemrange_hvm(gc, domid, info, state, dom);
         if (rc !=3D 0) {
             LOG(ERROR, "hvm build vmemranges failed");
             goto out;
@@ -975,37 +1009,34 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
         rc =3D set_vnuma_info(gc, domid, info, state);
         if (rc !=3D 0) goto out;
 
-        args.nr_vmemranges =3D state->num_vmemranges;
-        args.vmemranges =3D libxl__malloc(gc, sizeof(*args.vmemranges) *
-                                        args.nr_vmemranges);
+        dom->nr_vmemranges =3D state->num_vmemranges;
+        dom->vmemranges =3D libxl__malloc(gc, sizeof(*dom->vmemranges) *
+                                        dom->nr_vmemranges);
 
-        for (i =3D 0; i < args.nr_vmemranges; i++) {
-            args.vmemranges[i].start =3D state->vmemranges[i].start;
-            args.vmemranges[i].end   =3D state->vmemranges[i].end;
-            args.vmemranges[i].flags =3D state->vmemranges[i].flags;
-            args.vmemranges[i].nid   =3D state->vmemranges[i].nid;
+        for (i =3D 0; i < dom->nr_vmemranges; i++) {
+            dom->vmemranges[i].start =3D state->vmemranges[i].start;
+            dom->vmemranges[i].end   =3D state->vmemranges[i].end;
+            dom->vmemranges[i].flags =3D state->vmemranges[i].flags;
+            dom->vmemranges[i].nid   =3D state->vmemranges[i].nid;
         }
 
-        args.nr_vnodes =3D info->num_vnuma_nodes;
-        args.vnode_to_pnode =3D libxl__malloc(gc, sizeof(*args.vnode_to_pnode) *
-                                            args.nr_vnodes);
-        for (i =3D 0; i < args.nr_vnodes; i++)
-            args.vnode_to_pnode[i] =3D info->vnuma_nodes[i].pnode;
-    }
-
-    ret =3D xc_hvm_build(ctx->xch, domid, &args);
-    if (ret) {
-        LOGEV(ERROR, ret, "hvm building failed");
-        rc =3D ERROR_FAIL;
-        goto out;
+        dom->nr_vnodes =3D info->num_vnuma_nodes;
+        dom->vnode_to_pnode =3D libxl__malloc(gc, sizeof(*dom->vnode_to_pnode) *
+                                            dom->nr_vnodes);
+        for (i =3D 0; i < dom->nr_vnodes; i++)
+            dom->vnode_to_pnode[i] =3D info->vnuma_nodes[i].pnode;
     }
 
-    rc =3D libxl__arch_domain_construct_memmap(gc, d_config, domid, &args);
+    rc =3D libxl__arch_domain_construct_memmap(gc, d_config, domid, dom);
     if (rc !=3D 0) {
         LOG(ERROR, "setting domain memory map failed");
         goto out;
     }
 
+    rc =3D libxl__build_dom(gc, domid, info, state, dom);
+    if (rc !=3D 0)
+        goto out;
+
     rc =3D hvm_build_set_params(ctx->xch, domid, info, state->store_port,
                                &state->store_mfn, state->console_port,
                                &state->console_mfn, state->store_domid,
@@ -1015,15 +1046,18 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
         goto out;
     }
 
-    rc =3D hvm_build_set_xs_values(gc, domid, &args);
+    rc =3D hvm_build_set_xs_values(gc, domid, dom);
     if (rc !=3D 0) {
         LOG(ERROR, "hvm build set xenstore values failed");
         goto out;
     }
 
+    xc_dom_release(dom);
     return 0;
+
 out:
     assert(rc !=3D 0);
+    if (dom !=3D NULL) xc_dom_release(dom);
     return rc;
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index d035b6d..b00add0 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1609,7 +1609,7 @@ _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
 _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);
+                                   struct xc_dom_image *dom);
 
 /*
  * This function will cause the whole libxl process to hang
@@ -3773,7 +3773,7 @@ int libxl__vnuma_build_vmemrange_hvm(libxl__gc *gc,
                                      uint32_t domid,
                                      libxl_domain_build_info *b_info,
                                      libxl__domain_build_state *state,
-                                     struct xc_hvm_build_args *args);
+                                     struct xc_dom_image *dom);
 bool libxl__vnuma_configured(const libxl_domain_build_info *b_info);
 
 _hidden int libxl__ms_vm_genid_set(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl_vnuma.c b/tools/libxl/libxl_vnuma.c
index 56856d2..db22799 100644
--- a/tools/libxl/libxl_vnuma.c
+++ b/tools/libxl/libxl_vnuma.c
@@ -17,6 +17,8 @@
 #include "libxl_arch.h"
 #include <stdlib.h>
 
+#include <xc_dom.h>
+
 bool libxl__vnuma_configured(const libxl_domain_build_info *b_info)
 {
     return b_info->num_vnuma_nodes !=3D 0;
@@ -252,7 +254,7 @@ int libxl__vnuma_build_vmemrange_hvm(libxl__gc *gc,
                                      uint32_t domid,
                                      libxl_domain_build_info *b_info,
                                      libxl__domain_build_state *state,
-                                     struct xc_hvm_build_args *args)
+                                     struct xc_dom_image *dom)
 {
     uint64_t hole_start, hole_end, next;
     int nid, nr_vmemrange;
@@ -264,10 +266,10 @@ int libxl__vnuma_build_vmemrange_hvm(libxl__gc *gc,
      * Guest physical address space layout:
      * [0, hole_start) [hole_start, hole_end) [hole_end, highmem_end)
      */
-    hole_start =3D args->lowmem_end < args->mmio_start =3F
-        args->lowmem_end : args->mmio_start;
-    hole_end =3D (args->mmio_start + args->mmio_size) > (1ULL << 32) =3F
-        (args->mmio_start + args->mmio_size) : (1ULL << 32);
+    hole_start =3D dom->lowmem_end < dom->mmio_start =3F
+        dom->lowmem_end : dom->mmio_start;
+    hole_end =3D (dom->mmio_start + dom->mmio_size) > (1ULL << 32) =3F
+        (dom->mmio_start + dom->mmio_size) : (1ULL << 32);
 
     assert(state->vmemranges =3D=3D NULL);
 
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index bedd941..c992261 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -1,6 +1,8 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
+#include <xc_dom.h>
+
 int libxl__arch_domain_prepare_config(libxl__gc *gc,
                                       libxl_domain_config *d_config,
                                       xc_domain_configuration_t *xc_config)
@@ -471,7 +473,7 @@ int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
 int libxl__arch_domain_construct_memmap(libxl__gc *gc,
                                         libxl_domain_config *d_config,
                                         uint32_t domid,
-                                        struct xc_hvm_build_args *args)
+                                        struct xc_dom_image *dom)
 {
     int rc =3D 0;
     unsigned int nr =3D 0, i;
@@ -479,7 +481,7 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
     unsigned int e820_entries =3D 1;
     struct e820entry *e820 =3D NULL;
     uint64_t highmem_size =3D
-                    args->highmem_end =3F args->highmem_end - (1ull << 32) : 0;
+                    dom->highmem_end =3F dom->highmem_end - (1ull << 32) : 0;
 
     /* Add all rdm entries. */
     for (i =3D 0; i < d_config->num_rdms; i++)
@@ -501,7 +503,7 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
 
     /* Low memory */
     e820[nr].addr =3D GUEST_LOW_MEM_START_DEFAULT;
-    e820[nr].size =3D args->lowmem_end - GUEST_LOW_MEM_START_DEFAULT;
+    e820[nr].size =3D dom->lowmem_end - GUEST_LOW_MEM_START_DEFAULT;
     e820[nr].type =3D E820_RAM;
     nr++;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1H8-0001Ob-JK; Mon, 19 Oct 2015 03:38: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 1Zo1H6-0001OJ-V6
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:17 +0000
Content-Length: 24797
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	51/ED-01421-8A564265; Mon, 19 Oct 2015 03:38:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445225893!49915342!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32609 invoked from network); 19 Oct 2015 03:38:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:38:14 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1H3-0005gN-3v
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1H3-0004Rg-1t
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:13 +0000
Date: Mon, 19 Oct 2015 03:38:13 +0000
Message-Id: <E1Zo1H3-0004Rg-1t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: switch HVM domain building to
	use xc_dom_* helpers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2658985522782697062=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2658985522782697062==
Content-Length: 24951
Content-Transfer-Encoding: quoted-printable

commit 1ee15d73326a10484bc3b679582fb2000e0219fa
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:41 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    libxl: switch HVM domain building to use xc_dom_* helpers
    
    Now that we have all the code in place HVM domain building in libxl can be
    switched to use the xc_dom_* family of functions, just like they are used in
    order to build PV guests.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@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>
---
 tools/libxl/libxl_arch.h     |    2 +-
 tools/libxl/libxl_arm.c      |    2 +-
 tools/libxl/libxl_dm.c       |   18 ++--
 tools/libxl/libxl_dom.c      |  228 ++++++++++++++++++++++++------------------
 tools/libxl/libxl_internal.h |    4 +-
 tools/libxl/libxl_vnuma.c    |   12 ++-
 tools/libxl/libxl_x86.c      |    8 +-
 7 files changed, 157 insertions(+), 117 deletions(-)

diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h
index bd030b6..34a853c 100644
--- a/tools/libxl/libxl_arch.h
+++ b/tools/libxl/libxl_arch.h
@@ -60,6 +60,6 @@ _hidden
 int libxl__arch_domain_construct_memmap(libxl__gc *gc,
                                         libxl_domain_config *d_config,
                                         uint32_t domid,
-                                        struct xc_hvm_build_args *args);
+                                        struct xc_dom_image *dom);
 
 #endif
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 0af8010..1195b37 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -974,7 +974,7 @@ int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
 int libxl__arch_domain_construct_memmap(libxl__gc *gc,
                                         libxl_domain_config *d_config,
                                         uint32_t domid,
-                                        struct xc_hvm_build_args *args)
+                                        struct xc_dom_image *dom)
 {
     return 0;
 }
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index cf8b535..e33d492 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -18,6 +18,8 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
+
+#include <xc_dom.h>
 #include <xen/hvm/e820.h>
 
 static const char *libxl_tapif_script(libxl__gc *gc)
@@ -179,7 +181,7 @@ add_rdm_entry(libxl__gc *gc, libxl_domain_config *d_config,
 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)
+                                       struct xc_dom_image *dom)
 {
     int i, j, conflict, rc;
     struct xen_reserved_device_memory *xrdm =3D NULL;
@@ -187,7 +189,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
     uint16_t seg;
     uint8_t bus, devfn;
     uint64_t rdm_start, rdm_size;
-    uint64_t highmem_end =3D args->highmem_end =3F args->highmem_end : (1ull<<32);
+    uint64_t highmem_end =3D dom->highmem_end =3F dom->highmem_end : (1ull<<32);
 
     /*
      * We just want to construct RDM once since RDM is specific to the
@@ -301,7 +303,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
     for (i =3D 0; i < d_config->num_rdms; i++) {
         rdm_start =3D d_config->rdms[i].start;
         rdm_size =3D d_config->rdms[i].size;
-        conflict =3D overlaps_rdm(0, args->lowmem_end, rdm_start, rdm_size);
+        conflict =3D overlaps_rdm(0, dom->lowmem_end, rdm_start, rdm_size);
 
         if (!conflict)
             continue;
@@ -312,14 +314,14 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
              * We will move downwards lowmem_end so we have to expand
              * highmem_end.
              */
-            highmem_end +=3D (args->lowmem_end - rdm_start);
+            highmem_end +=3D (dom->lowmem_end - rdm_start);
             /* Now move downwards lowmem_end. */
-            args->lowmem_end =3D rdm_start;
+            dom->lowmem_end =3D rdm_start;
         }
     }
 
     /* Sync highmem_end. */
-    args->highmem_end =3D highmem_end;
+    dom->highmem_end =3D highmem_end;
 
     /*
      * Finally we can take same policy to check lowmem(< 2G) and
@@ -329,11 +331,11 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
         rdm_start =3D d_config->rdms[i].start;
         rdm_size =3D d_config->rdms[i].size;
         /* Does this entry conflict with lowmem=3F */
-        conflict =3D overlaps_rdm(0, args->lowmem_end,
+        conflict =3D overlaps_rdm(0, dom->lowmem_end,
                                 rdm_start, rdm_size);
         /* Does this entry conflict with highmem=3F */
         conflict |=3D overlaps_rdm((1ULL<<32),
-                                 args->highmem_end - (1ULL<<32),
+                                 dom->highmem_end - (1ULL<<32),
                                  rdm_start, rdm_size);
 
         if (!conflict)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 2b92d48..43e527a 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -601,6 +601,63 @@ static int set_vnuma_info(libxl__gc *gc, uint32_t domid,
     return rc;
 }
 
+static int libxl__build_dom(libxl__gc *gc, uint32_t domid,
+             libxl_domain_build_info *info, libxl__domain_build_state *state,
+             struct xc_dom_image *dom)
+{
+    uint64_t mem_kb;
+    int ret;
+
+    if ( (ret =3D xc_dom_boot_xen_init(dom, CTX->xch, domid)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_boot_xen_init failed");
+        goto out;
+    }
+#ifdef GUEST_RAM_BASE
+    if ( (ret =3D xc_dom_rambase_init(dom, GUEST_RAM_BASE)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_rambase failed");
+        goto out;
+    }
+#endif
+    if ( (ret =3D xc_dom_parse_image(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_parse_image failed");
+        goto out;
+    }
+    if ( (ret =3D libxl__arch_domain_init_hw_description(gc, info, state, dom)) !=3D 0 ) {
+        LOGE(ERROR, "libxl__arch_domain_init_hw_description failed");
+        goto out;
+    }
+
+    mem_kb =3D dom->container_type =3D=3D XC_DOM_HVM_CONTAINER =3F
+             (info->max_memkb - info->video_memkb) : info->target_memkb;
+    if ( (ret =3D xc_dom_mem_init(dom, mem_kb / 1024)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_mem_init failed");
+        goto out;
+    }
+    if ( (ret =3D xc_dom_boot_mem_init(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_boot_mem_init failed");
+        goto out;
+    }
+    if ( (ret =3D libxl__arch_domain_finalise_hw_description(gc, info, dom)) !=3D 0 ) {
+        LOGE(ERROR, "libxl__arch_domain_finalise_hw_description failed");
+        goto out;
+    }
+    if ( (ret =3D xc_dom_build_image(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_build_image failed");
+        goto out;
+    }
+    if ( (ret =3D xc_dom_boot_image(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_boot_image failed");
+        goto out;
+    }
+    if ( (ret =3D xc_dom_gnttab_init(dom)) !=3D 0 ) {
+        LOGE(ERROR, "xc_dom_gnttab_init failed");
+        goto out;
+    }
+
+out:
+    return ret !=3D 0 =3F ERROR_FAIL : 0;
+}
+
 int libxl__build_pv(libxl__gc *gc, uint32_t domid,
              libxl_domain_build_info *info, libxl__domain_build_state *state)
 {
@@ -691,48 +748,9 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
             dom->vnode_to_pnode[i] =3D info->vnuma_nodes[i].pnode;
     }
 
-    if ( (ret =3D xc_dom_boot_xen_init(dom, ctx->xch, domid)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_boot_xen_init failed");
-        goto out;
-    }
-#ifdef GUEST_RAM_BASE
-    if ( (ret =3D xc_dom_rambase_init(dom, GUEST_RAM_BASE)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_rambase failed");
+    ret =3D libxl__build_dom(gc, domid, info, state, dom);
+    if (ret !=3D 0)
         goto out;
-    }
-#endif
-    if ( (ret =3D xc_dom_parse_image(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_parse_image failed");
-        goto out;
-    }
-    if ( (ret =3D libxl__arch_domain_init_hw_description(gc, info, state, dom)) !=3D 0 ) {
-        LOGE(ERROR, "libxl__arch_domain_init_hw_description failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_mem_init(dom, info->target_memkb / 1024)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_mem_init failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_boot_mem_init(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_boot_mem_init failed");
-        goto out;
-    }
-    if ( (ret =3D libxl__arch_domain_finalise_hw_description(gc, info, dom)) !=3D 0 ) {
-        LOGE(ERROR, "libxl__arch_domain_finalise_hw_description failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_build_image(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_build_image failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_boot_image(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_boot_image failed");
-        goto out;
-    }
-    if ( (ret =3D xc_dom_gnttab_init(dom)) !=3D 0 ) {
-        LOGE(ERROR, "xc_dom_gnttab_init failed");
-        goto out;
-    }
 
     if (xc_dom_feature_translated(dom)) {
         state->console_mfn =3D dom->console_pfn;
@@ -792,39 +810,39 @@ static int hvm_build_set_params(xc_interface *handle, uint32_t domid,
 
 static int hvm_build_set_xs_values(libxl__gc *gc,
                                    uint32_t domid,
-                                   struct xc_hvm_build_args *args)
+                                   struct xc_dom_image *dom)
 {
     char *path =3D NULL;
     int ret =3D 0;
 
-    if (args->smbios_module.guest_addr_out) {
+    if (dom->smbios_module.guest_addr_out) {
         path =3D GCSPRINTF("/local/domain/%d/"HVM_XS_SMBIOS_PT_ADDRESS, domid);
 
         ret =3D libxl__xs_write(gc, XBT_NULL, path, "0x%"PRIx64,
-                              args->smbios_module.guest_addr_out);
+                              dom->smbios_module.guest_addr_out);
         if (ret)
             goto err;
 
         path =3D GCSPRINTF("/local/domain/%d/"HVM_XS_SMBIOS_PT_LENGTH, domid);
 
         ret =3D libxl__xs_write(gc, XBT_NULL, path, "0x%x",
-                              args->smbios_module.length);
+                              dom->smbios_module.length);
         if (ret)
             goto err;
     }
 
-    if (args->acpi_module.guest_addr_out) {
+    if (dom->acpi_module.guest_addr_out) {
         path =3D GCSPRINTF("/local/domain/%d/"HVM_XS_ACPI_PT_ADDRESS, domid);
 
         ret =3D libxl__xs_write(gc, XBT_NULL, path, "0x%"PRIx64,
-                              args->acpi_module.guest_addr_out);
+                              dom->acpi_module.guest_addr_out);
         if (ret)
             goto err;
 
         path =3D GCSPRINTF("/local/domain/%d/"HVM_XS_ACPI_PT_LENGTH, domid);
 
         ret =3D libxl__xs_write(gc, XBT_NULL, path, "0x%x",
-                              args->acpi_module.length);
+                              dom->acpi_module.length);
         if (ret)
             goto err;
     }
@@ -838,7 +856,7 @@ err:
 
 static int libxl__domain_firmware(libxl__gc *gc,
                                   libxl_domain_build_info *info,
-                                  struct xc_hvm_build_args *args)
+                                  struct xc_dom_image *dom)
 {
     libxl_ctx *ctx =3D libxl__gc_owner(gc);
     const char *firmware;
@@ -864,8 +882,13 @@ static int libxl__domain_firmware(libxl__gc *gc,
             break;
         }
     }
-    args->image_file_name =3D libxl__abs_path(gc, firmware,
-                                            libxl__xenfirmwaredir_path());
+
+    rc =3D xc_dom_kernel_file(dom, libxl__abs_path(gc, firmware,
+                                                 libxl__xenfirmwaredir_path()));
+    if (rc !=3D 0) {
+        LOGE(ERROR, "xc_dom_kernel_file failed");
+        goto out;
+    }
 
     if (info->u.hvm.smbios_firmware) {
         data =3D NULL;
@@ -879,8 +902,8 @@ static int libxl__domain_firmware(libxl__gc *gc,
         libxl__ptr_add(gc, data);
         if (datalen) {
             /* Only accept non-empty files */
-            args->smbios_module.data =3D data;
-            args->smbios_module.length =3D (uint32_t)datalen;
+            dom->smbios_module.data =3D data;
+            dom->smbios_module.length =3D (uint32_t)datalen;
         }
     }
 
@@ -896,8 +919,8 @@ static int libxl__domain_firmware(libxl__gc *gc,
         libxl__ptr_add(gc, data);
         if (datalen) {
             /* Only accept non-empty files */
-            args->acpi_module.data =3D data;
-            args->acpi_module.length =3D (uint32_t)datalen;
+            dom->acpi_module.data =3D data;
+            dom->acpi_module.length =3D (uint32_t)datalen;
         }
     }
 
@@ -911,52 +934,63 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
               libxl__domain_build_state *state)
 {
     libxl_ctx *ctx =3D libxl__gc_owner(gc);
-    struct xc_hvm_build_args args =3D {};
-    int ret, rc;
-    uint64_t mmio_start, lowmem_end, highmem_end;
+    int rc;
+    uint64_t mmio_start, lowmem_end, highmem_end, mem_size;
     libxl_domain_build_info *const info =3D &d_config->b_info;
+    struct xc_dom_image *dom =3D NULL;
+
+    xc_dom_loginit(ctx->xch);
+
+    dom =3D xc_dom_allocate(ctx->xch, NULL, NULL);
+    if (!dom) {
+        LOGE(ERROR, "xc_dom_allocate failed");
+        rc =3D ERROR_NOMEM;
+        goto out;
+    }
+
+    dom->container_type =3D XC_DOM_HVM_CONTAINER;
 
-    memset(&args, 0, sizeof(struct xc_hvm_build_args));
     /* The params from the configuration file are in Mb, which are then
      * multiplied by 1 Kb. This was then divided off when calling
      * the old xc_hvm_build_target_mem() which then turned them to bytes.
      * Do all this in one step here...
      */
-    args.mem_size =3D (uint64_t)(info->max_memkb - info->video_memkb) << 10;
-    args.mem_target =3D (uint64_t)(info->target_memkb - info->video_memkb) << 10;
-    args.claim_enabled =3D libxl_defbool_val(info->claim_mode);
+    mem_size =3D (uint64_t)(info->max_memkb - info->video_memkb) << 10;
+    dom->target_pages =3D (uint64_t)(info->target_memkb - info->video_memkb) >> 2;
+    dom->claim_enabled =3D libxl_defbool_val(info->claim_mode);
     if (info->u.hvm.mmio_hole_memkb) {
         uint64_t max_ram_below_4g =3D (1ULL << 32) -
             (info->u.hvm.mmio_hole_memkb << 10);
 
         if (max_ram_below_4g < HVM_BELOW_4G_MMIO_START)
-            args.mmio_size =3D info->u.hvm.mmio_hole_memkb << 10;
+            dom->mmio_size =3D info->u.hvm.mmio_hole_memkb << 10;
     }
 
-    rc =3D libxl__domain_firmware(gc, info, &args);
+    rc =3D libxl__domain_firmware(gc, info, dom);
     if (rc !=3D 0) {
         LOG(ERROR, "initializing domain firmware failed");
         goto out;
     }
-    if (args.mem_target =3D=3D 0)
-        args.mem_target =3D args.mem_size;
-    if (args.mmio_size =3D=3D 0)
-        args.mmio_size =3D HVM_BELOW_4G_MMIO_LENGTH;
-    lowmem_end =3D args.mem_size;
+
+    if (dom->target_pages =3D=3D 0)
+        dom->target_pages =3D mem_size >> XC_PAGE_SHIFT;
+    if (dom->mmio_size =3D=3D 0)
+        dom->mmio_size =3D HVM_BELOW_4G_MMIO_LENGTH;
+    lowmem_end =3D mem_size;
     highmem_end =3D 0;
-    mmio_start =3D (1ull << 32) - args.mmio_size;
+    mmio_start =3D (1ull << 32) - dom->mmio_size;
     if (lowmem_end > mmio_start)
     {
         highmem_end =3D (1ull << 32) + (lowmem_end - mmio_start);
         lowmem_end =3D mmio_start;
     }
-    args.lowmem_end =3D lowmem_end;
-    args.highmem_end =3D highmem_end;
-    args.mmio_start =3D mmio_start;
+    dom->lowmem_end =3D lowmem_end;
+    dom->highmem_end =3D highmem_end;
+    dom->mmio_start =3D mmio_start;
 
     rc =3D libxl__domain_device_construct_rdm(gc, d_config,
                                             info->u.hvm.rdm_mem_boundary_memkb*1024,
-                                            &args);
+                                            dom);
     if (rc) {
         LOG(ERROR, "checking reserved device memory failed");
         goto out;
@@ -965,7 +999,7 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     if (info->num_vnuma_nodes !=3D 0) {
         int i;
 
-        rc =3D libxl__vnuma_build_vmemrange_hvm(gc, domid, info, state, &args);
+        rc =3D libxl__vnuma_build_vmemrange_hvm(gc, domid, info, state, dom);
         if (rc !=3D 0) {
             LOG(ERROR, "hvm build vmemranges failed");
             goto out;
@@ -975,37 +1009,34 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
         rc =3D set_vnuma_info(gc, domid, info, state);
         if (rc !=3D 0) goto out;
 
-        args.nr_vmemranges =3D state->num_vmemranges;
-        args.vmemranges =3D libxl__malloc(gc, sizeof(*args.vmemranges) *
-                                        args.nr_vmemranges);
+        dom->nr_vmemranges =3D state->num_vmemranges;
+        dom->vmemranges =3D libxl__malloc(gc, sizeof(*dom->vmemranges) *
+                                        dom->nr_vmemranges);
 
-        for (i =3D 0; i < args.nr_vmemranges; i++) {
-            args.vmemranges[i].start =3D state->vmemranges[i].start;
-            args.vmemranges[i].end   =3D state->vmemranges[i].end;
-            args.vmemranges[i].flags =3D state->vmemranges[i].flags;
-            args.vmemranges[i].nid   =3D state->vmemranges[i].nid;
+        for (i =3D 0; i < dom->nr_vmemranges; i++) {
+            dom->vmemranges[i].start =3D state->vmemranges[i].start;
+            dom->vmemranges[i].end   =3D state->vmemranges[i].end;
+            dom->vmemranges[i].flags =3D state->vmemranges[i].flags;
+            dom->vmemranges[i].nid   =3D state->vmemranges[i].nid;
         }
 
-        args.nr_vnodes =3D info->num_vnuma_nodes;
-        args.vnode_to_pnode =3D libxl__malloc(gc, sizeof(*args.vnode_to_pnode) *
-                                            args.nr_vnodes);
-        for (i =3D 0; i < args.nr_vnodes; i++)
-            args.vnode_to_pnode[i] =3D info->vnuma_nodes[i].pnode;
-    }
-
-    ret =3D xc_hvm_build(ctx->xch, domid, &args);
-    if (ret) {
-        LOGEV(ERROR, ret, "hvm building failed");
-        rc =3D ERROR_FAIL;
-        goto out;
+        dom->nr_vnodes =3D info->num_vnuma_nodes;
+        dom->vnode_to_pnode =3D libxl__malloc(gc, sizeof(*dom->vnode_to_pnode) *
+                                            dom->nr_vnodes);
+        for (i =3D 0; i < dom->nr_vnodes; i++)
+            dom->vnode_to_pnode[i] =3D info->vnuma_nodes[i].pnode;
     }
 
-    rc =3D libxl__arch_domain_construct_memmap(gc, d_config, domid, &args);
+    rc =3D libxl__arch_domain_construct_memmap(gc, d_config, domid, dom);
     if (rc !=3D 0) {
         LOG(ERROR, "setting domain memory map failed");
         goto out;
     }
 
+    rc =3D libxl__build_dom(gc, domid, info, state, dom);
+    if (rc !=3D 0)
+        goto out;
+
     rc =3D hvm_build_set_params(ctx->xch, domid, info, state->store_port,
                                &state->store_mfn, state->console_port,
                                &state->console_mfn, state->store_domid,
@@ -1015,15 +1046,18 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
         goto out;
     }
 
-    rc =3D hvm_build_set_xs_values(gc, domid, &args);
+    rc =3D hvm_build_set_xs_values(gc, domid, dom);
     if (rc !=3D 0) {
         LOG(ERROR, "hvm build set xenstore values failed");
         goto out;
     }
 
+    xc_dom_release(dom);
     return 0;
+
 out:
     assert(rc !=3D 0);
+    if (dom !=3D NULL) xc_dom_release(dom);
     return rc;
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index d035b6d..b00add0 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1609,7 +1609,7 @@ _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
 _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);
+                                   struct xc_dom_image *dom);
 
 /*
  * This function will cause the whole libxl process to hang
@@ -3773,7 +3773,7 @@ int libxl__vnuma_build_vmemrange_hvm(libxl__gc *gc,
                                      uint32_t domid,
                                      libxl_domain_build_info *b_info,
                                      libxl__domain_build_state *state,
-                                     struct xc_hvm_build_args *args);
+                                     struct xc_dom_image *dom);
 bool libxl__vnuma_configured(const libxl_domain_build_info *b_info);
 
 _hidden int libxl__ms_vm_genid_set(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl_vnuma.c b/tools/libxl/libxl_vnuma.c
index 56856d2..db22799 100644
--- a/tools/libxl/libxl_vnuma.c
+++ b/tools/libxl/libxl_vnuma.c
@@ -17,6 +17,8 @@
 #include "libxl_arch.h"
 #include <stdlib.h>
 
+#include <xc_dom.h>
+
 bool libxl__vnuma_configured(const libxl_domain_build_info *b_info)
 {
     return b_info->num_vnuma_nodes !=3D 0;
@@ -252,7 +254,7 @@ int libxl__vnuma_build_vmemrange_hvm(libxl__gc *gc,
                                      uint32_t domid,
                                      libxl_domain_build_info *b_info,
                                      libxl__domain_build_state *state,
-                                     struct xc_hvm_build_args *args)
+                                     struct xc_dom_image *dom)
 {
     uint64_t hole_start, hole_end, next;
     int nid, nr_vmemrange;
@@ -264,10 +266,10 @@ int libxl__vnuma_build_vmemrange_hvm(libxl__gc *gc,
      * Guest physical address space layout:
      * [0, hole_start) [hole_start, hole_end) [hole_end, highmem_end)
      */
-    hole_start =3D args->lowmem_end < args->mmio_start =3F
-        args->lowmem_end : args->mmio_start;
-    hole_end =3D (args->mmio_start + args->mmio_size) > (1ULL << 32) =3F
-        (args->mmio_start + args->mmio_size) : (1ULL << 32);
+    hole_start =3D dom->lowmem_end < dom->mmio_start =3F
+        dom->lowmem_end : dom->mmio_start;
+    hole_end =3D (dom->mmio_start + dom->mmio_size) > (1ULL << 32) =3F
+        (dom->mmio_start + dom->mmio_size) : (1ULL << 32);
 
     assert(state->vmemranges =3D=3D NULL);
 
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index bedd941..c992261 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -1,6 +1,8 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
+#include <xc_dom.h>
+
 int libxl__arch_domain_prepare_config(libxl__gc *gc,
                                       libxl_domain_config *d_config,
                                       xc_domain_configuration_t *xc_config)
@@ -471,7 +473,7 @@ int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
 int libxl__arch_domain_construct_memmap(libxl__gc *gc,
                                         libxl_domain_config *d_config,
                                         uint32_t domid,
-                                        struct xc_hvm_build_args *args)
+                                        struct xc_dom_image *dom)
 {
     int rc =3D 0;
     unsigned int nr =3D 0, i;
@@ -479,7 +481,7 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
     unsigned int e820_entries =3D 1;
     struct e820entry *e820 =3D NULL;
     uint64_t highmem_size =3D
-                    args->highmem_end =3F args->highmem_end - (1ull << 32) : 0;
+                    dom->highmem_end =3F dom->highmem_end - (1ull << 32) : 0;
 
     /* Add all rdm entries. */
     for (i =3D 0; i < d_config->num_rdms; i++)
@@ -501,7 +503,7 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
 
     /* Low memory */
     e820[nr].addr =3D GUEST_LOW_MEM_START_DEFAULT;
-    e820[nr].size =3D args->lowmem_end - GUEST_LOW_MEM_START_DEFAULT;
+    e820[nr].size =3D dom->lowmem_end - GUEST_LOW_MEM_START_DEFAULT;
     e820[nr].type =3D E820_RAM;
     nr++;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1HJ-0001Q2-MQ; Mon, 19 Oct 2015 03:38: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 1Zo1HH-0001Pl-I6
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:27 +0000
Content-Length: 37555
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	67/02-03763-2B564265; Mon, 19 Oct 2015 03:38:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1445225903!17413534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17606 invoked from network); 19 Oct 2015 03:38:24 -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;
	19 Oct 2015 03:38:24 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HD-0005gV-DI
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HD-0004ST-BU
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:23 +0000
Date: Mon, 19 Oct 2015 03:38:23 +0000
Message-Id: <E1Zo1HD-0004ST-BU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove dead HVM building 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="===============7862562189870661090=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7862562189870661090==
Content-Length: 38187
Content-Transfer-Encoding: quoted-printable

commit a3d07f8262111d1edd539913a82443acf0b1a3c6
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:42 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    libxc: remove dead HVM building code
    
    Remove xc_hvm_build_x86.c and xc_hvm_build_arm.c since xc_hvm_build is not
    longer used in order to create HVM guests.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    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>
---
 tools/libxc/Makefile              |    2 -
 tools/libxc/include/xenguest.h    |   44 --
 tools/libxc/xc_hvm_build_arm.c    |   48 ---
 tools/libxc/xc_hvm_build_x86.c    |  808 -------------------------------------
 tools/libxc/xg_private.c          |    9 -
 tools/python/xen/lowlevel/xc/xc.c |   81 ----
 6 files changed, 0 insertions(+), 992 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index baaadd6..818f2e4 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -91,9 +91,7 @@ GUEST_SRCS-y                 +=3D xc_dom_compat_linux.c
 
 GUEST_SRCS-$(CONFIG_X86)     +=3D xc_dom_x86.c
 GUEST_SRCS-$(CONFIG_X86)     +=3D xc_cpuid_x86.c
-GUEST_SRCS-$(CONFIG_X86)     +=3D xc_hvm_build_x86.c
 GUEST_SRCS-$(CONFIG_ARM)     +=3D xc_dom_arm.c
-GUEST_SRCS-$(CONFIG_ARM)     +=3D xc_hvm_build_arm.c
 
 ifeq ($(CONFIG_LIBXC_MINIOS),y)
 GUEST_SRCS-y                 +=3D xc_dom_decompress_unsafe.c
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 1a1a185..ec67fbd 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -205,50 +205,6 @@ struct xc_hvm_firmware_module {
     uint64_t  guest_addr_out;
 };
 
-struct xc_hvm_build_args {
-    uint64_t mem_size;           /* Memory size in bytes. */
-    uint64_t mem_target;         /* Memory target in bytes. */
-    uint64_t mmio_size;          /* Size of the MMIO hole in bytes. */
-    const char *image_file_name; /* File name of the image to load. */
-
-    /* Extra ACPI tables passed to HVMLOADER */
-    struct xc_hvm_firmware_module acpi_module;
-
-    /* Extra SMBIOS structures passed to HVMLOADER */
-    struct xc_hvm_firmware_module smbios_module;
-    /* Whether to use claim hypercall (1 - enable, 0 - disable). */
-    int claim_enabled;
-
-    /* vNUMA information*/
-    xen_vmemrange_t *vmemranges;
-    unsigned int nr_vmemranges;
-    unsigned int *vnode_to_pnode;
-    unsigned int nr_vnodes;
-
-    /* Out parameters  */
-    uint64_t lowmem_end;
-    uint64_t highmem_end;
-    uint64_t mmio_start;
-};
-
-/**
- * Build a HVM domain.
- * @parm xch      libxc context handle.
- * @parm domid    domain ID for the new domain.
- * @parm hvm_args parameters for the new domain.
- *
- * The memory size and image file parameters are required, the rest
- * are optional.
- */
-int xc_hvm_build(xc_interface *xch, uint32_t domid,
-                 struct xc_hvm_build_args *hvm_args);
-
-int xc_hvm_build_target_mem(xc_interface *xch,
-                            uint32_t domid,
-                            int memsize,
-                            int target,
-                            const char *image_name);
-
 /*
  * Sets *lockfd to -1.
  * Has deallocated everything even on error.
diff --git a/tools/libxc/xc_hvm_build_arm.c b/tools/libxc/xc_hvm_build_arm.c
deleted file mode 100644
index 14f7c45..0000000
--- a/tools/libxc/xc_hvm_build_arm.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/******************************************************************************
- * 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, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (c) 2011, Citrix Systems
- */
-
-#include <inttypes.h>
-#include <errno.h>
-#include <xenctrl.h>
-#include <xenguest.h>
-
-int xc_hvm_build(xc_interface *xch, uint32_t domid,
-                 struct xc_hvm_build_args *hvm_args)
-{
-    errno =3D ENOSYS;
-    return -1;
-}
-
-int xc_hvm_build_target_mem(xc_interface *xch,
-                           uint32_t domid,
-                           int memsize,
-                           int target,
-                           const char *image_name)
-{
-    errno =3D ENOSYS;
-    return -1;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
deleted file mode 100644
index 4d3736b..0000000
--- a/tools/libxc/xc_hvm_build_x86.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/******************************************************************************
- * xc_hvm_build.c
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stddef.h>
-#include <inttypes.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <zlib.h>
-
-#include "xg_private.h"
-#include "xc_private.h"
-
-#include <xen/foreign/x86_32.h>
-#include <xen/foreign/x86_64.h>
-#include <xen/hvm/hvm_info_table.h>
-#include <xen/hvm/params.h>
-#include <xen/hvm/e820.h>
-
-#include <xen/libelf/libelf.h>
-
-#define SUPERPAGE_2MB_SHIFT   9
-#define SUPERPAGE_2MB_NR_PFNS (1UL << SUPERPAGE_2MB_SHIFT)
-#define SUPERPAGE_1GB_SHIFT   18
-#define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
-
-#define SPECIALPAGE_PAGING   0
-#define SPECIALPAGE_ACCESS   1
-#define SPECIALPAGE_SHARING  2
-#define SPECIALPAGE_BUFIOREQ 3
-#define SPECIALPAGE_XENSTORE 4
-#define SPECIALPAGE_IOREQ    5
-#define SPECIALPAGE_IDENT_PT 6
-#define SPECIALPAGE_CONSOLE  7
-#define NR_SPECIAL_PAGES     8
-#define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
-
-#define NR_IOREQ_SERVER_PAGES 8
-#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
-
-#define VGA_HOLE_SIZE (0x20)
-
-static int modules_init(struct xc_hvm_build_args *args,
-                        uint64_t vend, struct elf_binary *elf,
-                        uint64_t *mstart_out, uint64_t *mend_out)
-{
-#define MODULE_ALIGN 1UL << 7
-#define MB_ALIGN     1UL << 20
-#define MKALIGN(x, a) (((uint64_t)(x) + (a) - 1) & ~(uint64_t)((a) - 1))
-    uint64_t total_len =3D 0, offset1 =3D 0;
-
-    if ( (args->acpi_module.length =3D=3D 0)&&(args->smbios_module.length =3D=3D 0) )
-        return 0;
-
-    /* Find the total length for the firmware modules with a reasonable large
-     * alignment size to align each the modules.
-     */
-    total_len =3D MKALIGN(args->acpi_module.length, MODULE_ALIGN);
-    offset1 =3D total_len;
-    total_len +=3D MKALIGN(args->smbios_module.length, MODULE_ALIGN);
-
-    /* Want to place the modules 1Mb+change behind the loader image. */
-    *mstart_out =3D MKALIGN(elf->pend, MB_ALIGN) + (MB_ALIGN);
-    *mend_out =3D *mstart_out + total_len;
-
-    if ( *mend_out > vend )    
-        return -1;
-
-    if ( args->acpi_module.length !=3D 0 )
-        args->acpi_module.guest_addr_out =3D *mstart_out;
-    if ( args->smbios_module.length !=3D 0 )
-        args->smbios_module.guest_addr_out =3D *mstart_out + offset1;
-
-    return 0;
-}
-
-static void build_hvm_info(void *hvm_info_page,
-                           struct xc_hvm_build_args *args)
-{
-    struct hvm_info_table *hvm_info =3D (struct hvm_info_table *)
-        (((unsigned char *)hvm_info_page) + HVM_INFO_OFFSET);
-    uint8_t sum;
-    int i;
-
-    memset(hvm_info_page, 0, PAGE_SIZE);
-
-    /* Fill in the header. */
-    memcpy(hvm_info->signature, "HVM INFO", sizeof(hvm_info->signature));
-    hvm_info->length =3D sizeof(struct hvm_info_table);
-
-    /* Sensible defaults: these can be overridden by the caller. */
-    hvm_info->apic_mode =3D 1;
-    hvm_info->nr_vcpus =3D 1;
-    memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online));
-
-    /* Memory parameters. */
-    hvm_info->low_mem_pgend =3D args->lowmem_end >> PAGE_SHIFT;
-    hvm_info->high_mem_pgend =3D args->highmem_end >> PAGE_SHIFT;
-    hvm_info->reserved_mem_pgstart =3D ioreq_server_pfn(0);
-
-    /* Finish with the checksum. */
-    for ( i =3D 0, sum =3D 0; i < hvm_info->length; i++ )
-        sum +=3D ((uint8_t *)hvm_info)[i];
-    hvm_info->checksum =3D -sum;
-}
-
-static int loadelfimage(xc_interface *xch, struct elf_binary *elf,
-                        uint32_t dom, unsigned long *parray)
-{
-    privcmd_mmap_entry_t *entries =3D NULL;
-    unsigned long pfn_start =3D elf->pstart >> PAGE_SHIFT;
-    unsigned long pfn_end =3D (elf->pend + PAGE_SIZE - 1) >> PAGE_SHIFT;
-    size_t pages =3D pfn_end - pfn_start;
-    int i, rc =3D -1;
-
-    /* Map address space for initial elf image. */
-    entries =3D calloc(pages, sizeof(privcmd_mmap_entry_t));
-    if ( entries =3D=3D NULL )
-        goto err;
-
-    for ( i =3D 0; i < pages; i++ )
-        entries[i].mfn =3D parray[(elf->pstart >> PAGE_SHIFT) + i];
-
-    elf->dest_base =3D xc_map_foreign_ranges(
-        xch, dom, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
-        entries, pages);
-    if ( elf->dest_base =3D=3D NULL )
-        goto err;
-    elf->dest_size =3D pages * PAGE_SIZE;
-
-    ELF_ADVANCE_DEST(elf, elf->pstart & (PAGE_SIZE - 1));
-
-    /* Load the initial elf image. */
-    rc =3D elf_load_binary(elf);
-    if ( rc < 0 )
-        PERROR("Failed to load elf binary\n");
-
-    munmap(elf->dest_base, pages << PAGE_SHIFT);
-    elf->dest_base =3D NULL;
-    elf->dest_size =3D 0;
-
- err:
-    free(entries);
-
-    return rc;
-}
-
-static int loadmodules(xc_interface *xch,
-                       struct xc_hvm_build_args *args,
-                       uint64_t mstart, uint64_t mend,
-                       uint32_t dom, unsigned long *parray)
-{
-    privcmd_mmap_entry_t *entries =3D NULL;
-    unsigned long pfn_start;
-    unsigned long pfn_end;
-    size_t pages;
-    uint32_t i;
-    uint8_t *dest;
-    int rc =3D -1;
-
-    if ( (mstart =3D=3D 0)||(mend =3D=3D 0) )
-        return 0;
-
-    pfn_start =3D (unsigned long)(mstart >> PAGE_SHIFT);
-    pfn_end =3D (unsigned long)((mend + PAGE_SIZE - 1) >> PAGE_SHIFT);
-    pages =3D pfn_end - pfn_start;
-
-    /* Map address space for module list. */
-    entries =3D calloc(pages, sizeof(privcmd_mmap_entry_t));
-    if ( entries =3D=3D NULL )
-        goto error_out;
-
-    for ( i =3D 0; i < pages; i++ )
-        entries[i].mfn =3D parray[(mstart >> PAGE_SHIFT) + i];
-
-    dest =3D xc_map_foreign_ranges(
-        xch, dom, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
-        entries, pages);
-    if ( dest =3D=3D NULL )
-        goto error_out;
-
-    /* Zero the range so padding is clear between modules */
-    memset(dest, 0, pages << PAGE_SHIFT);
-
-    /* Load modules into range */    
-    if ( args->acpi_module.length !=3D 0 )
-    {
-        memcpy(dest,
-               args->acpi_module.data,
-               args->acpi_module.length);
-    }
-    if ( args->smbios_module.length !=3D 0 )
-    {
-        memcpy(dest + (args->smbios_module.guest_addr_out - mstart),
-               args->smbios_module.data,
-               args->smbios_module.length);
-    }
-
-    munmap(dest, pages << PAGE_SHIFT);
-    rc =3D 0;
-
- error_out:
-    free(entries);
-
-    return rc;
-}
-
-/*
- * Check whether there exists mmio hole in the specified memory range.
- * Returns 1 if exists, else returns 0.
- */
-static int check_mmio_hole(uint64_t start, uint64_t memsize,
-                           uint64_t mmio_start, uint64_t mmio_size)
-{
-    if ( start + memsize <=3D mmio_start || start >=3D mmio_start + mmio_size )
-        return 0;
-    else
-        return 1;
-}
-
-static int xc_hvm_populate_memory(xc_interface *xch, uint32_t dom,
-                                  struct xc_hvm_build_args *args,
-                                  xen_pfn_t *page_array)
-{
-    unsigned long i, vmemid, nr_pages =3D args->mem_size >> PAGE_SHIFT;
-    unsigned long p2m_size;
-    unsigned long target_pages =3D args->mem_target >> PAGE_SHIFT;
-    unsigned long cur_pages, cur_pfn;
-    int rc;
-    xen_capabilities_info_t caps;
-    unsigned long stat_normal_pages =3D 0, stat_2mb_pages =3D 0, 
-        stat_1gb_pages =3D 0;
-    unsigned int memflags =3D 0;
-    int claim_enabled =3D args->claim_enabled;
-    uint64_t total_pages;
-    xen_vmemrange_t dummy_vmemrange[2];
-    unsigned int dummy_vnode_to_pnode[1];
-    xen_vmemrange_t *vmemranges;
-    unsigned int *vnode_to_pnode;
-    unsigned int nr_vmemranges, nr_vnodes;
-
-    if ( nr_pages > target_pages )
-        memflags |=3D XENMEMF_populate_on_demand;
-
-    if ( args->nr_vmemranges =3D=3D 0 )
-    {
-        /* Build dummy vnode information
-         *
-         * Guest physical address space layout:
-         * [0, hole_start) [hole_start, 4G) [4G, highmem_end)
-         *
-         * Of course if there is no high memory, the second vmemrange
-         * has no effect on the actual result.
-         */
-
-        dummy_vmemrange[0].start =3D 0;
-        dummy_vmemrange[0].end   =3D args->lowmem_end;
-        dummy_vmemrange[0].flags =3D 0;
-        dummy_vmemrange[0].nid   =3D 0;
-        nr_vmemranges =3D 1;
-
-        if ( args->highmem_end > (1ULL << 32) )
-        {
-            dummy_vmemrange[1].start =3D 1ULL << 32;
-            dummy_vmemrange[1].end   =3D args->highmem_end;
-            dummy_vmemrange[1].flags =3D 0;
-            dummy_vmemrange[1].nid   =3D 0;
-
-            nr_vmemranges++;
-        }
-
-        dummy_vnode_to_pnode[0] =3D XC_NUMA_NO_NODE;
-        nr_vnodes =3D 1;
-        vmemranges =3D dummy_vmemrange;
-        vnode_to_pnode =3D dummy_vnode_to_pnode;
-    }
-    else
-    {
-        if ( nr_pages > target_pages )
-        {
-            PERROR("Cannot enable vNUMA and PoD at the same time");
-            goto error_out;
-        }
-
-        nr_vmemranges =3D args->nr_vmemranges;
-        nr_vnodes =3D args->nr_vnodes;
-        vmemranges =3D args->vmemranges;
-        vnode_to_pnode =3D args->vnode_to_pnode;
-    }
-
-    total_pages =3D 0;
-    p2m_size =3D 0;
-    for ( i =3D 0; i < nr_vmemranges; i++ )
-    {
-        total_pages +=3D ((vmemranges[i].end - vmemranges[i].start)
-                        >> PAGE_SHIFT);
-        p2m_size =3D p2m_size > (vmemranges[i].end >> PAGE_SHIFT) =3F
-            p2m_size : (vmemranges[i].end >> PAGE_SHIFT);
-    }
-
-    if ( total_pages !=3D (args->mem_size >> PAGE_SHIFT) )
-    {
-        PERROR("vNUMA memory pages mismatch (0x%"PRIx64" !=3D 0x%"PRIx64")",
-               total_pages, args->mem_size >> PAGE_SHIFT);
-        goto error_out;
-    }
-
-    if ( xc_version(xch, XENVER_capabilities, &caps) !=3D 0 )
-    {
-        PERROR("Could not get Xen capabilities");
-        goto error_out;
-    }
-
-    for ( i =3D 0; i < p2m_size; i++ )
-        page_array[i] =3D ((xen_pfn_t)-1);
-    for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
-    {
-        uint64_t pfn;
-
-        for ( pfn =3D vmemranges[vmemid].start >> PAGE_SHIFT;
-              pfn < vmemranges[vmemid].end >> PAGE_SHIFT;
-              pfn++ )
-            page_array[pfn] =3D pfn;
-    }
-
-    /*
-     * Try to claim pages for early warning of insufficient memory available.
-     * This should go before xc_domain_set_pod_target, becuase that function
-     * actually allocates memory for the guest. Claiming after memory has been
-     * allocated is pointless.
-     */
-    if ( claim_enabled ) {
-        rc =3D xc_domain_claim_pages(xch, dom, target_pages - VGA_HOLE_SIZE);
-        if ( rc !=3D 0 )
-        {
-            PERROR("Could not allocate memory for HVM guest as we cannot claim memory!");
-            goto error_out;
-        }
-    }
-
-    if ( memflags & XENMEMF_populate_on_demand )
-    {
-        /*
-         * Subtract VGA_HOLE_SIZE from target_pages for the VGA
-         * "hole".  Xen will adjust the PoD cache size so that domain
-         * tot_pages will be target_pages - VGA_HOLE_SIZE after
-         * this call.
-         */
-        rc =3D xc_domain_set_pod_target(xch, dom,
-                                      target_pages - VGA_HOLE_SIZE,
-                                      NULL, NULL, NULL);
-        if ( rc !=3D 0 )
-        {
-            PERROR("Could not set PoD target for HVM guest.\n");
-            goto error_out;
-        }
-    }
-
-    /*
-     * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
-     *
-     * We attempt to allocate 1GB pages if possible. It falls back on 2MB
-     * pages if 1GB allocation fails. 4KB pages will be used eventually if
-     * both fail.
-     * 
-     * Under 2MB mode, we allocate pages in batches of no more than 8MB to 
-     * ensure that we can be preempted and hence dom0 remains responsive.
-     */
-    rc =3D xc_domain_populate_physmap_exact(
-        xch, dom, 0xa0, 0, memflags, &page_array[0x00]);
-
-    stat_normal_pages =3D 0;
-    for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
-    {
-        unsigned int new_memflags =3D memflags;
-        uint64_t end_pages;
-        unsigned int vnode =3D vmemranges[vmemid].nid;
-        unsigned int pnode =3D vnode_to_pnode[vnode];
-
-        if ( pnode !=3D XC_NUMA_NO_NODE )
-            new_memflags |=3D XENMEMF_exact_node(pnode);
-
-        end_pages =3D vmemranges[vmemid].end >> PAGE_SHIFT;
-        /*
-         * Consider vga hole belongs to the vmemrange that covers
-         * 0xA0000-0xC0000. Note that 0x00000-0xA0000 is populated just
-         * before this loop.
-         */
-        if ( vmemranges[vmemid].start =3D=3D 0 )
-        {
-            cur_pages =3D 0xc0;
-            stat_normal_pages +=3D 0xc0;
-        }
-        else
-            cur_pages =3D vmemranges[vmemid].start >> PAGE_SHIFT;
-
-        while ( (rc =3D=3D 0) && (end_pages > cur_pages) )
-        {
-            /* Clip count to maximum 1GB extent. */
-            unsigned long count =3D end_pages - cur_pages;
-            unsigned long max_pages =3D SUPERPAGE_1GB_NR_PFNS;
-
-            if ( count > max_pages )
-                count =3D max_pages;
-
-            cur_pfn =3D page_array[cur_pages];
-
-            /* Take care the corner cases of super page tails */
-            if ( ((cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1)) !=3D 0) &&
-                 (count > (-cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1))) )
-                count =3D -cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1);
-            else if ( ((count & (SUPERPAGE_1GB_NR_PFNS-1)) !=3D 0) &&
-                      (count > SUPERPAGE_1GB_NR_PFNS) )
-                count &=3D ~(SUPERPAGE_1GB_NR_PFNS - 1);
-
-            /* Attemp to allocate 1GB super page. Because in each pass
-             * we only allocate at most 1GB, we don't have to clip
-             * super page boundaries.
-             */
-            if ( ((count | cur_pfn) & (SUPERPAGE_1GB_NR_PFNS - 1)) =3D=3D 0 &&
-                 /* Check if there exists MMIO hole in the 1GB memory
-                  * range */
-                 !check_mmio_hole(cur_pfn << PAGE_SHIFT,
-                                  SUPERPAGE_1GB_NR_PFNS << PAGE_SHIFT,
-                                  args->mmio_start, args->mmio_size) )
-            {
-                long done;
-                unsigned long nr_extents =3D count >> SUPERPAGE_1GB_SHIFT;
-                xen_pfn_t sp_extents[nr_extents];
-
-                for ( i =3D 0; i < nr_extents; i++ )
-                    sp_extents[i] =3D
-                        page_array[cur_pages+(i<<SUPERPAGE_1GB_SHIFT)];
-
-                done =3D xc_domain_populate_physmap(xch, dom, nr_extents,
-                                                  SUPERPAGE_1GB_SHIFT,
-                                                  new_memflags,
-                                                  sp_extents);
-
-                if ( done > 0 )
-                {
-                    stat_1gb_pages +=3D done;
-                    done <<=3D SUPERPAGE_1GB_SHIFT;
-                    cur_pages +=3D done;
-                    count -=3D done;
-                }
-            }
-
-            if ( count !=3D 0 )
-            {
-                /* Clip count to maximum 8MB extent. */
-                max_pages =3D SUPERPAGE_2MB_NR_PFNS * 4;
-                if ( count > max_pages )
-                    count =3D max_pages;
-
-                /* Clip partial superpage extents to superpage
-                 * boundaries. */
-                if ( ((cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1)) !=3D 0) &&
-                     (count > (-cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1))) )
-                    count =3D -cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1);
-                else if ( ((count & (SUPERPAGE_2MB_NR_PFNS-1)) !=3D 0) &&
-                          (count > SUPERPAGE_2MB_NR_PFNS) )
-                    count &=3D ~(SUPERPAGE_2MB_NR_PFNS - 1); /* clip non-s.p. tail */
-
-                /* Attempt to allocate superpage extents. */
-                if ( ((count | cur_pfn) & (SUPERPAGE_2MB_NR_PFNS - 1)) =3D=3D 0 )
-                {
-                    long done;
-                    unsigned long nr_extents =3D count >> SUPERPAGE_2MB_SHIFT;
-                    xen_pfn_t sp_extents[nr_extents];
-
-                    for ( i =3D 0; i < nr_extents; i++ )
-                        sp_extents[i] =3D
-                            page_array[cur_pages+(i<<SUPERPAGE_2MB_SHIFT)];
-
-                    done =3D xc_domain_populate_physmap(xch, dom, nr_extents,
-                                                      SUPERPAGE_2MB_SHIFT,
-                                                      new_memflags,
-                                                      sp_extents);
-
-                    if ( done > 0 )
-                    {
-                        stat_2mb_pages +=3D done;
-                        done <<=3D SUPERPAGE_2MB_SHIFT;
-                        cur_pages +=3D done;
-                        count -=3D done;
-                    }
-                }
-            }
-
-            /* Fall back to 4kB extents. */
-            if ( count !=3D 0 )
-            {
-                rc =3D xc_domain_populate_physmap_exact(
-                    xch, dom, count, 0, new_memflags, &page_array[cur_pages]);
-                cur_pages +=3D count;
-                stat_normal_pages +=3D count;
-            }
-        }
-
-        if ( rc !=3D 0 )
-            break;
-    }
-
-    if ( rc !=3D 0 )
-    {
-        PERROR("Could not allocate memory for HVM guest.");
-        goto error_out;
-    }
-
-    DPRINTF("PHYSICAL MEMORY ALLOCATION:\n");
-    DPRINTF("  4KB PAGES: 0x%016lx\n", stat_normal_pages);
-    DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
-    DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
-
-    rc =3D 0;
-    goto out;
- error_out:
-    rc =3D -1;
- out:
-
-    /* ensure no unclaimed pages are left unused */
-    xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
-
-    return rc;
-}
-
-static int xc_hvm_load_image(xc_interface *xch,
-                       uint32_t dom, struct xc_hvm_build_args *args,
-                       xen_pfn_t *page_array)
-{
-    unsigned long entry_eip, image_size;
-    struct elf_binary elf;
-    uint64_t v_start, v_end;
-    uint64_t m_start =3D 0, m_end =3D 0;
-    char *image;
-    int rc;
-
-    image =3D xc_read_image(xch, args->image_file_name, &image_size);
-    if ( image =3D=3D NULL )
-        return -1;
-
-    memset(&elf, 0, sizeof(elf));
-    if ( elf_init(&elf, image, image_size) !=3D 0 )
-        goto error_out;
-
-    xc_elf_set_logfile(xch, &elf, 1);
-
-    elf_parse_binary(&elf);
-    v_start =3D 0;
-    v_end =3D args->mem_size;
-
-    if ( modules_init(args, v_end, &elf, &m_start, &m_end) !=3D 0 )
-    {
-        ERROR("Insufficient space to load modules.");
-        goto error_out;
-    }
-
-    DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
-    DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
-    DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
-
-    if ( loadelfimage(xch, &elf, dom, page_array) !=3D 0 )
-    {
-        PERROR("Could not load ELF image");
-        goto error_out;
-    }
-
-    if ( loadmodules(xch, args, m_start, m_end, dom, page_array) !=3D 0 )
-    {
-        PERROR("Could not load ACPI modules");
-        goto error_out;
-    }
-
-    /* Insert JMP <rel32> instruction at address 0x0 to reach entry point. */
-    entry_eip =3D elf_uval(&elf, elf.ehdr, e_entry);
-    if ( entry_eip !=3D 0 )
-    {
-        char *page0 =3D xc_map_foreign_range(
-            xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, 0);
-        if ( page0 =3D=3D NULL )
-            goto error_out;
-        page0[0] =3D 0xe9;
-        *(uint32_t *)&page0[1] =3D entry_eip - 5;
-        munmap(page0, PAGE_SIZE);
-    }
-
-    rc =3D 0;
-    goto out;
- error_out:
-    rc =3D -1;
- out:
-    if ( elf_check_broken(&elf) )
-        ERROR("HVM ELF broken: %s", elf_check_broken(&elf));
-    free(image);
-
-    return rc;
-}
-
-static int xc_hvm_populate_params(xc_interface *xch, uint32_t dom,
-                                  struct xc_hvm_build_args *args)
-{
-    unsigned long i;
-    void *hvm_info_page;
-    uint32_t *ident_pt;
-    uint64_t v_end;
-    int rc;
-    xen_pfn_t special_array[NR_SPECIAL_PAGES];
-    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
-
-    v_end =3D args->mem_size;
-
-    if ( (hvm_info_page =3D xc_map_foreign_range(
-              xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
-              HVM_INFO_PFN)) =3D=3D NULL )
-    {
-        PERROR("Could not map hvm info page");
-        goto error_out;
-    }
-    build_hvm_info(hvm_info_page, args);
-    munmap(hvm_info_page, PAGE_SIZE);
-
-    /* Allocate and clear special pages. */
-    for ( i =3D 0; i < NR_SPECIAL_PAGES; i++ )
-        special_array[i] =3D special_pfn(i);
-
-    rc =3D xc_domain_populate_physmap_exact(xch, dom, NR_SPECIAL_PAGES, 0, 0,
-                                          special_array);
-    if ( rc !=3D 0 )
-    {
-        PERROR("Could not allocate special pages.");
-        goto error_out;
-    }
-
-    if ( xc_clear_domain_pages(xch, dom, special_pfn(0), NR_SPECIAL_PAGES) )
-    {
-        PERROR("Could not clear special pages");
-        goto error_out;
-    }
-
-    xc_hvm_param_set(xch, dom, HVM_PARAM_STORE_PFN,
-                     special_pfn(SPECIALPAGE_XENSTORE));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_BUFIOREQ_PFN,
-                     special_pfn(SPECIALPAGE_BUFIOREQ));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_IOREQ_PFN,
-                     special_pfn(SPECIALPAGE_IOREQ));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_CONSOLE_PFN,
-                     special_pfn(SPECIALPAGE_CONSOLE));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_PAGING_RING_PFN,
-                     special_pfn(SPECIALPAGE_PAGING));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_MONITOR_RING_PFN,
-                     special_pfn(SPECIALPAGE_ACCESS));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_SHARING_RING_PFN,
-                     special_pfn(SPECIALPAGE_SHARING));
-
-    /*
-     * Allocate and clear additional ioreq server pages. The default
-     * server will use the IOREQ and BUFIOREQ special pages above.
-     */
-    for ( i =3D 0; i < NR_IOREQ_SERVER_PAGES; i++ )
-        ioreq_server_array[i] =3D ioreq_server_pfn(i);
-
-    rc =3D xc_domain_populate_physmap_exact(xch, dom, NR_IOREQ_SERVER_PAGES, 0, 0,
-                                          ioreq_server_array);
-    if ( rc !=3D 0 )
-    {
-        PERROR("Could not allocate ioreq server pages.");
-        goto error_out;
-    }
-
-    if ( xc_clear_domain_pages(xch, dom, ioreq_server_pfn(0), NR_IOREQ_SERVER_PAGES) )
-    {
-        PERROR("Could not clear ioreq page");
-        goto error_out;
-    }
-
-    /* Tell the domain where the pages are and how many there are */
-    xc_hvm_param_set(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
-                     ioreq_server_pfn(0));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
-                     NR_IOREQ_SERVER_PAGES);
-
-    /*
-     * Identity-map page table is required for running with CR0.PG=3D0 when
-     * using Intel EPT. Create a 32-bit non-PAE page directory of superpages.
-     */
-    if ( (ident_pt =3D xc_map_foreign_range(
-              xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
-              special_pfn(SPECIALPAGE_IDENT_PT))) =3D=3D NULL )
-    {
-        PERROR("Could not map special page ident_pt");
-        goto error_out;
-    }
-    for ( i =3D 0; i < PAGE_SIZE / sizeof(*ident_pt); i++ )
-        ident_pt[i] =3D ((i << 22) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER |
-                       _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE);
-    munmap(ident_pt, PAGE_SIZE);
-    xc_hvm_param_set(xch, dom, HVM_PARAM_IDENT_PT,
-                     special_pfn(SPECIALPAGE_IDENT_PT) << PAGE_SHIFT);
-
-    rc =3D 0;
-    goto out;
- error_out:
-    rc =3D -1;
- out:
-
-    return rc;
-}
-
-/* xc_hvm_build:
- * Create a domain for a virtualized Linux, using files/filenames.
- */
-int xc_hvm_build(xc_interface *xch, uint32_t domid,
-                 struct xc_hvm_build_args *hvm_args)
-{
-    struct xc_hvm_build_args args =3D *hvm_args;
-    xen_pfn_t *parray =3D NULL;
-    int rc;
-
-    if ( domid =3D=3D 0 )
-        return -1;
-    if ( args.image_file_name =3D=3D NULL )
-        return -1;
-
-    /* An HVM guest must be initialised with at least 2MB memory. */
-    if ( args.mem_size < (2ull << 20) || args.mem_target < (2ull << 20) )
-        return -1;
-
-    parray =3D malloc((args.mem_size >> PAGE_SHIFT) * sizeof(xen_pfn_t));
-    if ( parray =3D=3D NULL )
-        return -1;
-
-    rc =3D xc_hvm_populate_memory(xch, domid, &args, parray);
-    if ( rc !=3D 0 )
-    {
-        PERROR("xc_hvm_populate_memory failed");
-        goto out;
-    }
-    rc =3D xc_hvm_load_image(xch, domid, &args, parray);
-    if ( rc !=3D 0 )
-    {
-        PERROR("xc_hvm_load_image failed");
-        goto out;
-    }
-    rc =3D xc_hvm_populate_params(xch, domid, &args);
-    if ( rc !=3D 0 )
-    {
-        PERROR("xc_hvm_populate_params failed");
-        goto out;
-    }
-
-    /* Return module load addresses to caller */
-    hvm_args->acpi_module.guest_addr_out =3D args.acpi_module.guest_addr_out;
-    hvm_args->smbios_module.guest_addr_out =3D args.smbios_module.guest_addr_out;
-
-out:
-    free(parray);
-
-    return rc;
-}
-
-/* xc_hvm_build_target_mem: 
- * Create a domain for a pre-ballooned virtualized Linux, using
- * files/filenames.  If target < memsize, domain is created with
- * memsize pages marked populate-on-demand, 
- * calculating pod cache size based on target.
- * If target =3D=3D memsize, pages are populated normally.
- */
-int xc_hvm_build_target_mem(xc_interface *xch,
-                           uint32_t domid,
-                           int memsize,
-                           int target,
-                           const char *image_name)
-{
-    struct xc_hvm_build_args args =3D {};
-
-    memset(&args, 0, sizeof(struct xc_hvm_build_args));
-    args.mem_size =3D (uint64_t)memsize << 20;
-    args.mem_target =3D (uint64_t)target << 20;
-    args.image_file_name =3D image_name;
-    if ( args.mmio_size =3D=3D 0 )
-        args.mmio_size =3D HVM_BELOW_4G_MMIO_LENGTH;
-
-    return xc_hvm_build(xch, domid, &args);
-}
-
-/*
- * 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/xg_private.c b/tools/libxc/xg_private.c
index 67946e1..d98f282 100644
--- a/tools/libxc/xg_private.c
+++ b/tools/libxc/xg_private.c
@@ -187,15 +187,6 @@ unsigned long csum_page(void *page)
     return sum ^ (sum>>32);
 }
 
-__attribute__((weak)) 
-    int xc_hvm_build(xc_interface *xch,
-                     uint32_t domid,
-                     struct xc_hvm_build_args *hvm_args)
-{
-    errno =3D ENOSYS;
-    return -1;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 67afed4..b441777 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -906,77 +906,6 @@ static PyObject *pyxc_dom_suppress_spurious_page_faults(XcObject *self,
 }
 #endif /* __i386__ || __x86_64__ */
 
-static PyObject *pyxc_hvm_build(XcObject *self,
-                                PyObject *args,
-                                PyObject *kwds)
-{
-    uint32_t dom;
-    struct hvm_info_table *va_hvm;
-    uint8_t *va_map, sum;
-    int i;
-    char *image;
-    int memsize, target=3D-1, vcpus =3D 1, acpi =3D 0, apic =3D 1;
-    PyObject *vcpu_avail_handle =3D NULL;
-    uint8_t vcpu_avail[(HVM_MAX_VCPUS + 7)/8];
-
-    static char *kwd_list[] =3D { "domid",
-                                "memsize", "image", "target", "vcpus", 
-                                "vcpu_avail", "acpi", "apic", NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiOii", kwd_list,
-                                      &dom, &memsize, &image, &target, &vcpus,
-                                      &vcpu_avail_handle, &acpi, &apic) )
-        return NULL;
-
-    memset(vcpu_avail, 0, sizeof(vcpu_avail));
-    vcpu_avail[0] =3D 1;
-    if ( vcpu_avail_handle !=3D NULL )
-    {
-        if ( PyInt_Check(vcpu_avail_handle) )
-        {
-            unsigned long v =3D PyInt_AsLong(vcpu_avail_handle);
-            for ( i =3D 0; i < sizeof(long); i++ )
-                vcpu_avail[i] =3D (uint8_t)(v>>(i*8));
-        }
-        else if ( PyLong_Check(vcpu_avail_handle) )
-        {
-            if ( _PyLong_AsByteArray((PyLongObject *)vcpu_avail_handle,
-                                     (unsigned char *)vcpu_avail,
-                                     sizeof(vcpu_avail), 1, 0) )
-                return NULL;
-        }
-        else
-        {
-            errno =3D EINVAL;
-            PyErr_SetFromErrno(xc_error_obj);
-            return NULL;
-        }
-    }
-
-    if ( target =3D=3D -1 )
-        target =3D memsize;
-
-    if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
-                                 target, image) !=3D 0 )
-        return pyxc_error_to_exception(self->xc_handle);
-
-    /* Fix up the HVM info table. */
-    va_map =3D xc_map_foreign_range(self->xc_handle, dom, XC_PAGE_SIZE,
-                                  PROT_READ | PROT_WRITE,
-                                  HVM_INFO_PFN);
-    if ( va_map =3D=3D NULL )
-        return PyErr_SetFromErrno(xc_error_obj);
-    va_hvm =3D (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->apic_mode    =3D apic;
-    va_hvm->nr_vcpus     =3D vcpus;
-    memcpy(va_hvm->vcpu_online, vcpu_avail, sizeof(vcpu_avail));
-    for ( i =3D 0, sum =3D 0; i < va_hvm->length; i++ )
-        sum +=3D ((uint8_t *)va_hvm)[i];
-    va_hvm->checksum -=3D sum;
-    munmap(va_map, XC_PAGE_SIZE);
-
-    return Py_BuildValue("{}");
-}
-
 static PyObject *pyxc_gnttab_hvm_seed(XcObject *self,
 				      PyObject *args,
 				      PyObject *kwds)
@@ -2362,16 +2291,6 @@ static PyMethodDef pyxc_methods[] =3D {
       " image   [str]:      Name of kernel image file. May be gzipped.\n"
       " cmdline [str, n/a]: Kernel parameters, if any.\n\n"},
 
-    { "hvm_build", 
-      (PyCFunction)pyxc_hvm_build, 
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Build a new HVM guest OS.\n"
-      " dom     [int]:      Identifier of domain to build into.\n"
-      " image   [str]:      Name of HVM loader image file.\n"
-      " vcpus   [int, 1]:   Number of Virtual CPUS in domain.\n\n"
-      " vcpu_avail [long, 1]: Which Virtual CPUS available.\n\n"
-      "Returns: [int] 0 on success; -1 on error.\n" },
-
     { "gnttab_hvm_seed",
       (PyCFunction)pyxc_gnttab_hvm_seed,
       METH_KEYWORDS, "\n"
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1HJ-0001Q2-MQ; Mon, 19 Oct 2015 03:38: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 1Zo1HH-0001Pl-I6
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:27 +0000
Content-Length: 37555
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	67/02-03763-2B564265; Mon, 19 Oct 2015 03:38:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1445225903!17413534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17606 invoked from network); 19 Oct 2015 03:38:24 -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;
	19 Oct 2015 03:38:24 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HD-0005gV-DI
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HD-0004ST-BU
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:23 +0000
Date: Mon, 19 Oct 2015 03:38:23 +0000
Message-Id: <E1Zo1HD-0004ST-BU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove dead HVM building 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="===============7862562189870661090=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7862562189870661090==
Content-Length: 38187
Content-Transfer-Encoding: quoted-printable

commit a3d07f8262111d1edd539913a82443acf0b1a3c6
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:42 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    libxc: remove dead HVM building code
    
    Remove xc_hvm_build_x86.c and xc_hvm_build_arm.c since xc_hvm_build is not
    longer used in order to create HVM guests.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    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>
---
 tools/libxc/Makefile              |    2 -
 tools/libxc/include/xenguest.h    |   44 --
 tools/libxc/xc_hvm_build_arm.c    |   48 ---
 tools/libxc/xc_hvm_build_x86.c    |  808 -------------------------------------
 tools/libxc/xg_private.c          |    9 -
 tools/python/xen/lowlevel/xc/xc.c |   81 ----
 6 files changed, 0 insertions(+), 992 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index baaadd6..818f2e4 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -91,9 +91,7 @@ GUEST_SRCS-y                 +=3D xc_dom_compat_linux.c
 
 GUEST_SRCS-$(CONFIG_X86)     +=3D xc_dom_x86.c
 GUEST_SRCS-$(CONFIG_X86)     +=3D xc_cpuid_x86.c
-GUEST_SRCS-$(CONFIG_X86)     +=3D xc_hvm_build_x86.c
 GUEST_SRCS-$(CONFIG_ARM)     +=3D xc_dom_arm.c
-GUEST_SRCS-$(CONFIG_ARM)     +=3D xc_hvm_build_arm.c
 
 ifeq ($(CONFIG_LIBXC_MINIOS),y)
 GUEST_SRCS-y                 +=3D xc_dom_decompress_unsafe.c
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 1a1a185..ec67fbd 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -205,50 +205,6 @@ struct xc_hvm_firmware_module {
     uint64_t  guest_addr_out;
 };
 
-struct xc_hvm_build_args {
-    uint64_t mem_size;           /* Memory size in bytes. */
-    uint64_t mem_target;         /* Memory target in bytes. */
-    uint64_t mmio_size;          /* Size of the MMIO hole in bytes. */
-    const char *image_file_name; /* File name of the image to load. */
-
-    /* Extra ACPI tables passed to HVMLOADER */
-    struct xc_hvm_firmware_module acpi_module;
-
-    /* Extra SMBIOS structures passed to HVMLOADER */
-    struct xc_hvm_firmware_module smbios_module;
-    /* Whether to use claim hypercall (1 - enable, 0 - disable). */
-    int claim_enabled;
-
-    /* vNUMA information*/
-    xen_vmemrange_t *vmemranges;
-    unsigned int nr_vmemranges;
-    unsigned int *vnode_to_pnode;
-    unsigned int nr_vnodes;
-
-    /* Out parameters  */
-    uint64_t lowmem_end;
-    uint64_t highmem_end;
-    uint64_t mmio_start;
-};
-
-/**
- * Build a HVM domain.
- * @parm xch      libxc context handle.
- * @parm domid    domain ID for the new domain.
- * @parm hvm_args parameters for the new domain.
- *
- * The memory size and image file parameters are required, the rest
- * are optional.
- */
-int xc_hvm_build(xc_interface *xch, uint32_t domid,
-                 struct xc_hvm_build_args *hvm_args);
-
-int xc_hvm_build_target_mem(xc_interface *xch,
-                            uint32_t domid,
-                            int memsize,
-                            int target,
-                            const char *image_name);
-
 /*
  * Sets *lockfd to -1.
  * Has deallocated everything even on error.
diff --git a/tools/libxc/xc_hvm_build_arm.c b/tools/libxc/xc_hvm_build_arm.c
deleted file mode 100644
index 14f7c45..0000000
--- a/tools/libxc/xc_hvm_build_arm.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/******************************************************************************
- * 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, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (c) 2011, Citrix Systems
- */
-
-#include <inttypes.h>
-#include <errno.h>
-#include <xenctrl.h>
-#include <xenguest.h>
-
-int xc_hvm_build(xc_interface *xch, uint32_t domid,
-                 struct xc_hvm_build_args *hvm_args)
-{
-    errno =3D ENOSYS;
-    return -1;
-}
-
-int xc_hvm_build_target_mem(xc_interface *xch,
-                           uint32_t domid,
-                           int memsize,
-                           int target,
-                           const char *image_name)
-{
-    errno =3D ENOSYS;
-    return -1;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
deleted file mode 100644
index 4d3736b..0000000
--- a/tools/libxc/xc_hvm_build_x86.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/******************************************************************************
- * xc_hvm_build.c
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stddef.h>
-#include <inttypes.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <zlib.h>
-
-#include "xg_private.h"
-#include "xc_private.h"
-
-#include <xen/foreign/x86_32.h>
-#include <xen/foreign/x86_64.h>
-#include <xen/hvm/hvm_info_table.h>
-#include <xen/hvm/params.h>
-#include <xen/hvm/e820.h>
-
-#include <xen/libelf/libelf.h>
-
-#define SUPERPAGE_2MB_SHIFT   9
-#define SUPERPAGE_2MB_NR_PFNS (1UL << SUPERPAGE_2MB_SHIFT)
-#define SUPERPAGE_1GB_SHIFT   18
-#define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
-
-#define SPECIALPAGE_PAGING   0
-#define SPECIALPAGE_ACCESS   1
-#define SPECIALPAGE_SHARING  2
-#define SPECIALPAGE_BUFIOREQ 3
-#define SPECIALPAGE_XENSTORE 4
-#define SPECIALPAGE_IOREQ    5
-#define SPECIALPAGE_IDENT_PT 6
-#define SPECIALPAGE_CONSOLE  7
-#define NR_SPECIAL_PAGES     8
-#define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
-
-#define NR_IOREQ_SERVER_PAGES 8
-#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
-
-#define VGA_HOLE_SIZE (0x20)
-
-static int modules_init(struct xc_hvm_build_args *args,
-                        uint64_t vend, struct elf_binary *elf,
-                        uint64_t *mstart_out, uint64_t *mend_out)
-{
-#define MODULE_ALIGN 1UL << 7
-#define MB_ALIGN     1UL << 20
-#define MKALIGN(x, a) (((uint64_t)(x) + (a) - 1) & ~(uint64_t)((a) - 1))
-    uint64_t total_len =3D 0, offset1 =3D 0;
-
-    if ( (args->acpi_module.length =3D=3D 0)&&(args->smbios_module.length =3D=3D 0) )
-        return 0;
-
-    /* Find the total length for the firmware modules with a reasonable large
-     * alignment size to align each the modules.
-     */
-    total_len =3D MKALIGN(args->acpi_module.length, MODULE_ALIGN);
-    offset1 =3D total_len;
-    total_len +=3D MKALIGN(args->smbios_module.length, MODULE_ALIGN);
-
-    /* Want to place the modules 1Mb+change behind the loader image. */
-    *mstart_out =3D MKALIGN(elf->pend, MB_ALIGN) + (MB_ALIGN);
-    *mend_out =3D *mstart_out + total_len;
-
-    if ( *mend_out > vend )    
-        return -1;
-
-    if ( args->acpi_module.length !=3D 0 )
-        args->acpi_module.guest_addr_out =3D *mstart_out;
-    if ( args->smbios_module.length !=3D 0 )
-        args->smbios_module.guest_addr_out =3D *mstart_out + offset1;
-
-    return 0;
-}
-
-static void build_hvm_info(void *hvm_info_page,
-                           struct xc_hvm_build_args *args)
-{
-    struct hvm_info_table *hvm_info =3D (struct hvm_info_table *)
-        (((unsigned char *)hvm_info_page) + HVM_INFO_OFFSET);
-    uint8_t sum;
-    int i;
-
-    memset(hvm_info_page, 0, PAGE_SIZE);
-
-    /* Fill in the header. */
-    memcpy(hvm_info->signature, "HVM INFO", sizeof(hvm_info->signature));
-    hvm_info->length =3D sizeof(struct hvm_info_table);
-
-    /* Sensible defaults: these can be overridden by the caller. */
-    hvm_info->apic_mode =3D 1;
-    hvm_info->nr_vcpus =3D 1;
-    memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online));
-
-    /* Memory parameters. */
-    hvm_info->low_mem_pgend =3D args->lowmem_end >> PAGE_SHIFT;
-    hvm_info->high_mem_pgend =3D args->highmem_end >> PAGE_SHIFT;
-    hvm_info->reserved_mem_pgstart =3D ioreq_server_pfn(0);
-
-    /* Finish with the checksum. */
-    for ( i =3D 0, sum =3D 0; i < hvm_info->length; i++ )
-        sum +=3D ((uint8_t *)hvm_info)[i];
-    hvm_info->checksum =3D -sum;
-}
-
-static int loadelfimage(xc_interface *xch, struct elf_binary *elf,
-                        uint32_t dom, unsigned long *parray)
-{
-    privcmd_mmap_entry_t *entries =3D NULL;
-    unsigned long pfn_start =3D elf->pstart >> PAGE_SHIFT;
-    unsigned long pfn_end =3D (elf->pend + PAGE_SIZE - 1) >> PAGE_SHIFT;
-    size_t pages =3D pfn_end - pfn_start;
-    int i, rc =3D -1;
-
-    /* Map address space for initial elf image. */
-    entries =3D calloc(pages, sizeof(privcmd_mmap_entry_t));
-    if ( entries =3D=3D NULL )
-        goto err;
-
-    for ( i =3D 0; i < pages; i++ )
-        entries[i].mfn =3D parray[(elf->pstart >> PAGE_SHIFT) + i];
-
-    elf->dest_base =3D xc_map_foreign_ranges(
-        xch, dom, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
-        entries, pages);
-    if ( elf->dest_base =3D=3D NULL )
-        goto err;
-    elf->dest_size =3D pages * PAGE_SIZE;
-
-    ELF_ADVANCE_DEST(elf, elf->pstart & (PAGE_SIZE - 1));
-
-    /* Load the initial elf image. */
-    rc =3D elf_load_binary(elf);
-    if ( rc < 0 )
-        PERROR("Failed to load elf binary\n");
-
-    munmap(elf->dest_base, pages << PAGE_SHIFT);
-    elf->dest_base =3D NULL;
-    elf->dest_size =3D 0;
-
- err:
-    free(entries);
-
-    return rc;
-}
-
-static int loadmodules(xc_interface *xch,
-                       struct xc_hvm_build_args *args,
-                       uint64_t mstart, uint64_t mend,
-                       uint32_t dom, unsigned long *parray)
-{
-    privcmd_mmap_entry_t *entries =3D NULL;
-    unsigned long pfn_start;
-    unsigned long pfn_end;
-    size_t pages;
-    uint32_t i;
-    uint8_t *dest;
-    int rc =3D -1;
-
-    if ( (mstart =3D=3D 0)||(mend =3D=3D 0) )
-        return 0;
-
-    pfn_start =3D (unsigned long)(mstart >> PAGE_SHIFT);
-    pfn_end =3D (unsigned long)((mend + PAGE_SIZE - 1) >> PAGE_SHIFT);
-    pages =3D pfn_end - pfn_start;
-
-    /* Map address space for module list. */
-    entries =3D calloc(pages, sizeof(privcmd_mmap_entry_t));
-    if ( entries =3D=3D NULL )
-        goto error_out;
-
-    for ( i =3D 0; i < pages; i++ )
-        entries[i].mfn =3D parray[(mstart >> PAGE_SHIFT) + i];
-
-    dest =3D xc_map_foreign_ranges(
-        xch, dom, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
-        entries, pages);
-    if ( dest =3D=3D NULL )
-        goto error_out;
-
-    /* Zero the range so padding is clear between modules */
-    memset(dest, 0, pages << PAGE_SHIFT);
-
-    /* Load modules into range */    
-    if ( args->acpi_module.length !=3D 0 )
-    {
-        memcpy(dest,
-               args->acpi_module.data,
-               args->acpi_module.length);
-    }
-    if ( args->smbios_module.length !=3D 0 )
-    {
-        memcpy(dest + (args->smbios_module.guest_addr_out - mstart),
-               args->smbios_module.data,
-               args->smbios_module.length);
-    }
-
-    munmap(dest, pages << PAGE_SHIFT);
-    rc =3D 0;
-
- error_out:
-    free(entries);
-
-    return rc;
-}
-
-/*
- * Check whether there exists mmio hole in the specified memory range.
- * Returns 1 if exists, else returns 0.
- */
-static int check_mmio_hole(uint64_t start, uint64_t memsize,
-                           uint64_t mmio_start, uint64_t mmio_size)
-{
-    if ( start + memsize <=3D mmio_start || start >=3D mmio_start + mmio_size )
-        return 0;
-    else
-        return 1;
-}
-
-static int xc_hvm_populate_memory(xc_interface *xch, uint32_t dom,
-                                  struct xc_hvm_build_args *args,
-                                  xen_pfn_t *page_array)
-{
-    unsigned long i, vmemid, nr_pages =3D args->mem_size >> PAGE_SHIFT;
-    unsigned long p2m_size;
-    unsigned long target_pages =3D args->mem_target >> PAGE_SHIFT;
-    unsigned long cur_pages, cur_pfn;
-    int rc;
-    xen_capabilities_info_t caps;
-    unsigned long stat_normal_pages =3D 0, stat_2mb_pages =3D 0, 
-        stat_1gb_pages =3D 0;
-    unsigned int memflags =3D 0;
-    int claim_enabled =3D args->claim_enabled;
-    uint64_t total_pages;
-    xen_vmemrange_t dummy_vmemrange[2];
-    unsigned int dummy_vnode_to_pnode[1];
-    xen_vmemrange_t *vmemranges;
-    unsigned int *vnode_to_pnode;
-    unsigned int nr_vmemranges, nr_vnodes;
-
-    if ( nr_pages > target_pages )
-        memflags |=3D XENMEMF_populate_on_demand;
-
-    if ( args->nr_vmemranges =3D=3D 0 )
-    {
-        /* Build dummy vnode information
-         *
-         * Guest physical address space layout:
-         * [0, hole_start) [hole_start, 4G) [4G, highmem_end)
-         *
-         * Of course if there is no high memory, the second vmemrange
-         * has no effect on the actual result.
-         */
-
-        dummy_vmemrange[0].start =3D 0;
-        dummy_vmemrange[0].end   =3D args->lowmem_end;
-        dummy_vmemrange[0].flags =3D 0;
-        dummy_vmemrange[0].nid   =3D 0;
-        nr_vmemranges =3D 1;
-
-        if ( args->highmem_end > (1ULL << 32) )
-        {
-            dummy_vmemrange[1].start =3D 1ULL << 32;
-            dummy_vmemrange[1].end   =3D args->highmem_end;
-            dummy_vmemrange[1].flags =3D 0;
-            dummy_vmemrange[1].nid   =3D 0;
-
-            nr_vmemranges++;
-        }
-
-        dummy_vnode_to_pnode[0] =3D XC_NUMA_NO_NODE;
-        nr_vnodes =3D 1;
-        vmemranges =3D dummy_vmemrange;
-        vnode_to_pnode =3D dummy_vnode_to_pnode;
-    }
-    else
-    {
-        if ( nr_pages > target_pages )
-        {
-            PERROR("Cannot enable vNUMA and PoD at the same time");
-            goto error_out;
-        }
-
-        nr_vmemranges =3D args->nr_vmemranges;
-        nr_vnodes =3D args->nr_vnodes;
-        vmemranges =3D args->vmemranges;
-        vnode_to_pnode =3D args->vnode_to_pnode;
-    }
-
-    total_pages =3D 0;
-    p2m_size =3D 0;
-    for ( i =3D 0; i < nr_vmemranges; i++ )
-    {
-        total_pages +=3D ((vmemranges[i].end - vmemranges[i].start)
-                        >> PAGE_SHIFT);
-        p2m_size =3D p2m_size > (vmemranges[i].end >> PAGE_SHIFT) =3F
-            p2m_size : (vmemranges[i].end >> PAGE_SHIFT);
-    }
-
-    if ( total_pages !=3D (args->mem_size >> PAGE_SHIFT) )
-    {
-        PERROR("vNUMA memory pages mismatch (0x%"PRIx64" !=3D 0x%"PRIx64")",
-               total_pages, args->mem_size >> PAGE_SHIFT);
-        goto error_out;
-    }
-
-    if ( xc_version(xch, XENVER_capabilities, &caps) !=3D 0 )
-    {
-        PERROR("Could not get Xen capabilities");
-        goto error_out;
-    }
-
-    for ( i =3D 0; i < p2m_size; i++ )
-        page_array[i] =3D ((xen_pfn_t)-1);
-    for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
-    {
-        uint64_t pfn;
-
-        for ( pfn =3D vmemranges[vmemid].start >> PAGE_SHIFT;
-              pfn < vmemranges[vmemid].end >> PAGE_SHIFT;
-              pfn++ )
-            page_array[pfn] =3D pfn;
-    }
-
-    /*
-     * Try to claim pages for early warning of insufficient memory available.
-     * This should go before xc_domain_set_pod_target, becuase that function
-     * actually allocates memory for the guest. Claiming after memory has been
-     * allocated is pointless.
-     */
-    if ( claim_enabled ) {
-        rc =3D xc_domain_claim_pages(xch, dom, target_pages - VGA_HOLE_SIZE);
-        if ( rc !=3D 0 )
-        {
-            PERROR("Could not allocate memory for HVM guest as we cannot claim memory!");
-            goto error_out;
-        }
-    }
-
-    if ( memflags & XENMEMF_populate_on_demand )
-    {
-        /*
-         * Subtract VGA_HOLE_SIZE from target_pages for the VGA
-         * "hole".  Xen will adjust the PoD cache size so that domain
-         * tot_pages will be target_pages - VGA_HOLE_SIZE after
-         * this call.
-         */
-        rc =3D xc_domain_set_pod_target(xch, dom,
-                                      target_pages - VGA_HOLE_SIZE,
-                                      NULL, NULL, NULL);
-        if ( rc !=3D 0 )
-        {
-            PERROR("Could not set PoD target for HVM guest.\n");
-            goto error_out;
-        }
-    }
-
-    /*
-     * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
-     *
-     * We attempt to allocate 1GB pages if possible. It falls back on 2MB
-     * pages if 1GB allocation fails. 4KB pages will be used eventually if
-     * both fail.
-     * 
-     * Under 2MB mode, we allocate pages in batches of no more than 8MB to 
-     * ensure that we can be preempted and hence dom0 remains responsive.
-     */
-    rc =3D xc_domain_populate_physmap_exact(
-        xch, dom, 0xa0, 0, memflags, &page_array[0x00]);
-
-    stat_normal_pages =3D 0;
-    for ( vmemid =3D 0; vmemid < nr_vmemranges; vmemid++ )
-    {
-        unsigned int new_memflags =3D memflags;
-        uint64_t end_pages;
-        unsigned int vnode =3D vmemranges[vmemid].nid;
-        unsigned int pnode =3D vnode_to_pnode[vnode];
-
-        if ( pnode !=3D XC_NUMA_NO_NODE )
-            new_memflags |=3D XENMEMF_exact_node(pnode);
-
-        end_pages =3D vmemranges[vmemid].end >> PAGE_SHIFT;
-        /*
-         * Consider vga hole belongs to the vmemrange that covers
-         * 0xA0000-0xC0000. Note that 0x00000-0xA0000 is populated just
-         * before this loop.
-         */
-        if ( vmemranges[vmemid].start =3D=3D 0 )
-        {
-            cur_pages =3D 0xc0;
-            stat_normal_pages +=3D 0xc0;
-        }
-        else
-            cur_pages =3D vmemranges[vmemid].start >> PAGE_SHIFT;
-
-        while ( (rc =3D=3D 0) && (end_pages > cur_pages) )
-        {
-            /* Clip count to maximum 1GB extent. */
-            unsigned long count =3D end_pages - cur_pages;
-            unsigned long max_pages =3D SUPERPAGE_1GB_NR_PFNS;
-
-            if ( count > max_pages )
-                count =3D max_pages;
-
-            cur_pfn =3D page_array[cur_pages];
-
-            /* Take care the corner cases of super page tails */
-            if ( ((cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1)) !=3D 0) &&
-                 (count > (-cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1))) )
-                count =3D -cur_pfn & (SUPERPAGE_1GB_NR_PFNS-1);
-            else if ( ((count & (SUPERPAGE_1GB_NR_PFNS-1)) !=3D 0) &&
-                      (count > SUPERPAGE_1GB_NR_PFNS) )
-                count &=3D ~(SUPERPAGE_1GB_NR_PFNS - 1);
-
-            /* Attemp to allocate 1GB super page. Because in each pass
-             * we only allocate at most 1GB, we don't have to clip
-             * super page boundaries.
-             */
-            if ( ((count | cur_pfn) & (SUPERPAGE_1GB_NR_PFNS - 1)) =3D=3D 0 &&
-                 /* Check if there exists MMIO hole in the 1GB memory
-                  * range */
-                 !check_mmio_hole(cur_pfn << PAGE_SHIFT,
-                                  SUPERPAGE_1GB_NR_PFNS << PAGE_SHIFT,
-                                  args->mmio_start, args->mmio_size) )
-            {
-                long done;
-                unsigned long nr_extents =3D count >> SUPERPAGE_1GB_SHIFT;
-                xen_pfn_t sp_extents[nr_extents];
-
-                for ( i =3D 0; i < nr_extents; i++ )
-                    sp_extents[i] =3D
-                        page_array[cur_pages+(i<<SUPERPAGE_1GB_SHIFT)];
-
-                done =3D xc_domain_populate_physmap(xch, dom, nr_extents,
-                                                  SUPERPAGE_1GB_SHIFT,
-                                                  new_memflags,
-                                                  sp_extents);
-
-                if ( done > 0 )
-                {
-                    stat_1gb_pages +=3D done;
-                    done <<=3D SUPERPAGE_1GB_SHIFT;
-                    cur_pages +=3D done;
-                    count -=3D done;
-                }
-            }
-
-            if ( count !=3D 0 )
-            {
-                /* Clip count to maximum 8MB extent. */
-                max_pages =3D SUPERPAGE_2MB_NR_PFNS * 4;
-                if ( count > max_pages )
-                    count =3D max_pages;
-
-                /* Clip partial superpage extents to superpage
-                 * boundaries. */
-                if ( ((cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1)) !=3D 0) &&
-                     (count > (-cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1))) )
-                    count =3D -cur_pfn & (SUPERPAGE_2MB_NR_PFNS-1);
-                else if ( ((count & (SUPERPAGE_2MB_NR_PFNS-1)) !=3D 0) &&
-                          (count > SUPERPAGE_2MB_NR_PFNS) )
-                    count &=3D ~(SUPERPAGE_2MB_NR_PFNS - 1); /* clip non-s.p. tail */
-
-                /* Attempt to allocate superpage extents. */
-                if ( ((count | cur_pfn) & (SUPERPAGE_2MB_NR_PFNS - 1)) =3D=3D 0 )
-                {
-                    long done;
-                    unsigned long nr_extents =3D count >> SUPERPAGE_2MB_SHIFT;
-                    xen_pfn_t sp_extents[nr_extents];
-
-                    for ( i =3D 0; i < nr_extents; i++ )
-                        sp_extents[i] =3D
-                            page_array[cur_pages+(i<<SUPERPAGE_2MB_SHIFT)];
-
-                    done =3D xc_domain_populate_physmap(xch, dom, nr_extents,
-                                                      SUPERPAGE_2MB_SHIFT,
-                                                      new_memflags,
-                                                      sp_extents);
-
-                    if ( done > 0 )
-                    {
-                        stat_2mb_pages +=3D done;
-                        done <<=3D SUPERPAGE_2MB_SHIFT;
-                        cur_pages +=3D done;
-                        count -=3D done;
-                    }
-                }
-            }
-
-            /* Fall back to 4kB extents. */
-            if ( count !=3D 0 )
-            {
-                rc =3D xc_domain_populate_physmap_exact(
-                    xch, dom, count, 0, new_memflags, &page_array[cur_pages]);
-                cur_pages +=3D count;
-                stat_normal_pages +=3D count;
-            }
-        }
-
-        if ( rc !=3D 0 )
-            break;
-    }
-
-    if ( rc !=3D 0 )
-    {
-        PERROR("Could not allocate memory for HVM guest.");
-        goto error_out;
-    }
-
-    DPRINTF("PHYSICAL MEMORY ALLOCATION:\n");
-    DPRINTF("  4KB PAGES: 0x%016lx\n", stat_normal_pages);
-    DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
-    DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
-
-    rc =3D 0;
-    goto out;
- error_out:
-    rc =3D -1;
- out:
-
-    /* ensure no unclaimed pages are left unused */
-    xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
-
-    return rc;
-}
-
-static int xc_hvm_load_image(xc_interface *xch,
-                       uint32_t dom, struct xc_hvm_build_args *args,
-                       xen_pfn_t *page_array)
-{
-    unsigned long entry_eip, image_size;
-    struct elf_binary elf;
-    uint64_t v_start, v_end;
-    uint64_t m_start =3D 0, m_end =3D 0;
-    char *image;
-    int rc;
-
-    image =3D xc_read_image(xch, args->image_file_name, &image_size);
-    if ( image =3D=3D NULL )
-        return -1;
-
-    memset(&elf, 0, sizeof(elf));
-    if ( elf_init(&elf, image, image_size) !=3D 0 )
-        goto error_out;
-
-    xc_elf_set_logfile(xch, &elf, 1);
-
-    elf_parse_binary(&elf);
-    v_start =3D 0;
-    v_end =3D args->mem_size;
-
-    if ( modules_init(args, v_end, &elf, &m_start, &m_end) !=3D 0 )
-    {
-        ERROR("Insufficient space to load modules.");
-        goto error_out;
-    }
-
-    DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
-    DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
-    DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
-
-    if ( loadelfimage(xch, &elf, dom, page_array) !=3D 0 )
-    {
-        PERROR("Could not load ELF image");
-        goto error_out;
-    }
-
-    if ( loadmodules(xch, args, m_start, m_end, dom, page_array) !=3D 0 )
-    {
-        PERROR("Could not load ACPI modules");
-        goto error_out;
-    }
-
-    /* Insert JMP <rel32> instruction at address 0x0 to reach entry point. */
-    entry_eip =3D elf_uval(&elf, elf.ehdr, e_entry);
-    if ( entry_eip !=3D 0 )
-    {
-        char *page0 =3D xc_map_foreign_range(
-            xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, 0);
-        if ( page0 =3D=3D NULL )
-            goto error_out;
-        page0[0] =3D 0xe9;
-        *(uint32_t *)&page0[1] =3D entry_eip - 5;
-        munmap(page0, PAGE_SIZE);
-    }
-
-    rc =3D 0;
-    goto out;
- error_out:
-    rc =3D -1;
- out:
-    if ( elf_check_broken(&elf) )
-        ERROR("HVM ELF broken: %s", elf_check_broken(&elf));
-    free(image);
-
-    return rc;
-}
-
-static int xc_hvm_populate_params(xc_interface *xch, uint32_t dom,
-                                  struct xc_hvm_build_args *args)
-{
-    unsigned long i;
-    void *hvm_info_page;
-    uint32_t *ident_pt;
-    uint64_t v_end;
-    int rc;
-    xen_pfn_t special_array[NR_SPECIAL_PAGES];
-    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
-
-    v_end =3D args->mem_size;
-
-    if ( (hvm_info_page =3D xc_map_foreign_range(
-              xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
-              HVM_INFO_PFN)) =3D=3D NULL )
-    {
-        PERROR("Could not map hvm info page");
-        goto error_out;
-    }
-    build_hvm_info(hvm_info_page, args);
-    munmap(hvm_info_page, PAGE_SIZE);
-
-    /* Allocate and clear special pages. */
-    for ( i =3D 0; i < NR_SPECIAL_PAGES; i++ )
-        special_array[i] =3D special_pfn(i);
-
-    rc =3D xc_domain_populate_physmap_exact(xch, dom, NR_SPECIAL_PAGES, 0, 0,
-                                          special_array);
-    if ( rc !=3D 0 )
-    {
-        PERROR("Could not allocate special pages.");
-        goto error_out;
-    }
-
-    if ( xc_clear_domain_pages(xch, dom, special_pfn(0), NR_SPECIAL_PAGES) )
-    {
-        PERROR("Could not clear special pages");
-        goto error_out;
-    }
-
-    xc_hvm_param_set(xch, dom, HVM_PARAM_STORE_PFN,
-                     special_pfn(SPECIALPAGE_XENSTORE));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_BUFIOREQ_PFN,
-                     special_pfn(SPECIALPAGE_BUFIOREQ));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_IOREQ_PFN,
-                     special_pfn(SPECIALPAGE_IOREQ));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_CONSOLE_PFN,
-                     special_pfn(SPECIALPAGE_CONSOLE));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_PAGING_RING_PFN,
-                     special_pfn(SPECIALPAGE_PAGING));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_MONITOR_RING_PFN,
-                     special_pfn(SPECIALPAGE_ACCESS));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_SHARING_RING_PFN,
-                     special_pfn(SPECIALPAGE_SHARING));
-
-    /*
-     * Allocate and clear additional ioreq server pages. The default
-     * server will use the IOREQ and BUFIOREQ special pages above.
-     */
-    for ( i =3D 0; i < NR_IOREQ_SERVER_PAGES; i++ )
-        ioreq_server_array[i] =3D ioreq_server_pfn(i);
-
-    rc =3D xc_domain_populate_physmap_exact(xch, dom, NR_IOREQ_SERVER_PAGES, 0, 0,
-                                          ioreq_server_array);
-    if ( rc !=3D 0 )
-    {
-        PERROR("Could not allocate ioreq server pages.");
-        goto error_out;
-    }
-
-    if ( xc_clear_domain_pages(xch, dom, ioreq_server_pfn(0), NR_IOREQ_SERVER_PAGES) )
-    {
-        PERROR("Could not clear ioreq page");
-        goto error_out;
-    }
-
-    /* Tell the domain where the pages are and how many there are */
-    xc_hvm_param_set(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
-                     ioreq_server_pfn(0));
-    xc_hvm_param_set(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
-                     NR_IOREQ_SERVER_PAGES);
-
-    /*
-     * Identity-map page table is required for running with CR0.PG=3D0 when
-     * using Intel EPT. Create a 32-bit non-PAE page directory of superpages.
-     */
-    if ( (ident_pt =3D xc_map_foreign_range(
-              xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
-              special_pfn(SPECIALPAGE_IDENT_PT))) =3D=3D NULL )
-    {
-        PERROR("Could not map special page ident_pt");
-        goto error_out;
-    }
-    for ( i =3D 0; i < PAGE_SIZE / sizeof(*ident_pt); i++ )
-        ident_pt[i] =3D ((i << 22) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER |
-                       _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE);
-    munmap(ident_pt, PAGE_SIZE);
-    xc_hvm_param_set(xch, dom, HVM_PARAM_IDENT_PT,
-                     special_pfn(SPECIALPAGE_IDENT_PT) << PAGE_SHIFT);
-
-    rc =3D 0;
-    goto out;
- error_out:
-    rc =3D -1;
- out:
-
-    return rc;
-}
-
-/* xc_hvm_build:
- * Create a domain for a virtualized Linux, using files/filenames.
- */
-int xc_hvm_build(xc_interface *xch, uint32_t domid,
-                 struct xc_hvm_build_args *hvm_args)
-{
-    struct xc_hvm_build_args args =3D *hvm_args;
-    xen_pfn_t *parray =3D NULL;
-    int rc;
-
-    if ( domid =3D=3D 0 )
-        return -1;
-    if ( args.image_file_name =3D=3D NULL )
-        return -1;
-
-    /* An HVM guest must be initialised with at least 2MB memory. */
-    if ( args.mem_size < (2ull << 20) || args.mem_target < (2ull << 20) )
-        return -1;
-
-    parray =3D malloc((args.mem_size >> PAGE_SHIFT) * sizeof(xen_pfn_t));
-    if ( parray =3D=3D NULL )
-        return -1;
-
-    rc =3D xc_hvm_populate_memory(xch, domid, &args, parray);
-    if ( rc !=3D 0 )
-    {
-        PERROR("xc_hvm_populate_memory failed");
-        goto out;
-    }
-    rc =3D xc_hvm_load_image(xch, domid, &args, parray);
-    if ( rc !=3D 0 )
-    {
-        PERROR("xc_hvm_load_image failed");
-        goto out;
-    }
-    rc =3D xc_hvm_populate_params(xch, domid, &args);
-    if ( rc !=3D 0 )
-    {
-        PERROR("xc_hvm_populate_params failed");
-        goto out;
-    }
-
-    /* Return module load addresses to caller */
-    hvm_args->acpi_module.guest_addr_out =3D args.acpi_module.guest_addr_out;
-    hvm_args->smbios_module.guest_addr_out =3D args.smbios_module.guest_addr_out;
-
-out:
-    free(parray);
-
-    return rc;
-}
-
-/* xc_hvm_build_target_mem: 
- * Create a domain for a pre-ballooned virtualized Linux, using
- * files/filenames.  If target < memsize, domain is created with
- * memsize pages marked populate-on-demand, 
- * calculating pod cache size based on target.
- * If target =3D=3D memsize, pages are populated normally.
- */
-int xc_hvm_build_target_mem(xc_interface *xch,
-                           uint32_t domid,
-                           int memsize,
-                           int target,
-                           const char *image_name)
-{
-    struct xc_hvm_build_args args =3D {};
-
-    memset(&args, 0, sizeof(struct xc_hvm_build_args));
-    args.mem_size =3D (uint64_t)memsize << 20;
-    args.mem_target =3D (uint64_t)target << 20;
-    args.image_file_name =3D image_name;
-    if ( args.mmio_size =3D=3D 0 )
-        args.mmio_size =3D HVM_BELOW_4G_MMIO_LENGTH;
-
-    return xc_hvm_build(xch, domid, &args);
-}
-
-/*
- * 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/xg_private.c b/tools/libxc/xg_private.c
index 67946e1..d98f282 100644
--- a/tools/libxc/xg_private.c
+++ b/tools/libxc/xg_private.c
@@ -187,15 +187,6 @@ unsigned long csum_page(void *page)
     return sum ^ (sum>>32);
 }
 
-__attribute__((weak)) 
-    int xc_hvm_build(xc_interface *xch,
-                     uint32_t domid,
-                     struct xc_hvm_build_args *hvm_args)
-{
-    errno =3D ENOSYS;
-    return -1;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 67afed4..b441777 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -906,77 +906,6 @@ static PyObject *pyxc_dom_suppress_spurious_page_faults(XcObject *self,
 }
 #endif /* __i386__ || __x86_64__ */
 
-static PyObject *pyxc_hvm_build(XcObject *self,
-                                PyObject *args,
-                                PyObject *kwds)
-{
-    uint32_t dom;
-    struct hvm_info_table *va_hvm;
-    uint8_t *va_map, sum;
-    int i;
-    char *image;
-    int memsize, target=3D-1, vcpus =3D 1, acpi =3D 0, apic =3D 1;
-    PyObject *vcpu_avail_handle =3D NULL;
-    uint8_t vcpu_avail[(HVM_MAX_VCPUS + 7)/8];
-
-    static char *kwd_list[] =3D { "domid",
-                                "memsize", "image", "target", "vcpus", 
-                                "vcpu_avail", "acpi", "apic", NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiOii", kwd_list,
-                                      &dom, &memsize, &image, &target, &vcpus,
-                                      &vcpu_avail_handle, &acpi, &apic) )
-        return NULL;
-
-    memset(vcpu_avail, 0, sizeof(vcpu_avail));
-    vcpu_avail[0] =3D 1;
-    if ( vcpu_avail_handle !=3D NULL )
-    {
-        if ( PyInt_Check(vcpu_avail_handle) )
-        {
-            unsigned long v =3D PyInt_AsLong(vcpu_avail_handle);
-            for ( i =3D 0; i < sizeof(long); i++ )
-                vcpu_avail[i] =3D (uint8_t)(v>>(i*8));
-        }
-        else if ( PyLong_Check(vcpu_avail_handle) )
-        {
-            if ( _PyLong_AsByteArray((PyLongObject *)vcpu_avail_handle,
-                                     (unsigned char *)vcpu_avail,
-                                     sizeof(vcpu_avail), 1, 0) )
-                return NULL;
-        }
-        else
-        {
-            errno =3D EINVAL;
-            PyErr_SetFromErrno(xc_error_obj);
-            return NULL;
-        }
-    }
-
-    if ( target =3D=3D -1 )
-        target =3D memsize;
-
-    if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
-                                 target, image) !=3D 0 )
-        return pyxc_error_to_exception(self->xc_handle);
-
-    /* Fix up the HVM info table. */
-    va_map =3D xc_map_foreign_range(self->xc_handle, dom, XC_PAGE_SIZE,
-                                  PROT_READ | PROT_WRITE,
-                                  HVM_INFO_PFN);
-    if ( va_map =3D=3D NULL )
-        return PyErr_SetFromErrno(xc_error_obj);
-    va_hvm =3D (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->apic_mode    =3D apic;
-    va_hvm->nr_vcpus     =3D vcpus;
-    memcpy(va_hvm->vcpu_online, vcpu_avail, sizeof(vcpu_avail));
-    for ( i =3D 0, sum =3D 0; i < va_hvm->length; i++ )
-        sum +=3D ((uint8_t *)va_hvm)[i];
-    va_hvm->checksum -=3D sum;
-    munmap(va_map, XC_PAGE_SIZE);
-
-    return Py_BuildValue("{}");
-}
-
 static PyObject *pyxc_gnttab_hvm_seed(XcObject *self,
 				      PyObject *args,
 				      PyObject *kwds)
@@ -2362,16 +2291,6 @@ static PyMethodDef pyxc_methods[] =3D {
       " image   [str]:      Name of kernel image file. May be gzipped.\n"
       " cmdline [str, n/a]: Kernel parameters, if any.\n\n"},
 
-    { "hvm_build", 
-      (PyCFunction)pyxc_hvm_build, 
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Build a new HVM guest OS.\n"
-      " dom     [int]:      Identifier of domain to build into.\n"
-      " image   [str]:      Name of HVM loader image file.\n"
-      " vcpus   [int, 1]:   Number of Virtual CPUS in domain.\n\n"
-      " vcpu_avail [long, 1]: Which Virtual CPUS available.\n\n"
-      "Returns: [int] 0 on success; -1 on error.\n" },
-
     { "gnttab_hvm_seed",
       (PyCFunction)pyxc_gnttab_hvm_seed,
       METH_KEYWORDS, "\n"
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1HQ-0001Ra-SD; Mon, 19 Oct 2015 03:38:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HP-0001RN-VY
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:36 +0000
Content-Length: 2431
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	08/0E-01421-BB564265; Mon, 19 Oct 2015 03:38:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1445225913!51887510!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30495 invoked from network); 19 Oct 2015 03:38:34 -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;
	19 Oct 2015 03:38:34 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HN-0005gd-On
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HN-0004TE-Lm
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:33 +0000
Date: Mon, 19 Oct 2015 03:38:33 +0000
Message-Id: <E1Zo1HN-0004TE-Lm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsole: try to attach to PV
	console if HVM fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7972475586193648485=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7972475586193648485==
Content-Length: 2034
Content-Transfer-Encoding: quoted-printable

commit 96b4f77a55833895677cf4b4a33fc50c7b3da032
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:59 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    xenconsole: try to attach to PV console if HVM fails
    
    HVM guests have always used the emulated serial console by default, but if
    the emulated serial pty cannot be fetched from xenstore try to use the PV
    console instead.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@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>
---
 tools/console/client/main.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index f130a60..d006fdc 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -333,7 +333,7 @@ int main(int argc, char **argv)
 		{ 0 },
 
 	};
-	char *dom_path =3D NULL, *path =3D NULL;
+	char *dom_path =3D NULL, *path =3D NULL, *test =3D NULL;
 	int spty, xsfd;
 	struct xs_handle *xs;
 	char *end;
@@ -415,9 +415,15 @@ int main(int argc, char **argv)
 	path =3D malloc(strlen(dom_path) + strlen("/device/console/0/tty") + 5);
 	if (path =3D=3D NULL)
 		err(ENOMEM, "malloc");
-	if (type =3D=3D CONSOLE_SERIAL)
+	if (type =3D=3D CONSOLE_SERIAL) {
 		snprintf(path, strlen(dom_path) + strlen("/serial/0/tty") + 5, "%s/serial/%d/tty", dom_path, num);
-	else {
+		test =3D xs_read(xs, XBT_NULL, path, NULL);
+		free(test);
+		if (test =3D=3D NULL)
+			type =3D CONSOLE_PV;
+	}
+	if (type =3D=3D CONSOLE_PV) {
+
 		if (num =3D=3D 0)
 			snprintf(path, strlen(dom_path) + strlen("/console/tty") + 1, "%s/console/tty", dom_path);
 		else
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1HQ-0001Ra-SD; Mon, 19 Oct 2015 03:38:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HP-0001RN-VY
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:36 +0000
Content-Length: 2431
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	08/0E-01421-BB564265; Mon, 19 Oct 2015 03:38:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1445225913!51887510!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30495 invoked from network); 19 Oct 2015 03:38:34 -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;
	19 Oct 2015 03:38:34 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HN-0005gd-On
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HN-0004TE-Lm
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:33 +0000
Date: Mon, 19 Oct 2015 03:38:33 +0000
Message-Id: <E1Zo1HN-0004TE-Lm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsole: try to attach to PV
	console if HVM fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7972475586193648485=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7972475586193648485==
Content-Length: 2034
Content-Transfer-Encoding: quoted-printable

commit 96b4f77a55833895677cf4b4a33fc50c7b3da032
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 17:48:59 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    xenconsole: try to attach to PV console if HVM fails
    
    HVM guests have always used the emulated serial console by default, but if
    the emulated serial pty cannot be fetched from xenstore try to use the PV
    console instead.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@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>
---
 tools/console/client/main.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index f130a60..d006fdc 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -333,7 +333,7 @@ int main(int argc, char **argv)
 		{ 0 },
 
 	};
-	char *dom_path =3D NULL, *path =3D NULL;
+	char *dom_path =3D NULL, *path =3D NULL, *test =3D NULL;
 	int spty, xsfd;
 	struct xs_handle *xs;
 	char *end;
@@ -415,9 +415,15 @@ int main(int argc, char **argv)
 	path =3D malloc(strlen(dom_path) + strlen("/device/console/0/tty") + 5);
 	if (path =3D=3D NULL)
 		err(ENOMEM, "malloc");
-	if (type =3D=3D CONSOLE_SERIAL)
+	if (type =3D=3D CONSOLE_SERIAL) {
 		snprintf(path, strlen(dom_path) + strlen("/serial/0/tty") + 5, "%s/serial/%d/tty", dom_path, num);
-	else {
+		test =3D xs_read(xs, XBT_NULL, path, NULL);
+		free(test);
+		if (test =3D=3D NULL)
+			type =3D CONSOLE_PV;
+	}
+	if (type =3D=3D CONSOLE_PV) {
+
 		if (num =3D=3D 0)
 			snprintf(path, strlen(dom_path) + strlen("/console/tty") + 1, "%s/console/tty", dom_path);
 		else
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:38:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1Hb-0001TL-Vy; Mon, 19 Oct 2015 03:38:47 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hb-0001TA-6U
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:47 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	98/8C-18886-6C564265; Mon, 19 Oct 2015 03:38:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445225924!23360405!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24619 invoked from network); 19 Oct 2015 03:38:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:38:45 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HY-0005gl-3F
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HY-0004US-13
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:44 +0000
Date: Mon, 19 Oct 2015 03:38:44 +0000
Message-Id: <E1Zo1HY-0004US-13@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: remove mmio_check_t
	typedef
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit be8412ae5a0214554c5affc00625bc91eb37f81b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:03 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    xen/arm: io: remove mmio_check_t typedef
    
    This typedef is a left-over of the previous MMIO emulation
    implementation.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/mmio.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index 1cd7a7a..d9b5da4 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -34,7 +34,6 @@ typedef struct
 
 typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info, void *priv);
 typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info, void *priv);
-typedef int (*mmio_check_t)(struct vcpu *v, paddr_t addr);
 
 struct mmio_handler_ops {
     mmio_read_t read;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:38:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:38: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 1Zo1Hb-0001TL-Vy; Mon, 19 Oct 2015 03:38:47 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hb-0001TA-6U
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:47 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	98/8C-18886-6C564265; Mon, 19 Oct 2015 03:38:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445225924!23360405!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24619 invoked from network); 19 Oct 2015 03:38:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:38:45 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HY-0005gl-3F
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1HY-0004US-13
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:44 +0000
Date: Mon, 19 Oct 2015 03:38:44 +0000
Message-Id: <E1Zo1HY-0004US-13@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: remove mmio_check_t
	typedef
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit be8412ae5a0214554c5affc00625bc91eb37f81b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:03 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    xen/arm: io: remove mmio_check_t typedef
    
    This typedef is a left-over of the previous MMIO emulation
    implementation.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/mmio.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index 1cd7a7a..d9b5da4 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -34,7 +34,6 @@ typedef struct
 
 typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info, void *priv);
 typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info, void *priv);
-typedef int (*mmio_check_t)(struct vcpu *v, paddr_t addr);
 
 struct mmio_handler_ops {
     mmio_read_t read;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1Hs-0001VS-2Q; Mon, 19 Oct 2015 03:39:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hr-0001VJ-At
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:03 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	42/DE-31450-6D564265; Mon, 19 Oct 2015 03:39:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445225939!43128138!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 4796 invoked from network); 19 Oct 2015 03:39:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:00 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hi-0005gt-GN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hi-0004VM-D1
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:54 +0000
Date: Mon, 19 Oct 2015 03:38:54 +0000
Message-Id: <E1Zo1Hi-0004VM-D1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: Extend write/read handler
	to pass the register in 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 687a3f53bdd81d28302e82dd542f2e2a790e5f69
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:04 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    xen/arm: io: Extend write/read handler to pass the register in parameter
    
    Rather than letting each handler to retrieve the register used by the
    I/O access, add a new parameter to pass the register in parameter.
    
    This will help to implement generic register manipulation on I/O access
    such as sign-extension and endianess.
    
    Read handlers need to modify the value of the register, so a pointer to
    it is given in argument. Write handlers shouldn't modify the register,
    therefore only a plain value is given.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c          |    7 ++-
 xen/arch/arm/vgic-v2.c     |   44 +++++++++----------
 xen/arch/arm/vgic-v3.c     |  101 +++++++++++++++++++------------------------
 xen/arch/arm/vuart.c       |   20 ++++-----
 xen/include/asm-arm/mmio.h |    6 ++-
 5 files changed, 83 insertions(+), 95 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index b418173..ffe7c21 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -29,6 +29,9 @@ int handle_mmio(mmio_info_t *info)
     int i;
     const struct mmio_handler *handler = NULL;
     const struct vmmio *vmmio = &v->domain->arch.vmmio;
+    struct hsr_dabt dabt = info->dabt;
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
+    register_t *r = select_user_reg(regs, dabt.reg);
 
     for ( i = 0; i < vmmio->num_entries; i++ )
     {
@@ -43,9 +46,9 @@ int handle_mmio(mmio_info_t *info)
         return 0;
 
     if ( info->dabt.write )
-        return handler->ops->write(v, info, handler->priv);
+        return handler->ops->write(v, info, *r, handler->priv);
     else
-        return handler->ops->read(v, info, handler->priv);
+        return handler->ops->read(v, info, r, handler->priv);
 }
 
 void register_mmio_handler(struct domain *d,
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 309d579..dc2c2d2 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -51,11 +51,9 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t vbase)
 }
 
 static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                   void *priv)
+                                   register_t *r, void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
     unsigned long flags;
@@ -249,11 +247,9 @@ static int vgic_v2_to_sgi(struct vcpu *v, register_t sgir)
 }
 
 static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                    void *priv)
+                                    register_t r, void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
     uint32_t tr;
@@ -267,7 +263,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Ignore all but the enable bit */
         vgic_lock(v);
-        v->domain->arch.vgic.ctlr = (*r) & GICD_CTL_ENABLE;
+        v->domain->arch.vgic.ctlr = r & GICD_CTL_ENABLE;
         vgic_unlock(v);
 
         return 1;
@@ -291,11 +287,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable |= *r;
+        rank->ienable |= r;
         /* The virtual irq is derived from register offset.
          * The register difference is word difference. So divide by 2(DABT_WORD)
          * to get Virtual irq number */
-        vgic_enable_irqs(v, (*r) & (~tr),
+        vgic_enable_irqs(v, r & (~tr),
                          (gicd_reg - GICD_ISENABLER) >> DABT_WORD);
         vgic_unlock_rank(v, rank, flags);
         return 1;
@@ -306,11 +302,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable &= ~*r;
+        rank->ienable &= ~r;
         /* The virtual irq is derived from register offset.
          * The register difference is word difference. So divide by 2(DABT_WORD)
          * to get  Virtual irq number */
-        vgic_disable_irqs(v, (*r) & tr,
+        vgic_disable_irqs(v, r & tr,
                          (gicd_reg - GICD_ICENABLER) >> DABT_WORD);
         vgic_unlock_rank(v, rank, flags);
         return 1;
@@ -319,28 +315,28 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, *r, gicd_reg - GICD_ISPENDR);
+               v, r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICPENDR%d\n",
-               v, *r, gicd_reg - GICD_ICPENDR);
+               v, r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ISACTIVER%d\n",
-               v, *r, gicd_reg - GICD_ISACTIVER);
+               v, r, gicd_reg - GICD_ISACTIVER);
         return 0;
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
-               v, *r, gicd_reg - GICD_ICACTIVER);
+               v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
     case GICD_ITARGETSR ... GICD_ITARGETSR + 7:
@@ -362,7 +358,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
             target = target | (target << 8) | (target << 16) | (target << 24);
         else
             target = (target << (8 * (gicd_reg & 0x3)));
-        target &= *r;
+        target &= r;
         /* ignore zero writes */
         if ( !target )
             goto write_ignore;
@@ -410,10 +406,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
             rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                           DABT_WORD)] = *r;
+                                           DABT_WORD)] = r;
         else
             vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
-                        gicd_reg - GICD_IPRIORITYR, DABT_WORD)], *r, gicd_reg);
+                        gicd_reg - GICD_IPRIORITYR, DABT_WORD)], r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -427,7 +423,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)] = *r;
+        rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)] = r;
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -437,20 +433,20 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case GICD_SGIR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        return vgic_v2_to_sgi(v, *r);
+        return vgic_v2_to_sgi(v, r);
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+               v, dabt.size ? "word" : "byte", r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+               v, dabt.size ? "word" : "byte", r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -477,14 +473,14 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               v, dabt.reg, *r, gicd_reg);
+               v, dabt.reg, r, gicd_reg);
         return 0;
     }
 
 bad_width:
     printk(XENLOG_G_ERR
            "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           v, dabt.size, dabt.reg, *r, gicd_reg);
+           v, dabt.size, dabt.reg, r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index beb3621..2a09f86 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -104,11 +104,10 @@ static struct vcpu *vgic_v3_get_target_vcpu(struct vcpu *v, unsigned int irq)
 }
 
 static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                         uint32_t gicr_reg)
+                                         uint32_t gicr_reg,
+                                         register_t *r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     uint64_t aff;
 
     switch ( gicr_reg )
@@ -215,11 +214,10 @@ read_as_zero_32:
 }
 
 static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                          uint32_t gicr_reg)
+                                          uint32_t gicr_reg,
+                                          register_t r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
 
     switch ( gicr_reg )
     {
@@ -276,7 +274,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
 bad_width:
     printk(XENLOG_G_ERR
           "%pv: vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-          v, dabt.size, dabt.reg, *r, gicr_reg);
+          v, dabt.size, dabt.reg, r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -290,11 +288,10 @@ write_ignore_32:
 }
 
 static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
-                                            mmio_info_t *info, uint32_t reg)
+                                            mmio_info_t *info, uint32_t reg,
+                                            register_t *r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     unsigned long flags;
 
@@ -369,11 +366,10 @@ read_as_zero:
 }
 
 static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
-                                             mmio_info_t *info, uint32_t reg)
+                                             mmio_info_t *info, uint32_t reg,
+                                             register_t r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     uint32_t tr;
     unsigned long flags;
@@ -389,9 +385,9 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable |= *r;
+        rank->ienable |= r;
         /* The irq number is extracted from offset. so shift by register size */
-        vgic_enable_irqs(v, (*r) & (~tr), (reg - GICD_ISENABLER) >> DABT_WORD);
+        vgic_enable_irqs(v, r & (~tr), (reg - GICD_ISENABLER) >> DABT_WORD);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICENABLER ... GICD_ICENABLERN:
@@ -400,37 +396,37 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable &= ~*r;
+        rank->ienable &= ~r;
         /* The irq number is extracted from offset. so shift by register size */
-        vgic_disable_irqs(v, (*r) & tr, (reg - GICD_ICENABLER) >> DABT_WORD);
+        vgic_disable_irqs(v, r & tr, (reg - GICD_ICENABLER) >> DABT_WORD);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, name, *r, reg - GICD_ISPENDR);
+               v, name, r, reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICPENDR%d\n",
-               v, name, *r, reg - GICD_ICPENDR);
+               v, name, r, reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ISACTIVER%d\n",
-               v, name, *r, reg - GICD_ISACTIVER);
+               v, name, r, reg - GICD_ISACTIVER);
         return 0;
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
-               v, name, *r, reg - GICD_ICACTIVER);
+               v, name, r, reg - GICD_ICACTIVER);
         return 0;
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
@@ -440,10 +436,10 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
             rank->ipriority[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                           DABT_WORD)] = *r;
+                                           DABT_WORD)] = r;
         else
             vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
-                       reg - GICD_IPRIORITYR, DABT_WORD)], *r, reg);
+                       reg - GICD_IPRIORITYR, DABT_WORD)], r, reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICFGR: /* Restricted to configure SGIs */
@@ -455,20 +451,20 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 2, reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)] = *r;
+        rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)] = r;
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               v, name, dabt.reg, *r, reg);
+               v, name, dabt.reg, r, reg);
         return 0;
     }
 
 bad_width:
     printk(XENLOG_G_ERR
            "%pv: %s: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           v, name, dabt.size, dabt.reg, *r, reg);
+           v, name, dabt.size, dabt.reg, r, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -479,11 +475,9 @@ write_ignore:
 }
 
 static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                        uint32_t gicr_reg)
+                                        uint32_t gicr_reg, register_t *r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
 
     switch ( gicr_reg )
     {
@@ -502,7 +496,7 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
           * So handle in common with GICD handling
           */
         return __vgic_v3_distr_common_mmio_read("vGICR: SGI", v, info,
-                                                gicr_reg);
+                                                gicr_reg, r);
 
     /* Read the pending status of an SGI is via GICR is not supported */
     case GICR_ISPENDR0:
@@ -533,11 +527,9 @@ read_as_zero:
 }
 
 static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                         uint32_t gicr_reg)
+                                         uint32_t gicr_reg, register_t r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
 
     switch ( gicr_reg )
     {
@@ -556,19 +548,19 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
           * So handle common with GICD handling
           */
         return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v,
-                                                 info, gicr_reg);
+                                                 info, gicr_reg, r);
     case GICR_ISPENDR0:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ISPENDR0\n",
-               v, *r);
+               v, r);
         return 0;
 
     case GICR_ICPENDR0:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ICPENDR0\n",
-               v, *r);
+               v, r);
         return 0;
 
     case GICR_NSACR:
@@ -584,7 +576,7 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
 bad_width:
     printk(XENLOG_G_ERR
            "%pv: vGICR: SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           v, dabt.size, dabt.reg, *r, gicr_reg);
+           v, dabt.size, dabt.reg, r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -613,7 +605,7 @@ static struct vcpu *get_vcpu_from_rdist(struct domain *d,
 }
 
 static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                    void *priv)
+                                    register_t *r, void *priv)
 {
     uint32_t offset;
     const struct vgic_rdist_region *region = priv;
@@ -625,9 +617,9 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 0;
 
     if ( offset < SZ_64K )
-        return __vgic_v3_rdistr_rd_mmio_read(v, info, offset);
+        return __vgic_v3_rdistr_rd_mmio_read(v, info, offset, r);
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
-        return vgic_v3_rdistr_sgi_mmio_read(v, info, (offset - SZ_64K));
+        return vgic_v3_rdistr_sgi_mmio_read(v, info, (offset - SZ_64K), r);
     else
         printk(XENLOG_G_WARNING
                "%pv: vGICR: unknown gpa read address %"PRIpaddr"\n",
@@ -637,7 +629,7 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
 }
 
 static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                     void *priv)
+                                     register_t r, void *priv)
 {
     uint32_t offset;
     const struct vgic_rdist_region *region = priv;
@@ -649,9 +641,9 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 0;
 
     if ( offset < SZ_64K )
-        return __vgic_v3_rdistr_rd_mmio_write(v, info, offset);
+        return __vgic_v3_rdistr_rd_mmio_write(v, info, offset, r);
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
-        return vgic_v3_rdistr_sgi_mmio_write(v, info, (offset - SZ_64K));
+        return vgic_v3_rdistr_sgi_mmio_write(v, info, (offset - SZ_64K), r);
     else
         printk(XENLOG_G_WARNING
                "%pv: vGICR: unknown gpa write address %"PRIpaddr"\n",
@@ -661,11 +653,9 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
 }
 
 static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                   void *priv)
+                                   register_t *r, void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     unsigned long flags;
     int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
@@ -728,7 +718,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          * Above all register are common with GICR and GICD
          * Manage in common
          */
-        return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg);
+        return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
     case GICD_IROUTER ... GICD_IROUTER31:
         /* SGI/PPI is RES0 */
         goto read_as_zero_64;
@@ -819,11 +809,9 @@ read_as_zero:
 }
 
 static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                    void *priv)
+                                    register_t r, void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     unsigned long flags;
     uint64_t new_irouter, old_irouter;
@@ -839,7 +827,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
         vgic_lock(v);
         /* Only EnableGrp1A can be changed */
-        if ( *r & GICD_CTLR_ENABLE_G1A )
+        if ( r & GICD_CTLR_ENABLE_G1A )
             v->domain->arch.vgic.ctlr |= GICD_CTLR_ENABLE_G1A;
         else
             v->domain->arch.vgic.ctlr &= ~GICD_CTLR_ENABLE_G1A;
@@ -885,7 +873,8 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     case GICD_ICFGR ... GICD_ICFGRN:
         /* Above registers are common with GICR and GICD
          * Manage in common */
-        return __vgic_v3_distr_common_mmio_write("vGICD", v, info, gicd_reg);
+        return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
+                                                 gicd_reg, r);
     case GICD_IROUTER ... GICD_IROUTER31:
         /* SGI/PPI is RES0 */
         goto write_ignore_64;
@@ -894,7 +883,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto write_ignore;
-        new_irouter = *r;
+        new_irouter = r;
         vgic_lock_rank(v, rank, flags);
 
         old_irouter = rank->v3.irouter[REG_RANK_INDEX(64,
@@ -907,7 +896,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         {
             printk(XENLOG_G_DEBUG
                    "%pv: vGICD: wrong irouter at offset %#08x val %#"PRIregister,
-                   v, gicd_reg, *r);
+                   v, gicd_reg, r);
             vgic_unlock_rank(v, rank, flags);
             /*
              * TODO: Don't inject a fault to the guest when the MPIDR is
@@ -953,14 +942,14 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               v, dabt.reg, *r, gicd_reg);
+               v, dabt.reg, r, gicd_reg);
         return 0;
     }
 
 bad_width:
     printk(XENLOG_G_ERR
            "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           v, dabt.size, dabt.reg, *r, gicd_reg);
+           v, dabt.size, dabt.reg, r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
diff --git a/xen/arch/arm/vuart.c b/xen/arch/arm/vuart.c
index 2495e87..b5c9288 100644
--- a/xen/arch/arm/vuart.c
+++ b/xen/arch/arm/vuart.c
@@ -45,8 +45,10 @@
 
 #define domain_has_vuart(d) ((d)->arch.vuart.info != NULL)
 
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv);
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv);
+static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
+                           register_t *r, void *priv);
+static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
+                            register_t r, void *priv);
 
 static const struct mmio_handler_ops vuart_mmio_handler = {
     .read  = vuart_mmio_read,
@@ -106,12 +108,10 @@ static void vuart_print_char(struct vcpu *v, char c)
     spin_unlock(&uart->lock);
 }
 
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv)
+static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
+                           register_t *r, void *priv)
 {
     struct domain *d = v->domain;
-    struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     paddr_t offset = info->gpa - d->arch.vuart.info->base_addr;
 
     perfc_incr(vuart_reads);
@@ -126,19 +126,17 @@ static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv)
     return 1;
 }
 
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv)
+static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
+                            register_t r, void *priv)
 {
     struct domain *d = v->domain;
-    struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     paddr_t offset = info->gpa - d->arch.vuart.info->base_addr;
 
     perfc_incr(vuart_writes);
 
     if ( offset == d->arch.vuart.info->data_off )
         /* ignore any status bits */
-        vuart_print_char(v, *r & 0xFF);
+        vuart_print_char(v, r & 0xFF);
 
     return 1;
 }
diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index d9b5da4..da1cc2e 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -32,8 +32,10 @@ typedef struct
     paddr_t gpa;
 } mmio_info_t;
 
-typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info, void *priv);
-typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info, void *priv);
+typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info,
+                           register_t *r, void *priv);
+typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info,
+                            register_t r, void *priv);
 
 struct mmio_handler_ops {
     mmio_read_t read;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1Hs-0001VS-2Q; Mon, 19 Oct 2015 03:39:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hr-0001VJ-At
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:03 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	42/DE-31450-6D564265; Mon, 19 Oct 2015 03:39:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445225939!43128138!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 4796 invoked from network); 19 Oct 2015 03:39:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:00 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hi-0005gt-GN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hi-0004VM-D1
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:38:54 +0000
Date: Mon, 19 Oct 2015 03:38:54 +0000
Message-Id: <E1Zo1Hi-0004VM-D1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: Extend write/read handler
	to pass the register in 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 687a3f53bdd81d28302e82dd542f2e2a790e5f69
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:04 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:45 2015 +0100

    xen/arm: io: Extend write/read handler to pass the register in parameter
    
    Rather than letting each handler to retrieve the register used by the
    I/O access, add a new parameter to pass the register in parameter.
    
    This will help to implement generic register manipulation on I/O access
    such as sign-extension and endianess.
    
    Read handlers need to modify the value of the register, so a pointer to
    it is given in argument. Write handlers shouldn't modify the register,
    therefore only a plain value is given.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c          |    7 ++-
 xen/arch/arm/vgic-v2.c     |   44 +++++++++----------
 xen/arch/arm/vgic-v3.c     |  101 +++++++++++++++++++------------------------
 xen/arch/arm/vuart.c       |   20 ++++-----
 xen/include/asm-arm/mmio.h |    6 ++-
 5 files changed, 83 insertions(+), 95 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index b418173..ffe7c21 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -29,6 +29,9 @@ int handle_mmio(mmio_info_t *info)
     int i;
     const struct mmio_handler *handler = NULL;
     const struct vmmio *vmmio = &v->domain->arch.vmmio;
+    struct hsr_dabt dabt = info->dabt;
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
+    register_t *r = select_user_reg(regs, dabt.reg);
 
     for ( i = 0; i < vmmio->num_entries; i++ )
     {
@@ -43,9 +46,9 @@ int handle_mmio(mmio_info_t *info)
         return 0;
 
     if ( info->dabt.write )
-        return handler->ops->write(v, info, handler->priv);
+        return handler->ops->write(v, info, *r, handler->priv);
     else
-        return handler->ops->read(v, info, handler->priv);
+        return handler->ops->read(v, info, r, handler->priv);
 }
 
 void register_mmio_handler(struct domain *d,
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 309d579..dc2c2d2 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -51,11 +51,9 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t vbase)
 }
 
 static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                   void *priv)
+                                   register_t *r, void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
     unsigned long flags;
@@ -249,11 +247,9 @@ static int vgic_v2_to_sgi(struct vcpu *v, register_t sgir)
 }
 
 static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                    void *priv)
+                                    register_t r, void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
     uint32_t tr;
@@ -267,7 +263,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Ignore all but the enable bit */
         vgic_lock(v);
-        v->domain->arch.vgic.ctlr = (*r) & GICD_CTL_ENABLE;
+        v->domain->arch.vgic.ctlr = r & GICD_CTL_ENABLE;
         vgic_unlock(v);
 
         return 1;
@@ -291,11 +287,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable |= *r;
+        rank->ienable |= r;
         /* The virtual irq is derived from register offset.
          * The register difference is word difference. So divide by 2(DABT_WORD)
          * to get Virtual irq number */
-        vgic_enable_irqs(v, (*r) & (~tr),
+        vgic_enable_irqs(v, r & (~tr),
                          (gicd_reg - GICD_ISENABLER) >> DABT_WORD);
         vgic_unlock_rank(v, rank, flags);
         return 1;
@@ -306,11 +302,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable &= ~*r;
+        rank->ienable &= ~r;
         /* The virtual irq is derived from register offset.
          * The register difference is word difference. So divide by 2(DABT_WORD)
          * to get  Virtual irq number */
-        vgic_disable_irqs(v, (*r) & tr,
+        vgic_disable_irqs(v, r & tr,
                          (gicd_reg - GICD_ICENABLER) >> DABT_WORD);
         vgic_unlock_rank(v, rank, flags);
         return 1;
@@ -319,28 +315,28 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, *r, gicd_reg - GICD_ISPENDR);
+               v, r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICPENDR%d\n",
-               v, *r, gicd_reg - GICD_ICPENDR);
+               v, r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ISACTIVER%d\n",
-               v, *r, gicd_reg - GICD_ISACTIVER);
+               v, r, gicd_reg - GICD_ISACTIVER);
         return 0;
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
-               v, *r, gicd_reg - GICD_ICACTIVER);
+               v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
     case GICD_ITARGETSR ... GICD_ITARGETSR + 7:
@@ -362,7 +358,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
             target = target | (target << 8) | (target << 16) | (target << 24);
         else
             target = (target << (8 * (gicd_reg & 0x3)));
-        target &= *r;
+        target &= r;
         /* ignore zero writes */
         if ( !target )
             goto write_ignore;
@@ -410,10 +406,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
             rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                           DABT_WORD)] = *r;
+                                           DABT_WORD)] = r;
         else
             vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
-                        gicd_reg - GICD_IPRIORITYR, DABT_WORD)], *r, gicd_reg);
+                        gicd_reg - GICD_IPRIORITYR, DABT_WORD)], r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -427,7 +423,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)] = *r;
+        rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)] = r;
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -437,20 +433,20 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case GICD_SGIR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        return vgic_v2_to_sgi(v, *r);
+        return vgic_v2_to_sgi(v, r);
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+               v, dabt.size ? "word" : "byte", r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+               v, dabt.size ? "word" : "byte", r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -477,14 +473,14 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               v, dabt.reg, *r, gicd_reg);
+               v, dabt.reg, r, gicd_reg);
         return 0;
     }
 
 bad_width:
     printk(XENLOG_G_ERR
            "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           v, dabt.size, dabt.reg, *r, gicd_reg);
+           v, dabt.size, dabt.reg, r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index beb3621..2a09f86 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -104,11 +104,10 @@ static struct vcpu *vgic_v3_get_target_vcpu(struct vcpu *v, unsigned int irq)
 }
 
 static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                         uint32_t gicr_reg)
+                                         uint32_t gicr_reg,
+                                         register_t *r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     uint64_t aff;
 
     switch ( gicr_reg )
@@ -215,11 +214,10 @@ read_as_zero_32:
 }
 
 static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                          uint32_t gicr_reg)
+                                          uint32_t gicr_reg,
+                                          register_t r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
 
     switch ( gicr_reg )
     {
@@ -276,7 +274,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
 bad_width:
     printk(XENLOG_G_ERR
           "%pv: vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-          v, dabt.size, dabt.reg, *r, gicr_reg);
+          v, dabt.size, dabt.reg, r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -290,11 +288,10 @@ write_ignore_32:
 }
 
 static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
-                                            mmio_info_t *info, uint32_t reg)
+                                            mmio_info_t *info, uint32_t reg,
+                                            register_t *r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     unsigned long flags;
 
@@ -369,11 +366,10 @@ read_as_zero:
 }
 
 static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
-                                             mmio_info_t *info, uint32_t reg)
+                                             mmio_info_t *info, uint32_t reg,
+                                             register_t r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     uint32_t tr;
     unsigned long flags;
@@ -389,9 +385,9 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable |= *r;
+        rank->ienable |= r;
         /* The irq number is extracted from offset. so shift by register size */
-        vgic_enable_irqs(v, (*r) & (~tr), (reg - GICD_ISENABLER) >> DABT_WORD);
+        vgic_enable_irqs(v, r & (~tr), (reg - GICD_ISENABLER) >> DABT_WORD);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICENABLER ... GICD_ICENABLERN:
@@ -400,37 +396,37 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable &= ~*r;
+        rank->ienable &= ~r;
         /* The irq number is extracted from offset. so shift by register size */
-        vgic_disable_irqs(v, (*r) & tr, (reg - GICD_ICENABLER) >> DABT_WORD);
+        vgic_disable_irqs(v, r & tr, (reg - GICD_ICENABLER) >> DABT_WORD);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ISPENDR%d\n",
-               v, name, *r, reg - GICD_ISPENDR);
+               v, name, r, reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICPENDR%d\n",
-               v, name, *r, reg - GICD_ICPENDR);
+               v, name, r, reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ISACTIVER%d\n",
-               v, name, *r, reg - GICD_ISACTIVER);
+               v, name, r, reg - GICD_ISACTIVER);
         return 0;
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
-               v, name, *r, reg - GICD_ICACTIVER);
+               v, name, r, reg - GICD_ICACTIVER);
         return 0;
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
@@ -440,10 +436,10 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
             rank->ipriority[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                           DABT_WORD)] = *r;
+                                           DABT_WORD)] = r;
         else
             vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
-                       reg - GICD_IPRIORITYR, DABT_WORD)], *r, reg);
+                       reg - GICD_IPRIORITYR, DABT_WORD)], r, reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICFGR: /* Restricted to configure SGIs */
@@ -455,20 +451,20 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 2, reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)] = *r;
+        rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)] = r;
         vgic_unlock_rank(v, rank, flags);
         return 1;
     default:
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               v, name, dabt.reg, *r, reg);
+               v, name, dabt.reg, r, reg);
         return 0;
     }
 
 bad_width:
     printk(XENLOG_G_ERR
            "%pv: %s: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           v, name, dabt.size, dabt.reg, *r, reg);
+           v, name, dabt.size, dabt.reg, r, reg);
     domain_crash_synchronous();
     return 0;
 
@@ -479,11 +475,9 @@ write_ignore:
 }
 
 static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                        uint32_t gicr_reg)
+                                        uint32_t gicr_reg, register_t *r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
 
     switch ( gicr_reg )
     {
@@ -502,7 +496,7 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
           * So handle in common with GICD handling
           */
         return __vgic_v3_distr_common_mmio_read("vGICR: SGI", v, info,
-                                                gicr_reg);
+                                                gicr_reg, r);
 
     /* Read the pending status of an SGI is via GICR is not supported */
     case GICR_ISPENDR0:
@@ -533,11 +527,9 @@ read_as_zero:
 }
 
 static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                         uint32_t gicr_reg)
+                                         uint32_t gicr_reg, register_t r)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
 
     switch ( gicr_reg )
     {
@@ -556,19 +548,19 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
           * So handle common with GICD handling
           */
         return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v,
-                                                 info, gicr_reg);
+                                                 info, gicr_reg, r);
     case GICR_ISPENDR0:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ISPENDR0\n",
-               v, *r);
+               v, r);
         return 0;
 
     case GICR_ICPENDR0:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ICPENDR0\n",
-               v, *r);
+               v, r);
         return 0;
 
     case GICR_NSACR:
@@ -584,7 +576,7 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
 bad_width:
     printk(XENLOG_G_ERR
            "%pv: vGICR: SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           v, dabt.size, dabt.reg, *r, gicr_reg);
+           v, dabt.size, dabt.reg, r, gicr_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -613,7 +605,7 @@ static struct vcpu *get_vcpu_from_rdist(struct domain *d,
 }
 
 static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                    void *priv)
+                                    register_t *r, void *priv)
 {
     uint32_t offset;
     const struct vgic_rdist_region *region = priv;
@@ -625,9 +617,9 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 0;
 
     if ( offset < SZ_64K )
-        return __vgic_v3_rdistr_rd_mmio_read(v, info, offset);
+        return __vgic_v3_rdistr_rd_mmio_read(v, info, offset, r);
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
-        return vgic_v3_rdistr_sgi_mmio_read(v, info, (offset - SZ_64K));
+        return vgic_v3_rdistr_sgi_mmio_read(v, info, (offset - SZ_64K), r);
     else
         printk(XENLOG_G_WARNING
                "%pv: vGICR: unknown gpa read address %"PRIpaddr"\n",
@@ -637,7 +629,7 @@ static int vgic_v3_rdistr_mmio_read(struct vcpu *v, mmio_info_t *info,
 }
 
 static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                     void *priv)
+                                     register_t r, void *priv)
 {
     uint32_t offset;
     const struct vgic_rdist_region *region = priv;
@@ -649,9 +641,9 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 0;
 
     if ( offset < SZ_64K )
-        return __vgic_v3_rdistr_rd_mmio_write(v, info, offset);
+        return __vgic_v3_rdistr_rd_mmio_write(v, info, offset, r);
     else  if ( (offset >= SZ_64K) && (offset < 2 * SZ_64K) )
-        return vgic_v3_rdistr_sgi_mmio_write(v, info, (offset - SZ_64K));
+        return vgic_v3_rdistr_sgi_mmio_write(v, info, (offset - SZ_64K), r);
     else
         printk(XENLOG_G_WARNING
                "%pv: vGICR: unknown gpa write address %"PRIpaddr"\n",
@@ -661,11 +653,9 @@ static int vgic_v3_rdistr_mmio_write(struct vcpu *v, mmio_info_t *info,
 }
 
 static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
-                                   void *priv)
+                                   register_t *r, void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     unsigned long flags;
     int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
@@ -728,7 +718,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          * Above all register are common with GICR and GICD
          * Manage in common
          */
-        return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg);
+        return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
     case GICD_IROUTER ... GICD_IROUTER31:
         /* SGI/PPI is RES0 */
         goto read_as_zero_64;
@@ -819,11 +809,9 @@ read_as_zero:
 }
 
 static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
-                                    void *priv)
+                                    register_t r, void *priv)
 {
     struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
     unsigned long flags;
     uint64_t new_irouter, old_irouter;
@@ -839,7 +827,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
         vgic_lock(v);
         /* Only EnableGrp1A can be changed */
-        if ( *r & GICD_CTLR_ENABLE_G1A )
+        if ( r & GICD_CTLR_ENABLE_G1A )
             v->domain->arch.vgic.ctlr |= GICD_CTLR_ENABLE_G1A;
         else
             v->domain->arch.vgic.ctlr &= ~GICD_CTLR_ENABLE_G1A;
@@ -885,7 +873,8 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     case GICD_ICFGR ... GICD_ICFGRN:
         /* Above registers are common with GICR and GICD
          * Manage in common */
-        return __vgic_v3_distr_common_mmio_write("vGICD", v, info, gicd_reg);
+        return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
+                                                 gicd_reg, r);
     case GICD_IROUTER ... GICD_IROUTER31:
         /* SGI/PPI is RES0 */
         goto write_ignore_64;
@@ -894,7 +883,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto write_ignore;
-        new_irouter = *r;
+        new_irouter = r;
         vgic_lock_rank(v, rank, flags);
 
         old_irouter = rank->v3.irouter[REG_RANK_INDEX(64,
@@ -907,7 +896,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         {
             printk(XENLOG_G_DEBUG
                    "%pv: vGICD: wrong irouter at offset %#08x val %#"PRIregister,
-                   v, gicd_reg, *r);
+                   v, gicd_reg, r);
             vgic_unlock_rank(v, rank, flags);
             /*
              * TODO: Don't inject a fault to the guest when the MPIDR is
@@ -953,14 +942,14 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               v, dabt.reg, *r, gicd_reg);
+               v, dabt.reg, r, gicd_reg);
         return 0;
     }
 
 bad_width:
     printk(XENLOG_G_ERR
            "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           v, dabt.size, dabt.reg, *r, gicd_reg);
+           v, dabt.size, dabt.reg, r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
diff --git a/xen/arch/arm/vuart.c b/xen/arch/arm/vuart.c
index 2495e87..b5c9288 100644
--- a/xen/arch/arm/vuart.c
+++ b/xen/arch/arm/vuart.c
@@ -45,8 +45,10 @@
 
 #define domain_has_vuart(d) ((d)->arch.vuart.info != NULL)
 
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv);
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv);
+static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
+                           register_t *r, void *priv);
+static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
+                            register_t r, void *priv);
 
 static const struct mmio_handler_ops vuart_mmio_handler = {
     .read  = vuart_mmio_read,
@@ -106,12 +108,10 @@ static void vuart_print_char(struct vcpu *v, char c)
     spin_unlock(&uart->lock);
 }
 
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv)
+static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
+                           register_t *r, void *priv)
 {
     struct domain *d = v->domain;
-    struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     paddr_t offset = info->gpa - d->arch.vuart.info->base_addr;
 
     perfc_incr(vuart_reads);
@@ -126,19 +126,17 @@ static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info, void *priv)
     return 1;
 }
 
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info, void *priv)
+static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
+                            register_t r, void *priv)
 {
     struct domain *d = v->domain;
-    struct hsr_dabt dabt = info->dabt;
-    struct cpu_user_regs *regs = guest_cpu_user_regs();
-    register_t *r = select_user_reg(regs, dabt.reg);
     paddr_t offset = info->gpa - d->arch.vuart.info->base_addr;
 
     perfc_incr(vuart_writes);
 
     if ( offset == d->arch.vuart.info->data_off )
         /* ignore any status bits */
-        vuart_print_char(v, *r & 0xFF);
+        vuart_print_char(v, r & 0xFF);
 
     return 1;
 }
diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index d9b5da4..da1cc2e 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -32,8 +32,10 @@ typedef struct
     paddr_t gpa;
 } mmio_info_t;
 
-typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info, void *priv);
-typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info, void *priv);
+typedef int (*mmio_read_t)(struct vcpu *v, mmio_info_t *info,
+                           register_t *r, void *priv);
+typedef int (*mmio_write_t)(struct vcpu *v, mmio_info_t *info,
+                            register_t r, void *priv);
 
 struct mmio_handler_ops {
     mmio_read_t read;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1Hx-0001Wk-7I; Mon, 19 Oct 2015 03:39: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 1Zo1Hv-0001WN-Jb
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:07 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	5A/82-19220-AD564265; Mon, 19 Oct 2015 03:39:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1445225945!43163663!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5282 invoked from network); 19 Oct 2015 03:39:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hs-0005hT-T8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hs-0004WA-P5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:04 +0000
Date: Mon, 19 Oct 2015 03:39:04 +0000
Message-Id: <E1Zo1Hs-0004WA-P5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: Support sign-extension
	for every read access
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ac0ca6895b654d2d80b2e894183e253e0423f4e6
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:46 2015 +0100

    xen/arm: io: Support sign-extension for every read access
    
    The guest may try to load data from the emulated MMIO region using
    instructions with Sign-Extension (i.e ldrs*). Any use of one those,
    will set the SSE bit (Syndrome Sign Extend) in the ISS (see B3-1433
    in DDI 0406C.b).
    
    Note that the bit can only be set for access size smaller than the
    register size (i.e byte/half-word for aarch32, byte/half-word/word for
    aarch32). So we don't have to worry about undefined C behavior.
    
    Until now, the support of sign-extension was limited for byte access in
    vGIC emulation. Although there is no reason to not have it generically.
    
    So move the support just after we get the data from the MMIO emulation.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c          |   29 ++++++++++++++++++++++++++++-
 xen/arch/arm/vgic-v2.c     |   10 +++++-----
 xen/arch/arm/vgic-v3.c     |    4 ++--
 xen/include/asm-arm/vgic.h |    8 +++-----
 4 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index ffe7c21..de5765a 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -23,6 +23,33 @@
 #include <asm/current.h>
 #include <asm/mmio.h>
 
+static int handle_read(const struct mmio_handler *handler, struct vcpu *v,
+                       mmio_info_t *info, register_t *r)
+{
+    uint8_t size = (1 << info->dabt.size) * 8;
+
+    if ( !handler->ops->read(v, info, r, handler->priv) )
+        return 0;
+
+    /*
+     * Sign extend if required.
+     * Note that we expect the read handler to have zeroed the bits
+     * outside the requested access size.
+     */
+    if ( info->dabt.sign && (*r & (1UL << (size - 1)) ))
+    {
+        /*
+         * We are relying on register_t using the same as
+         * an unsigned long in order to keep the 32-bit assembly
+         * code smaller.
+         */
+        BUILD_BUG_ON(sizeof(register_t) != sizeof(unsigned long));
+        *r |= (~0UL) << size;
+    }
+
+    return 1;
+}
+
 int handle_mmio(mmio_info_t *info)
 {
     struct vcpu *v = current;
@@ -48,7 +75,7 @@ int handle_mmio(mmio_info_t *info)
     if ( info->dabt.write )
         return handler->ops->write(v, info, *r, handler->priv);
     else
-        return handler->ops->read(v, info, r, handler->priv);
+        return handle_read(handler, v, info, r);
 }
 
 void register_mmio_handler(struct domain *d,
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index dc2c2d2..dcbba0f 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -129,7 +129,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = rank->v2.itargets[REG_RANK_INDEX(8, gicd_reg - GICD_ITARGETSR,
                                               DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, dabt.sign, gicd_reg);
+            *r = vgic_byte_read(*r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -142,7 +142,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, dabt.sign, gicd_reg);
+            *r = vgic_byte_read(*r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -377,7 +377,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
             new_target = i % 8;
             old_target_mask = vgic_byte_read(rank->v2.itargets[REG_RANK_INDEX(8,
-                                             gicd_reg - GICD_ITARGETSR, DABT_WORD)], 0, i/8);
+                                             gicd_reg - GICD_ITARGETSR, DABT_WORD)], i/8);
             old_target = find_first_bit(&old_target_mask, 8);
 
             if ( new_target != old_target )
@@ -503,7 +503,7 @@ static struct vcpu *vgic_v2_get_target_vcpu(struct vcpu *v, unsigned int irq)
     ASSERT(spin_is_locked(&rank->lock));
 
     target = vgic_byte_read(rank->v2.itargets[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], 0, irq & 0x3);
+                                              irq, DABT_WORD)], irq & 0x3);
 
     /* 1-N SPI should be delivered as pending to all the vcpus in the
      * mask, but here we just return the first vcpu for simplicity and
@@ -521,7 +521,7 @@ static int vgic_v2_get_irq_priority(struct vcpu *v, unsigned int irq)
 
     ASSERT(spin_is_locked(&rank->lock));
     priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], 0, irq & 0x3);
+                                              irq, DABT_WORD)], irq & 0x3);
 
     return priority;
 }
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 2a09f86..6de7f00 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -336,7 +336,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         *r = rank->ipriority[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, dabt.sign, reg);
+            *r = vgic_byte_read(*r, reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICFGR ... GICD_ICFGRN:
@@ -1042,7 +1042,7 @@ static int vgic_v3_get_irq_priority(struct vcpu *v, unsigned int irq)
 
     ASSERT(spin_is_locked(&rank->lock));
     priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], 0, irq & 0x3);
+                                              irq, DABT_WORD)], irq & 0x3);
 
     return priority;
 }
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 96839f0..354c0d4 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -158,15 +158,13 @@ static inline int REG_RANK_NR(int b, uint32_t n)
     }
 }
 
-static inline uint32_t vgic_byte_read(uint32_t val, int sign, int offset)
+static inline uint32_t vgic_byte_read(uint32_t val, int offset)
 {
     int byte = offset & 0x3;
 
     val = val >> (8*byte);
-    if ( sign && (val & 0x80) )
-        val |= 0xffffff00;
-    else
-        val &= 0x000000ff;
+    val &= 0x000000ff;
+
     return val;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:39:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1Hx-0001Wk-7I; Mon, 19 Oct 2015 03:39: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 1Zo1Hv-0001WN-Jb
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:07 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	5A/82-19220-AD564265; Mon, 19 Oct 2015 03:39:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1445225945!43163663!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5282 invoked from network); 19 Oct 2015 03:39:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hs-0005hT-T8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Hs-0004WA-P5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:04 +0000
Date: Mon, 19 Oct 2015 03:39:04 +0000
Message-Id: <E1Zo1Hs-0004WA-P5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: Support sign-extension
	for every read access
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ac0ca6895b654d2d80b2e894183e253e0423f4e6
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:46 2015 +0100

    xen/arm: io: Support sign-extension for every read access
    
    The guest may try to load data from the emulated MMIO region using
    instructions with Sign-Extension (i.e ldrs*). Any use of one those,
    will set the SSE bit (Syndrome Sign Extend) in the ISS (see B3-1433
    in DDI 0406C.b).
    
    Note that the bit can only be set for access size smaller than the
    register size (i.e byte/half-word for aarch32, byte/half-word/word for
    aarch32). So we don't have to worry about undefined C behavior.
    
    Until now, the support of sign-extension was limited for byte access in
    vGIC emulation. Although there is no reason to not have it generically.
    
    So move the support just after we get the data from the MMIO emulation.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c          |   29 ++++++++++++++++++++++++++++-
 xen/arch/arm/vgic-v2.c     |   10 +++++-----
 xen/arch/arm/vgic-v3.c     |    4 ++--
 xen/include/asm-arm/vgic.h |    8 +++-----
 4 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index ffe7c21..de5765a 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -23,6 +23,33 @@
 #include <asm/current.h>
 #include <asm/mmio.h>
 
+static int handle_read(const struct mmio_handler *handler, struct vcpu *v,
+                       mmio_info_t *info, register_t *r)
+{
+    uint8_t size = (1 << info->dabt.size) * 8;
+
+    if ( !handler->ops->read(v, info, r, handler->priv) )
+        return 0;
+
+    /*
+     * Sign extend if required.
+     * Note that we expect the read handler to have zeroed the bits
+     * outside the requested access size.
+     */
+    if ( info->dabt.sign && (*r & (1UL << (size - 1)) ))
+    {
+        /*
+         * We are relying on register_t using the same as
+         * an unsigned long in order to keep the 32-bit assembly
+         * code smaller.
+         */
+        BUILD_BUG_ON(sizeof(register_t) != sizeof(unsigned long));
+        *r |= (~0UL) << size;
+    }
+
+    return 1;
+}
+
 int handle_mmio(mmio_info_t *info)
 {
     struct vcpu *v = current;
@@ -48,7 +75,7 @@ int handle_mmio(mmio_info_t *info)
     if ( info->dabt.write )
         return handler->ops->write(v, info, *r, handler->priv);
     else
-        return handler->ops->read(v, info, r, handler->priv);
+        return handle_read(handler, v, info, r);
 }
 
 void register_mmio_handler(struct domain *d,
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index dc2c2d2..dcbba0f 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -129,7 +129,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = rank->v2.itargets[REG_RANK_INDEX(8, gicd_reg - GICD_ITARGETSR,
                                               DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, dabt.sign, gicd_reg);
+            *r = vgic_byte_read(*r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -142,7 +142,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, dabt.sign, gicd_reg);
+            *r = vgic_byte_read(*r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -377,7 +377,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
             new_target = i % 8;
             old_target_mask = vgic_byte_read(rank->v2.itargets[REG_RANK_INDEX(8,
-                                             gicd_reg - GICD_ITARGETSR, DABT_WORD)], 0, i/8);
+                                             gicd_reg - GICD_ITARGETSR, DABT_WORD)], i/8);
             old_target = find_first_bit(&old_target_mask, 8);
 
             if ( new_target != old_target )
@@ -503,7 +503,7 @@ static struct vcpu *vgic_v2_get_target_vcpu(struct vcpu *v, unsigned int irq)
     ASSERT(spin_is_locked(&rank->lock));
 
     target = vgic_byte_read(rank->v2.itargets[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], 0, irq & 0x3);
+                                              irq, DABT_WORD)], irq & 0x3);
 
     /* 1-N SPI should be delivered as pending to all the vcpus in the
      * mask, but here we just return the first vcpu for simplicity and
@@ -521,7 +521,7 @@ static int vgic_v2_get_irq_priority(struct vcpu *v, unsigned int irq)
 
     ASSERT(spin_is_locked(&rank->lock));
     priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], 0, irq & 0x3);
+                                              irq, DABT_WORD)], irq & 0x3);
 
     return priority;
 }
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 2a09f86..6de7f00 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -336,7 +336,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         *r = rank->ipriority[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, dabt.sign, reg);
+            *r = vgic_byte_read(*r, reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICFGR ... GICD_ICFGRN:
@@ -1042,7 +1042,7 @@ static int vgic_v3_get_irq_priority(struct vcpu *v, unsigned int irq)
 
     ASSERT(spin_is_locked(&rank->lock));
     priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], 0, irq & 0x3);
+                                              irq, DABT_WORD)], irq & 0x3);
 
     return priority;
 }
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 96839f0..354c0d4 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -158,15 +158,13 @@ static inline int REG_RANK_NR(int b, uint32_t n)
     }
 }
 
-static inline uint32_t vgic_byte_read(uint32_t val, int sign, int offset)
+static inline uint32_t vgic_byte_read(uint32_t val, int offset)
 {
     int byte = offset & 0x3;
 
     val = val >> (8*byte);
-    if ( sign && (val & 0x80) )
-        val |= 0xffffff00;
-    else
-        val &= 0x000000ff;
+    val &= 0x000000ff;
+
     return val;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:39:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1I7-0001YM-9w; Mon, 19 Oct 2015 03:39: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 1Zo1I6-0001Y9-0X
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:18 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	87/99-01748-5E564265; Mon, 19 Oct 2015 03:39:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445225955!54172657!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19673 invoked from network); 19 Oct 2015 03:39:16 -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;
	19 Oct 2015 03:39:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1I3-0005hf-AY
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1I3-0004Ws-4y
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:15 +0000
Date: Mon, 19 Oct 2015 03:39:15 +0000
Message-Id: <E1Zo1I3-0004Ws-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: ctlr stores a 32-bit
	hardware register so use uint32_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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 17c9bc64551ef4b829735de3786083456ed60941
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:46 2015 +0100

    xen/arm: vgic: ctlr stores a 32-bit hardware register so use uint32_t
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/domain.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index b89727e..e7e40da 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -91,7 +91,7 @@ struct arch_domain
          * rank order.
          */
         spinlock_t lock;
-        int ctlr;
+        uint32_t ctlr;
         int nr_spis; /* Number of SPIs */
         unsigned long *allocated_irqs; /* bitmap of IRQs allocated */
         struct vgic_irq_rank *shared_irqs;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1I7-0001YM-9w; Mon, 19 Oct 2015 03:39: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 1Zo1I6-0001Y9-0X
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:18 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	87/99-01748-5E564265; Mon, 19 Oct 2015 03:39:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445225955!54172657!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19673 invoked from network); 19 Oct 2015 03:39:16 -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;
	19 Oct 2015 03:39:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1I3-0005hf-AY
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1I3-0004Ws-4y
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:15 +0000
Date: Mon, 19 Oct 2015 03:39:15 +0000
Message-Id: <E1Zo1I3-0004Ws-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: ctlr stores a 32-bit
	hardware register so use uint32_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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 17c9bc64551ef4b829735de3786083456ed60941
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:46 2015 +0100

    xen/arm: vgic: ctlr stores a 32-bit hardware register so use uint32_t
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/domain.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index b89727e..e7e40da 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -91,7 +91,7 @@ struct arch_domain
          * rank order.
          */
         spinlock_t lock;
-        int ctlr;
+        uint32_t ctlr;
         int nr_spis; /* Number of SPIs */
         unsigned long *allocated_irqs; /* bitmap of IRQs allocated */
         struct vgic_irq_rank *shared_irqs;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1IH-0001Zw-Cc; Mon, 19 Oct 2015 03:39: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 1Zo1IG-0001Zi-5C
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:28 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	2A/7C-18107-FE564265; Mon, 19 Oct 2015 03:39:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1445225965!37859455!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 32287 invoked from network); 19 Oct 2015 03:39:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1ID-0005hn-HW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1ID-0004XQ-GA
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:25 +0000
Date: Mon, 19 Oct 2015 03:39:25 +0000
Message-Id: <E1Zo1ID-0004XQ-GA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Optimize the way to
	store GICD_IPRIORITYR in the rank
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f699fd55e9860aa207945abbaadac44855caf6e5
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:07 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:46 2015 +0100

    xen/arm: vgic: Optimize the way to store GICD_IPRIORITYR in the rank
    
    Xen is currently directly storing the value of GICD_IPRIORITYR register
    in the rank. This makes emulation of the register access very simple
    but makes the code to get the priority for a given vIRQ more complex.
    
    While the priority of an vIRQ is retrieved every time an vIRQ is injected
    to the guest, the access to register occurs less often.
    
    Each GICD_IPRIORITYR register stores 4 priorities associated for 4 vIRQs
    (see 4.3.11 in IHI 0048B). As Xen is using little endian, we can use
    an union to access directly a register or a priority for a given IRQ.
    
    Note that the field "ipriority" has been renamed to "ipriorityr" to
    match the name of the register in the GIC spec.
    
    Finally, the implementation of the callback get_irq_priority is exactly
    the same for both vGIC drivers. Consolidate the implementation in the
    common vGIC code and drop the callback.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c     |   23 +++++------------------
 xen/arch/arm/vgic-v3.c     |   23 +++++------------------
 xen/arch/arm/vgic.c        |   18 ++++++++++++++----
 xen/include/asm-arm/vgic.h |   17 ++++++++++++++---
 4 files changed, 38 insertions(+), 43 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index dcbba0f..ad1bb15 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -139,8 +139,8 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto read_as_zero;
 
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                            DABT_WORD)];
+        *r = rank->ipriorityr[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
+                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
             *r = vgic_byte_read(*r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
@@ -405,10 +405,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
-            rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                           DABT_WORD)] = r;
+            rank->ipriorityr[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
+                                            DABT_WORD)] = r;
         else
-            vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
+            vgic_byte_write(&rank->ipriorityr[REG_RANK_INDEX(8,
                         gicd_reg - GICD_IPRIORITYR, DABT_WORD)], r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
@@ -514,18 +514,6 @@ static struct vcpu *vgic_v2_get_target_vcpu(struct vcpu *v, unsigned int irq)
     return v_target;
 }
 
-static int vgic_v2_get_irq_priority(struct vcpu *v, unsigned int irq)
-{
-    int priority;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
-
-    ASSERT(spin_is_locked(&rank->lock));
-    priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], irq & 0x3);
-
-    return priority;
-}
-
 static int vgic_v2_vcpu_init(struct vcpu *v)
 {
     int i;
@@ -597,7 +585,6 @@ static int vgic_v2_domain_init(struct domain *d)
 static const struct vgic_ops vgic_v2_ops = {
     .vcpu_init   = vgic_v2_vcpu_init,
     .domain_init = vgic_v2_domain_init,
-    .get_irq_priority = vgic_v2_get_irq_priority,
     .get_target_vcpu = vgic_v2_get_target_vcpu,
     .max_vcpus = 8,
 };
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 6de7f00..92a3ccf 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -333,8 +333,8 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto read_as_zero;
 
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ipriority[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                            DABT_WORD)];
+        *r = rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
+                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
             *r = vgic_byte_read(*r, reg);
         vgic_unlock_rank(v, rank, flags);
@@ -435,10 +435,10 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
-            rank->ipriority[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                           DABT_WORD)] = r;
+            rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
+                                            DABT_WORD)] = r;
         else
-            vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
+            vgic_byte_write(&rank->ipriorityr[REG_RANK_INDEX(8,
                        reg - GICD_IPRIORITYR, DABT_WORD)], r, reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
@@ -1035,18 +1035,6 @@ static const struct mmio_handler_ops vgic_distr_mmio_handler = {
     .write = vgic_v3_distr_mmio_write,
 };
 
-static int vgic_v3_get_irq_priority(struct vcpu *v, unsigned int irq)
-{
-    int priority;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
-
-    ASSERT(spin_is_locked(&rank->lock));
-    priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], irq & 0x3);
-
-    return priority;
-}
-
 static int vgic_v3_vcpu_init(struct vcpu *v)
 {
     int i;
@@ -1196,7 +1184,6 @@ static int vgic_v3_domain_init(struct domain *d)
 static const struct vgic_ops v3_ops = {
     .vcpu_init   = vgic_v3_vcpu_init,
     .domain_init = vgic_v3_domain_init,
-    .get_irq_priority = vgic_v3_get_irq_priority,
     .get_target_vcpu  = vgic_v3_get_target_vcpu,
     .emulate_sysreg  = vgic_v3_emulate_sysreg,
     /*
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index a6835a8..2128d29 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -204,6 +204,19 @@ struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int irq)
     return v_target;
 }
 
+static int vgic_get_virq_priority(struct vcpu *v, unsigned int virq)
+{
+    struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
+    unsigned long flags;
+    int priority;
+
+    vgic_lock_rank(v, rank, flags);
+    priority = rank->priority[virq & INTERRUPT_RANK_MASK];
+    vgic_unlock_rank(v, rank, flags);
+
+    return priority;
+}
+
 void vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int irq)
 {
     unsigned long flags;
@@ -407,14 +420,11 @@ void vgic_clear_pending_irqs(struct vcpu *v)
 void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq)
 {
     uint8_t priority;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
     struct pending_irq *iter, *n = irq_to_pending(v, virq);
     unsigned long flags;
     bool_t running;
 
-    vgic_lock_rank(v, rank, flags);
-    priority = v->domain->arch.vgic.handler->get_irq_priority(v, virq);
-    vgic_unlock_rank(v, rank, flags);
+    priority = vgic_get_virq_priority(v, virq);
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 354c0d4..ff98913 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -82,12 +82,25 @@ struct pending_irq
     struct list_head lr_queue;
 };
 
+#define NR_INTERRUPT_PER_RANK   32
+#define INTERRUPT_RANK_MASK (NR_INTERRUPT_PER_RANK - 1)
+
 /* Represents state corresponding to a block of 32 interrupts */
 struct vgic_irq_rank {
     spinlock_t lock; /* Covers access to all other members of this struct */
     uint32_t ienable;
     uint32_t icfg[2];
-    uint32_t ipriority[8];
+
+    /*
+     * Provide efficient access to the priority of an vIRQ while keeping
+     * the emulation simple.
+     * Note, this is working fine as long as Xen is using little endian.
+     */
+    union {
+        uint8_t priority[32];
+        uint32_t ipriorityr[8];
+    };
+
     union {
         struct {
             uint32_t itargets[8];
@@ -114,8 +127,6 @@ struct vgic_ops {
     int (*vcpu_init)(struct vcpu *v);
     /* Domain specific initialization of vGIC */
     int (*domain_init)(struct domain *d);
-    /* Get priority for a given irq stored in vgic structure */
-    int (*get_irq_priority)(struct vcpu *v, unsigned int irq);
     /* Get the target vcpu for a given virq. The rank lock is already taken
      * when calling this. */
     struct vcpu *(*get_target_vcpu)(struct vcpu *v, unsigned int irq);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1IH-0001Zw-Cc; Mon, 19 Oct 2015 03:39: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 1Zo1IG-0001Zi-5C
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:28 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	2A/7C-18107-FE564265; Mon, 19 Oct 2015 03:39:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1445225965!37859455!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 32287 invoked from network); 19 Oct 2015 03:39:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1ID-0005hn-HW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1ID-0004XQ-GA
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:25 +0000
Date: Mon, 19 Oct 2015 03:39:25 +0000
Message-Id: <E1Zo1ID-0004XQ-GA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Optimize the way to
	store GICD_IPRIORITYR in the rank
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f699fd55e9860aa207945abbaadac44855caf6e5
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:07 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:46 2015 +0100

    xen/arm: vgic: Optimize the way to store GICD_IPRIORITYR in the rank
    
    Xen is currently directly storing the value of GICD_IPRIORITYR register
    in the rank. This makes emulation of the register access very simple
    but makes the code to get the priority for a given vIRQ more complex.
    
    While the priority of an vIRQ is retrieved every time an vIRQ is injected
    to the guest, the access to register occurs less often.
    
    Each GICD_IPRIORITYR register stores 4 priorities associated for 4 vIRQs
    (see 4.3.11 in IHI 0048B). As Xen is using little endian, we can use
    an union to access directly a register or a priority for a given IRQ.
    
    Note that the field "ipriority" has been renamed to "ipriorityr" to
    match the name of the register in the GIC spec.
    
    Finally, the implementation of the callback get_irq_priority is exactly
    the same for both vGIC drivers. Consolidate the implementation in the
    common vGIC code and drop the callback.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c     |   23 +++++------------------
 xen/arch/arm/vgic-v3.c     |   23 +++++------------------
 xen/arch/arm/vgic.c        |   18 ++++++++++++++----
 xen/include/asm-arm/vgic.h |   17 ++++++++++++++---
 4 files changed, 38 insertions(+), 43 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index dcbba0f..ad1bb15 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -139,8 +139,8 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto read_as_zero;
 
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                            DABT_WORD)];
+        *r = rank->ipriorityr[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
+                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
             *r = vgic_byte_read(*r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
@@ -405,10 +405,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
-            rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                           DABT_WORD)] = r;
+            rank->ipriorityr[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
+                                            DABT_WORD)] = r;
         else
-            vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
+            vgic_byte_write(&rank->ipriorityr[REG_RANK_INDEX(8,
                         gicd_reg - GICD_IPRIORITYR, DABT_WORD)], r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
@@ -514,18 +514,6 @@ static struct vcpu *vgic_v2_get_target_vcpu(struct vcpu *v, unsigned int irq)
     return v_target;
 }
 
-static int vgic_v2_get_irq_priority(struct vcpu *v, unsigned int irq)
-{
-    int priority;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
-
-    ASSERT(spin_is_locked(&rank->lock));
-    priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], irq & 0x3);
-
-    return priority;
-}
-
 static int vgic_v2_vcpu_init(struct vcpu *v)
 {
     int i;
@@ -597,7 +585,6 @@ static int vgic_v2_domain_init(struct domain *d)
 static const struct vgic_ops vgic_v2_ops = {
     .vcpu_init   = vgic_v2_vcpu_init,
     .domain_init = vgic_v2_domain_init,
-    .get_irq_priority = vgic_v2_get_irq_priority,
     .get_target_vcpu = vgic_v2_get_target_vcpu,
     .max_vcpus = 8,
 };
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 6de7f00..92a3ccf 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -333,8 +333,8 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto read_as_zero;
 
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ipriority[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                            DABT_WORD)];
+        *r = rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
+                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
             *r = vgic_byte_read(*r, reg);
         vgic_unlock_rank(v, rank, flags);
@@ -435,10 +435,10 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
-            rank->ipriority[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                           DABT_WORD)] = r;
+            rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
+                                            DABT_WORD)] = r;
         else
-            vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
+            vgic_byte_write(&rank->ipriorityr[REG_RANK_INDEX(8,
                        reg - GICD_IPRIORITYR, DABT_WORD)], r, reg);
         vgic_unlock_rank(v, rank, flags);
         return 1;
@@ -1035,18 +1035,6 @@ static const struct mmio_handler_ops vgic_distr_mmio_handler = {
     .write = vgic_v3_distr_mmio_write,
 };
 
-static int vgic_v3_get_irq_priority(struct vcpu *v, unsigned int irq)
-{
-    int priority;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
-
-    ASSERT(spin_is_locked(&rank->lock));
-    priority = vgic_byte_read(rank->ipriority[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], irq & 0x3);
-
-    return priority;
-}
-
 static int vgic_v3_vcpu_init(struct vcpu *v)
 {
     int i;
@@ -1196,7 +1184,6 @@ static int vgic_v3_domain_init(struct domain *d)
 static const struct vgic_ops v3_ops = {
     .vcpu_init   = vgic_v3_vcpu_init,
     .domain_init = vgic_v3_domain_init,
-    .get_irq_priority = vgic_v3_get_irq_priority,
     .get_target_vcpu  = vgic_v3_get_target_vcpu,
     .emulate_sysreg  = vgic_v3_emulate_sysreg,
     /*
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index a6835a8..2128d29 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -204,6 +204,19 @@ struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int irq)
     return v_target;
 }
 
+static int vgic_get_virq_priority(struct vcpu *v, unsigned int virq)
+{
+    struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
+    unsigned long flags;
+    int priority;
+
+    vgic_lock_rank(v, rank, flags);
+    priority = rank->priority[virq & INTERRUPT_RANK_MASK];
+    vgic_unlock_rank(v, rank, flags);
+
+    return priority;
+}
+
 void vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int irq)
 {
     unsigned long flags;
@@ -407,14 +420,11 @@ void vgic_clear_pending_irqs(struct vcpu *v)
 void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq)
 {
     uint8_t priority;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
     struct pending_irq *iter, *n = irq_to_pending(v, virq);
     unsigned long flags;
     bool_t running;
 
-    vgic_lock_rank(v, rank, flags);
-    priority = v->domain->arch.vgic.handler->get_irq_priority(v, virq);
-    vgic_unlock_rank(v, rank, flags);
+    priority = vgic_get_virq_priority(v, virq);
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index 354c0d4..ff98913 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -82,12 +82,25 @@ struct pending_irq
     struct list_head lr_queue;
 };
 
+#define NR_INTERRUPT_PER_RANK   32
+#define INTERRUPT_RANK_MASK (NR_INTERRUPT_PER_RANK - 1)
+
 /* Represents state corresponding to a block of 32 interrupts */
 struct vgic_irq_rank {
     spinlock_t lock; /* Covers access to all other members of this struct */
     uint32_t ienable;
     uint32_t icfg[2];
-    uint32_t ipriority[8];
+
+    /*
+     * Provide efficient access to the priority of an vIRQ while keeping
+     * the emulation simple.
+     * Note, this is working fine as long as Xen is using little endian.
+     */
+    union {
+        uint8_t priority[32];
+        uint32_t ipriorityr[8];
+    };
+
     union {
         struct {
             uint32_t itargets[8];
@@ -114,8 +127,6 @@ struct vgic_ops {
     int (*vcpu_init)(struct vcpu *v);
     /* Domain specific initialization of vGIC */
     int (*domain_init)(struct domain *d);
-    /* Get priority for a given irq stored in vgic structure */
-    int (*get_irq_priority)(struct vcpu *v, unsigned int irq);
     /* Get the target vcpu for a given virq. The rank lock is already taken
      * when calling this. */
     struct vcpu *(*get_target_vcpu)(struct vcpu *v, unsigned int irq);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1IS-0001bU-FL; Mon, 19 Oct 2015 03:39: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 1Zo1IQ-0001bD-Jk
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:38 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	FB/E8-31069-9F564265; Mon, 19 Oct 2015 03:39:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445225976!49915480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5036 invoked from network); 19 Oct 2015 03:39:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:36 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1IN-0005hv-SP
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1IN-0004Y7-Qd
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:35 +0000
Date: Mon, 19 Oct 2015 03:39:35 +0000
Message-Id: <E1Zo1IN-0004Y7-Qd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Introduce a new field
	to store the rank index and use it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c20224c72fbe40d22859b4e052d9c18eb89e42c
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:08 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:46 2015 +0100

    xen/arm: vgic: Introduce a new field to store the rank index and use it
    
    Having in hand the index for the rank is very handy to avoid computing
    it every time.
    
    For now, use it when enabling/disabling the vIRQs rather than a formula
    which is not obvious to understand.
    
    Also drop the comments which were wrong because a shift by DABT_WORD
    will not give the IRQ number but the index of the register.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c     |   12 ++----------
 xen/arch/arm/vgic-v3.c     |    6 ++----
 xen/arch/arm/vgic.c        |   13 ++++++++++---
 xen/include/asm-arm/vgic.h |    3 +++
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index ad1bb15..2d63e12 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -288,11 +288,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
         rank->ienable |= r;
-        /* The virtual irq is derived from register offset.
-         * The register difference is word difference. So divide by 2(DABT_WORD)
-         * to get Virtual irq number */
-        vgic_enable_irqs(v, r & (~tr),
-                         (gicd_reg - GICD_ISENABLER) >> DABT_WORD);
+        vgic_enable_irqs(v, r & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -303,11 +299,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
         rank->ienable &= ~r;
-        /* The virtual irq is derived from register offset.
-         * The register difference is word difference. So divide by 2(DABT_WORD)
-         * to get  Virtual irq number */
-        vgic_disable_irqs(v, r & tr,
-                         (gicd_reg - GICD_ICENABLER) >> DABT_WORD);
+        vgic_disable_irqs(v, r & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 92a3ccf..b5249ff 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -386,8 +386,7 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
         rank->ienable |= r;
-        /* The irq number is extracted from offset. so shift by register size */
-        vgic_enable_irqs(v, r & (~tr), (reg - GICD_ISENABLER) >> DABT_WORD);
+        vgic_enable_irqs(v, r & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICENABLER ... GICD_ICENABLERN:
@@ -397,8 +396,7 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
         rank->ienable &= ~r;
-        /* The irq number is extracted from offset. so shift by register size */
-        vgic_disable_irqs(v, r & tr, (reg - GICD_ICENABLER) >> DABT_WORD);
+        vgic_disable_irqs(v, r & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ISPENDR ... GICD_ISPENDRN:
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 2128d29..7bb4570 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -68,6 +68,13 @@ static void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq)
     p->irq = virq;
 }
 
+static void vgic_rank_init(struct vgic_irq_rank *rank, uint8_t index)
+{
+    spin_lock_init(&rank->lock);
+
+    rank->index = index;
+}
+
 int domain_vgic_init(struct domain *d, unsigned int nr_spis)
 {
     int i;
@@ -114,8 +121,8 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis)
     for (i=0; i<d->arch.vgic.nr_spis; i++)
         vgic_init_pending_irq(&d->arch.vgic.pending_irqs[i], i + 32);
 
-    for (i=0; i<DOMAIN_NR_RANKS(d); i++)
-        spin_lock_init(&d->arch.vgic.shared_irqs[i].lock);
+    for ( i = 0; i < DOMAIN_NR_RANKS(d); i++ )
+        vgic_rank_init(&d->arch.vgic.shared_irqs[i], i + 1);
 
     ret = d->arch.vgic.handler->domain_init(d);
     if ( ret )
@@ -169,7 +176,7 @@ int vcpu_vgic_init(struct vcpu *v)
     if ( v->arch.vgic.private_irqs == NULL )
       return -ENOMEM;
 
-    spin_lock_init(&v->arch.vgic.private_irqs->lock);
+    vgic_rank_init(v->arch.vgic.private_irqs, 0);
 
     v->domain->arch.vgic.handler->vcpu_init(v);
 
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index ff98913..ba74d0f 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -88,6 +88,9 @@ struct pending_irq
 /* Represents state corresponding to a block of 32 interrupts */
 struct vgic_irq_rank {
     spinlock_t lock; /* Covers access to all other members of this struct */
+
+    uint8_t index;
+
     uint32_t ienable;
     uint32_t icfg[2];
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1IS-0001bU-FL; Mon, 19 Oct 2015 03:39: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 1Zo1IQ-0001bD-Jk
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:38 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	FB/E8-31069-9F564265; Mon, 19 Oct 2015 03:39:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445225976!49915480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5036 invoked from network); 19 Oct 2015 03:39:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:36 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1IN-0005hv-SP
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1IN-0004Y7-Qd
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:35 +0000
Date: Mon, 19 Oct 2015 03:39:35 +0000
Message-Id: <E1Zo1IN-0004Y7-Qd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Introduce a new field
	to store the rank index and use it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c20224c72fbe40d22859b4e052d9c18eb89e42c
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 7 15:41:08 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 8 12:22:46 2015 +0100

    xen/arm: vgic: Introduce a new field to store the rank index and use it
    
    Having in hand the index for the rank is very handy to avoid computing
    it every time.
    
    For now, use it when enabling/disabling the vIRQs rather than a formula
    which is not obvious to understand.
    
    Also drop the comments which were wrong because a shift by DABT_WORD
    will not give the IRQ number but the index of the register.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c     |   12 ++----------
 xen/arch/arm/vgic-v3.c     |    6 ++----
 xen/arch/arm/vgic.c        |   13 ++++++++++---
 xen/include/asm-arm/vgic.h |    3 +++
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index ad1bb15..2d63e12 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -288,11 +288,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
         rank->ienable |= r;
-        /* The virtual irq is derived from register offset.
-         * The register difference is word difference. So divide by 2(DABT_WORD)
-         * to get Virtual irq number */
-        vgic_enable_irqs(v, r & (~tr),
-                         (gicd_reg - GICD_ISENABLER) >> DABT_WORD);
+        vgic_enable_irqs(v, r & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -303,11 +299,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
         rank->ienable &= ~r;
-        /* The virtual irq is derived from register offset.
-         * The register difference is word difference. So divide by 2(DABT_WORD)
-         * to get  Virtual irq number */
-        vgic_disable_irqs(v, r & tr,
-                         (gicd_reg - GICD_ICENABLER) >> DABT_WORD);
+        vgic_disable_irqs(v, r & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 92a3ccf..b5249ff 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -386,8 +386,7 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
         rank->ienable |= r;
-        /* The irq number is extracted from offset. so shift by register size */
-        vgic_enable_irqs(v, r & (~tr), (reg - GICD_ISENABLER) >> DABT_WORD);
+        vgic_enable_irqs(v, r & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICENABLER ... GICD_ICENABLERN:
@@ -397,8 +396,7 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
         rank->ienable &= ~r;
-        /* The irq number is extracted from offset. so shift by register size */
-        vgic_disable_irqs(v, r & tr, (reg - GICD_ICENABLER) >> DABT_WORD);
+        vgic_disable_irqs(v, r & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ISPENDR ... GICD_ISPENDRN:
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 2128d29..7bb4570 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -68,6 +68,13 @@ static void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq)
     p->irq = virq;
 }
 
+static void vgic_rank_init(struct vgic_irq_rank *rank, uint8_t index)
+{
+    spin_lock_init(&rank->lock);
+
+    rank->index = index;
+}
+
 int domain_vgic_init(struct domain *d, unsigned int nr_spis)
 {
     int i;
@@ -114,8 +121,8 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis)
     for (i=0; i<d->arch.vgic.nr_spis; i++)
         vgic_init_pending_irq(&d->arch.vgic.pending_irqs[i], i + 32);
 
-    for (i=0; i<DOMAIN_NR_RANKS(d); i++)
-        spin_lock_init(&d->arch.vgic.shared_irqs[i].lock);
+    for ( i = 0; i < DOMAIN_NR_RANKS(d); i++ )
+        vgic_rank_init(&d->arch.vgic.shared_irqs[i], i + 1);
 
     ret = d->arch.vgic.handler->domain_init(d);
     if ( ret )
@@ -169,7 +176,7 @@ int vcpu_vgic_init(struct vcpu *v)
     if ( v->arch.vgic.private_irqs == NULL )
       return -ENOMEM;
 
-    spin_lock_init(&v->arch.vgic.private_irqs->lock);
+    vgic_rank_init(v->arch.vgic.private_irqs, 0);
 
     v->domain->arch.vgic.handler->vcpu_init(v);
 
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index ff98913..ba74d0f 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -88,6 +88,9 @@ struct pending_irq
 /* Represents state corresponding to a block of 32 interrupts */
 struct vgic_irq_rank {
     spinlock_t lock; /* Covers access to all other members of this struct */
+
+    uint8_t index;
+
     uint32_t ienable;
     uint32_t icfg[2];
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1Ic-0001dU-KC; Mon, 19 Oct 2015 03:39: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 1Zo1Ia-0001dH-Vx
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:49 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	05/AE-01421-40664265; Mon, 19 Oct 2015 03:39:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445225986!21524619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9788 invoked from network); 19 Oct 2015 03:39: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;
	19 Oct 2015 03:39:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1IY-0005i3-8h
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1IY-0004ZR-5P
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:46 +0000
Date: Mon, 19 Oct 2015 03:39:46 +0000
Message-Id: <E1Zo1IY-0004ZR-5P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: don't suppress invalidation
	address write when it is zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 710942e57fb42ff8f344ca82f6b678f67e38ae63
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 12 15:58:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 15:58:35 2015 +0200

    VT-d: don't suppress invalidation address write when it is zero
    
    GFN zero is a valid address, and hence may need invalidation done for
    it just like for any other GFN.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 8254937..d95f4d4 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -414,7 +414,7 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 {
     struct iommu *iommu = (struct iommu *) _iommu;
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
-    u64 val = 0, val_iva = 0;
+    u64 val = 0;
     unsigned long flags;
 
     /*
@@ -435,7 +435,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
     switch ( type )
     {
     case DMA_TLB_GLOBAL_FLUSH:
-        /* global flush doesn't need set IVA_REG */
         val = DMA_TLB_GLOBAL_FLUSH|DMA_TLB_IVT;
         break;
     case DMA_TLB_DSI_FLUSH:
@@ -443,8 +442,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
         break;
     case DMA_TLB_PSI_FLUSH:
         val = DMA_TLB_PSI_FLUSH|DMA_TLB_IVT|DMA_TLB_DID(did);
-        /* Note: always flush non-leaf currently */
-        val_iva = size_order | addr;
         break;
     default:
         BUG();
@@ -457,8 +454,11 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     /* Note: Only uses first TLB reg currently */
-    if ( val_iva )
-        dmar_writeq(iommu->reg, tlb_offset, val_iva);
+    if ( type == DMA_TLB_PSI_FLUSH )
+    {
+        /* Note: always flush non-leaf currently. */
+        dmar_writeq(iommu->reg, tlb_offset, size_order | addr);
+    }
     dmar_writeq(iommu->reg, tlb_offset + 8, val);
 
     /* Make sure hardware complete it */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1Ic-0001dU-KC; Mon, 19 Oct 2015 03:39: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 1Zo1Ia-0001dH-Vx
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:49 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	05/AE-01421-40664265; Mon, 19 Oct 2015 03:39:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445225986!21524619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9788 invoked from network); 19 Oct 2015 03:39: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;
	19 Oct 2015 03:39:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1IY-0005i3-8h
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1IY-0004ZR-5P
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:46 +0000
Date: Mon, 19 Oct 2015 03:39:46 +0000
Message-Id: <E1Zo1IY-0004ZR-5P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: don't suppress invalidation
	address write when it is zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 710942e57fb42ff8f344ca82f6b678f67e38ae63
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 12 15:58:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 15:58:35 2015 +0200

    VT-d: don't suppress invalidation address write when it is zero
    
    GFN zero is a valid address, and hence may need invalidation done for
    it just like for any other GFN.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 8254937..d95f4d4 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -414,7 +414,7 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 {
     struct iommu *iommu = (struct iommu *) _iommu;
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
-    u64 val = 0, val_iva = 0;
+    u64 val = 0;
     unsigned long flags;
 
     /*
@@ -435,7 +435,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
     switch ( type )
     {
     case DMA_TLB_GLOBAL_FLUSH:
-        /* global flush doesn't need set IVA_REG */
         val = DMA_TLB_GLOBAL_FLUSH|DMA_TLB_IVT;
         break;
     case DMA_TLB_DSI_FLUSH:
@@ -443,8 +442,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
         break;
     case DMA_TLB_PSI_FLUSH:
         val = DMA_TLB_PSI_FLUSH|DMA_TLB_IVT|DMA_TLB_DID(did);
-        /* Note: always flush non-leaf currently */
-        val_iva = size_order | addr;
         break;
     default:
         BUG();
@@ -457,8 +454,11 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     /* Note: Only uses first TLB reg currently */
-    if ( val_iva )
-        dmar_writeq(iommu->reg, tlb_offset, val_iva);
+    if ( type == DMA_TLB_PSI_FLUSH )
+    {
+        /* Note: always flush non-leaf currently. */
+        dmar_writeq(iommu->reg, tlb_offset, size_order | addr);
+    }
     dmar_writeq(iommu->reg, tlb_offset + 8, val);
 
     /* Make sure hardware complete it */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:39:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1Il-0001es-Md; Mon, 19 Oct 2015 03:39:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ik-0001ei-NE
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:58 +0000
Content-Length: 1659
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	1E/E9-01748-E0664265; Mon, 19 Oct 2015 03:39:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445225996!54172745!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22750 invoked from network); 19 Oct 2015 03:39:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ii-0005iB-Ik
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ii-0004Zy-GQ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:56 +0000
Date: Mon, 19 Oct 2015 03:39:56 +0000
Message-Id: <E1Zo1Ii-0004Zy-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [xen master] MAINTAINERS: Tamás Lengyel to maintain mem-sharing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4627534234485671146=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4627534234485671146==
Content-Length: 1248
Content-Transfer-Encoding: quoted-printable

commit 62b320ceebdc27f15dc571e6d80b103e9750be3b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 12 15:59:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 15:59:28 2015 +0200

    MAINTAINERS: Tam=C3=A1s Lengyel to maintain mem-sharing
    
    The component being unmaintained right now and him being the apparently
    only user at present, this certainly is an improvement over the current
    situation.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 MAINTAINERS |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 902a28a..fbfd57a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -369,10 +369,14 @@ M:	George Dunlap <george.dunlap@eu.citrix.com>
 S:	Supported
 F:	xen/arch/x86/mm/
 
-X86 MEMORY SHARING AND PAGING
+X86 MEMORY PAGING
 S:	Orphaned
-F:	xen/arch/x86/mm/mem_sharing.c
 F:	xen/arch/x86/mm/mem_paging.c
+
+X86 MEMORY SHARING
+M:	Tamas K Lengyel <tamas@tklengyel.com>
+S:	Odd Fixes
+F:	xen/arch/x86/mm/mem_sharing.c
 F:	tools/memshr
 
 X86 SHADOW PAGETABLES
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:39:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:39: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 1Zo1Il-0001es-Md; Mon, 19 Oct 2015 03:39:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ik-0001ei-NE
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:58 +0000
Content-Length: 1659
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	1E/E9-01748-E0664265; Mon, 19 Oct 2015 03:39:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445225996!54172745!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22750 invoked from network); 19 Oct 2015 03:39:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:39:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ii-0005iB-Ik
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ii-0004Zy-GQ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:39:56 +0000
Date: Mon, 19 Oct 2015 03:39:56 +0000
Message-Id: <E1Zo1Ii-0004Zy-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [xen master] MAINTAINERS: Tamás Lengyel to maintain mem-sharing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4627534234485671146=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4627534234485671146==
Content-Length: 1248
Content-Transfer-Encoding: quoted-printable

commit 62b320ceebdc27f15dc571e6d80b103e9750be3b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 12 15:59:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 15:59:28 2015 +0200

    MAINTAINERS: Tam=C3=A1s Lengyel to maintain mem-sharing
    
    The component being unmaintained right now and him being the apparently
    only user at present, this certainly is an improvement over the current
    situation.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 MAINTAINERS |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 902a28a..fbfd57a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -369,10 +369,14 @@ M:	George Dunlap <george.dunlap@eu.citrix.com>
 S:	Supported
 F:	xen/arch/x86/mm/
 
-X86 MEMORY SHARING AND PAGING
+X86 MEMORY PAGING
 S:	Orphaned
-F:	xen/arch/x86/mm/mem_sharing.c
 F:	xen/arch/x86/mm/mem_paging.c
+
+X86 MEMORY SHARING
+M:	Tamas K Lengyel <tamas@tklengyel.com>
+S:	Odd Fixes
+F:	xen/arch/x86/mm/mem_sharing.c
 F:	tools/memshr
 
 X86 SHADOW PAGETABLES
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:40:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1Iw-0001gd-PO; Mon, 19 Oct 2015 03:40:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Iu-0001gS-W8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:09 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	A5/75-10422-81664265; Mon, 19 Oct 2015 03:40:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1445226007!43128219!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26802 invoked from network); 19 Oct 2015 03:40: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;
	19 Oct 2015 03:40:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Is-0005im-Qo
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Is-0004bn-PN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:06 +0000
Date: Mon, 19 Oct 2015 03:40:06 +0000
Message-Id: <E1Zo1Is-0004bn-PN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: fix an 'off by one \t' in
	credit2 debug dump
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9d5c42425cc01f1900c59a517e57ef113f38b83e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 12 16:00:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 16:00:52 2015 +0200

    sched: fix an 'off by one \t' in credit2 debug dump
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 912e1a2..6695729 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -1933,7 +1933,7 @@ csched2_dump(const struct scheduler *ops)
         struct csched2_dom *sdom;
         sdom = list_entry(iter_sdom, struct csched2_dom, sdom_elem);
 
-        printk("\tDomain: %d w %d v %d\n\t",
+        printk("\tDomain: %d w %d v %d\n",
                sdom->dom->domain_id,
                sdom->weight,
                sdom->nr_vcpus);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:40:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1Iw-0001gd-PO; Mon, 19 Oct 2015 03:40:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Iu-0001gS-W8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:09 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	A5/75-10422-81664265; Mon, 19 Oct 2015 03:40:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1445226007!43128219!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26802 invoked from network); 19 Oct 2015 03:40: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;
	19 Oct 2015 03:40:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Is-0005im-Qo
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Is-0004bn-PN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:06 +0000
Date: Mon, 19 Oct 2015 03:40:06 +0000
Message-Id: <E1Zo1Is-0004bn-PN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: fix an 'off by one \t' in
	credit2 debug dump
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9d5c42425cc01f1900c59a517e57ef113f38b83e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 12 16:00:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 16:00:52 2015 +0200

    sched: fix an 'off by one \t' in credit2 debug dump
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 912e1a2..6695729 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -1933,7 +1933,7 @@ csched2_dump(const struct scheduler *ops)
         struct csched2_dom *sdom;
         sdom = list_entry(iter_sdom, struct csched2_dom, sdom_elem);
 
-        printk("\tDomain: %d w %d v %d\n\t",
+        printk("\tDomain: %d w %d v %d\n",
                sdom->dom->domain_id,
                sdom->weight,
                sdom->nr_vcpus);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:40:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1J6-0001iA-Rw; Mon, 19 Oct 2015 03:40: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 1Zo1J5-0001hu-GE
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:19 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	04/82-13905-22664265; Mon, 19 Oct 2015 03:40:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1445226017!43130999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7619 invoked from network); 19 Oct 2015 03:40: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;
	19 Oct 2015 03:40:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1J3-0005iu-6o
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1J3-0004cZ-2t
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:17 +0000
Date: Mon, 19 Oct 2015 03:40:17 +0000
Message-Id: <E1Zo1J3-0004cZ-2t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched / cpupool: dump the actual value
	of NOW()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe35f0c482442e8d180b359d0414c52bdda355f9
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 12 16:01:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 16:01:22 2015 +0200

    sched / cpupool: dump the actual value of NOW()
    
    rather than its hexadecimal representation. This makes
    it easier to compare the actual system time with other
    times being printed out (e.g., deadlines in RTDS).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
---
 xen/common/cpupool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 69b984c..e79850b 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -744,7 +744,7 @@ void dump_runq(unsigned char key)
 
     printk("sched_smt_power_savings: %s\n",
             sched_smt_power_savings? "enabled":"disabled");
-    printk("NOW=0x%08X%08X\n",  (u32)(now>>32), (u32)now);
+    printk("NOW=%"PRI_stime"\n", now);
 
     print_cpumap("Online Cpus", &cpu_online_map);
     if ( !cpumask_empty(&cpupool_free_cpus) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:40:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1J6-0001iA-Rw; Mon, 19 Oct 2015 03:40: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 1Zo1J5-0001hu-GE
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:19 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	04/82-13905-22664265; Mon, 19 Oct 2015 03:40:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1445226017!43130999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7619 invoked from network); 19 Oct 2015 03:40: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;
	19 Oct 2015 03:40:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1J3-0005iu-6o
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1J3-0004cZ-2t
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:17 +0000
Date: Mon, 19 Oct 2015 03:40:17 +0000
Message-Id: <E1Zo1J3-0004cZ-2t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched / cpupool: dump the actual value
	of NOW()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe35f0c482442e8d180b359d0414c52bdda355f9
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 12 16:01:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 16:01:22 2015 +0200

    sched / cpupool: dump the actual value of NOW()
    
    rather than its hexadecimal representation. This makes
    it easier to compare the actual system time with other
    times being printed out (e.g., deadlines in RTDS).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
---
 xen/common/cpupool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 69b984c..e79850b 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -744,7 +744,7 @@ void dump_runq(unsigned char key)
 
     printk("sched_smt_power_savings: %s\n",
             sched_smt_power_savings? "enabled":"disabled");
-    printk("NOW=0x%08X%08X\n",  (u32)(now>>32), (u32)now);
+    printk("NOW=%"PRI_stime"\n", now);
 
     print_cpumap("Online Cpus", &cpu_online_map);
     if ( !cpumask_empty(&cpupool_free_cpus) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:40:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1JG-0001jp-Uc; Mon, 19 Oct 2015 03:40: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 1Zo1JF-0001jZ-Lq
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:29 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	F2/9F-31450-D2664265; Mon, 19 Oct 2015 03:40:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445226027!43128264!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20979 invoked from network); 19 Oct 2015 03:40:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:40:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JD-0005j2-GT
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JD-0004d9-F8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:27 +0000
Date: Mon, 19 Oct 2015 03:40:27 +0000
Message-Id: <E1Zo1JD-0004d9-F8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: Fix missing newline in
	dprintk()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 42940c046902f4dbff383aaae2f1139afbbdfe17
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 12 16:01:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 16:01:56 2015 +0200

    x86/shadow: Fix missing newline in dprintk()
    
    to avoid console corruption.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 3759232..58f131c 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1580,7 +1580,7 @@ shadow_alloc_p2m_page(struct domain *d)
         if ( !d->arch.paging.p2m_alloc_failed )
         {
             d->arch.paging.p2m_alloc_failed = 1;
-            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool",
+            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool\n",
                     d->domain_id);
         }
         paging_unlock(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 Mon Oct 19 03:40:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1JG-0001jp-Uc; Mon, 19 Oct 2015 03:40: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 1Zo1JF-0001jZ-Lq
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:29 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	F2/9F-31450-D2664265; Mon, 19 Oct 2015 03:40:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445226027!43128264!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20979 invoked from network); 19 Oct 2015 03:40:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:40:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JD-0005j2-GT
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JD-0004d9-F8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:27 +0000
Date: Mon, 19 Oct 2015 03:40:27 +0000
Message-Id: <E1Zo1JD-0004d9-F8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: Fix missing newline in
	dprintk()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 42940c046902f4dbff383aaae2f1139afbbdfe17
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 12 16:01:56 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 16:01:56 2015 +0200

    x86/shadow: Fix missing newline in dprintk()
    
    to avoid console corruption.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 3759232..58f131c 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1580,7 +1580,7 @@ shadow_alloc_p2m_page(struct domain *d)
         if ( !d->arch.paging.p2m_alloc_failed )
         {
             d->arch.paging.p2m_alloc_failed = 1;
-            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool",
+            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool\n",
                     d->domain_id);
         }
         paging_unlock(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 Mon Oct 19 03:40:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1JS-0001lj-0z; Mon, 19 Oct 2015 03:40: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 1Zo1JQ-0001lC-JM
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:40 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	AA/F5-30270-73664265; Mon, 19 Oct 2015 03:40:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1445226038!39028066!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22255 invoked from network); 19 Oct 2015 03:40:38 -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;
	19 Oct 2015 03:40:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JN-0005jA-Qd
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JN-0004di-My
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:37 +0000
Date: Mon, 19 Oct 2015 03:40:37 +0000
Message-Id: <E1Zo1JN-0004di-My@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: don't shadow debug with
	"@debug@" in tools build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 973ce7bd8fb1513dcc5ff04760e03915a9eccd08
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Oct 12 16:02:53 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 16:02:53 2015 +0200

    build: don't shadow debug with "@debug@" in tools build
    
    In 16181cbb (tools: Honor Config.mk debug value, rather than setting our
    own), configure doesn't set debug variable anymore. There is, however,
    one place that was missed. The file config/Tools.mk.in was still
    expecting a @debug@ value from configure. After 16181cbb that value
    remained "debug := @debug@" all the time because configure didn't
    substitute it.
    
    The consequence was that we couldn't get a debug build even if debug was
    set to "y" in Config.mk.
    
    Fix this by removing the stray line "debug := @debug@" in Tools.mk.in.
    
    Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 config/Tools.mk.in |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 9bd5f6c..ccfe137 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -5,9 +5,6 @@ ifeq ($(CONFIG_RUMP),y)
 XEN_OS              := NetBSDRump
 endif
 
-# A debug build of tools?
-debug               := @debug@
-
 # Tools path
 BISON               := @BISON@
 FLEX                := @FLEX@
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:40:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1JS-0001lj-0z; Mon, 19 Oct 2015 03:40: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 1Zo1JQ-0001lC-JM
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:40 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	AA/F5-30270-73664265; Mon, 19 Oct 2015 03:40:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1445226038!39028066!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22255 invoked from network); 19 Oct 2015 03:40:38 -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;
	19 Oct 2015 03:40:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JN-0005jA-Qd
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JN-0004di-My
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:37 +0000
Date: Mon, 19 Oct 2015 03:40:37 +0000
Message-Id: <E1Zo1JN-0004di-My@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: don't shadow debug with
	"@debug@" in tools build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 973ce7bd8fb1513dcc5ff04760e03915a9eccd08
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Oct 12 16:02:53 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 16:02:53 2015 +0200

    build: don't shadow debug with "@debug@" in tools build
    
    In 16181cbb (tools: Honor Config.mk debug value, rather than setting our
    own), configure doesn't set debug variable anymore. There is, however,
    one place that was missed. The file config/Tools.mk.in was still
    expecting a @debug@ value from configure. After 16181cbb that value
    remained "debug := @debug@" all the time because configure didn't
    substitute it.
    
    The consequence was that we couldn't get a debug build even if debug was
    set to "y" in Config.mk.
    
    Fix this by removing the stray line "debug := @debug@" in Tools.mk.in.
    
    Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 config/Tools.mk.in |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 9bd5f6c..ccfe137 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -5,9 +5,6 @@ ifeq ($(CONFIG_RUMP),y)
 XEN_OS              := NetBSDRump
 endif
 
-# A debug build of tools?
-debug               := @debug@
-
 # Tools path
 BISON               := @BISON@
 FLEX                := @FLEX@
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:40:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1Jc-0001nj-3c; Mon, 19 Oct 2015 03:40: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 1Zo1Ja-0001nV-JN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:50 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	39/6D-18886-14664265; Mon, 19 Oct 2015 03:40:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445226048!20497274!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20165 invoked from network); 19 Oct 2015 03:40:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:40:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JY-0005jI-2o
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JY-0004f0-1H
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:48 +0000
Date: Mon, 19 Oct 2015 03:40:48 +0000
Message-Id: <E1Zo1JY-0004f0-1H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpufreq: fix notifier block double
	registration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4930444bdf33157763ade5dd959b9a2a7477e0a3
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 12 17:22:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 17:22:02 2015 +0200

    cpufreq: fix notifier block double registration
    
    As a consequence of commit 49388f11d512bb92706ce
    ("x86/cpufreq: relocate the driver register function")
    the cpufreq CPU notifier was being registered twice.
    That resulted in bugs when trying to offline a
    CPU, as reported here:
    
     https://www.mail-archive.com/xen-devel@lists.xen.org/msg41618.html
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/drivers/cpufreq/cpufreq.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 81a187b..6e666e4 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -650,6 +650,5 @@ int __init cpufreq_register_driver(struct cpufreq_driver *driver_data)
 
     cpufreq_driver = driver_data;
 
-    register_cpu_notifier(&cpu_nfb);
     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 Mon Oct 19 03:40:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:40: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 1Zo1Jc-0001nj-3c; Mon, 19 Oct 2015 03:40: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 1Zo1Ja-0001nV-JN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:50 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	39/6D-18886-14664265; Mon, 19 Oct 2015 03:40:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445226048!20497274!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20165 invoked from network); 19 Oct 2015 03:40:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:40:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JY-0005jI-2o
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1JY-0004f0-1H
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:48 +0000
Date: Mon, 19 Oct 2015 03:40:48 +0000
Message-Id: <E1Zo1JY-0004f0-1H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpufreq: fix notifier block double
	registration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4930444bdf33157763ade5dd959b9a2a7477e0a3
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Oct 12 17:22:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 12 17:22:02 2015 +0200

    cpufreq: fix notifier block double registration
    
    As a consequence of commit 49388f11d512bb92706ce
    ("x86/cpufreq: relocate the driver register function")
    the cpufreq CPU notifier was being registered twice.
    That resulted in bugs when trying to offline a
    CPU, as reported here:
    
     https://www.mail-archive.com/xen-devel@lists.xen.org/msg41618.html
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/drivers/cpufreq/cpufreq.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 81a187b..6e666e4 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -650,6 +650,5 @@ int __init cpufreq_register_driver(struct cpufreq_driver *driver_data)
 
     cpufreq_driver = driver_data;
 
-    register_cpu_notifier(&cpu_nfb);
     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 Mon Oct 19 03:41:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1Jm-0001pH-6d; Mon, 19 Oct 2015 03:41:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Jk-0001ow-Qw
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:01 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	BA/6F-01421-C4664265; Mon, 19 Oct 2015 03:41:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445226058!49915625!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11091 invoked from network); 19 Oct 2015 03:40:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:40:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ji-0005jQ-En
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ji-0004fm-BP
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:58 +0000
Date: Mon, 19 Oct 2015 03:40:58 +0000
Message-Id: <E1Zo1Ji-0004fm-BP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: use proper error codes in
	iommu_enable_x2apic_IR()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6851e979874ebc05d270ea94360c49d920d3eaf4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 13 17:16:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:16:22 2015 +0200

    VT-d: use proper error codes in iommu_enable_x2apic_IR()
    
    ... allowing to suppress a confusing message combination: When
    ACPI_DMAR_X2APIC_OPT_OUT is set, so far we first logged a message
    that IR could not be enabled (hence not using x2APIC), followed by
    one indicating successful initialization of IR (if no other problems
    prevented that).
    
    Also adjust the return type of iommu_supports_eim() and fix some
    broken indentation in the function.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/arch/x86/apic.c                    |   12 +++++++++++-
 xen/drivers/passthrough/vtd/intremap.c |   16 ++++++++--------
 xen/include/asm-x86/iommu.h            |    2 +-
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 2c9ae4e..44b1ac9 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -943,8 +943,18 @@ void __init x2apic_bsp_setup(void)
     mask_8259A();
     mask_IO_APIC_setup(ioapic_entries);
 
-    if ( iommu_enable_x2apic_IR() )
+    switch ( iommu_enable_x2apic_IR() )
     {
+    case 0:
+        break;
+    case -ENXIO: /* ACPI_DMAR_X2APIC_OPT_OUT set */
+        if ( !x2apic_enabled )
+        {
+            printk("Not enabling x2APIC (upon firmware request)\n");
+            goto restore_out;
+        }
+        /* fall through */
+    default:
         if ( x2apic_enabled )
             panic("Interrupt remapping could not be enabled while "
                   "x2APIC is already enabled by BIOS");
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 987bbe9..f9ba0ce 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -143,10 +143,10 @@ static void set_hpet_source_id(unsigned int id, struct iremap_entry *ire)
     set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_13_IGNORE_3, hpetid_to_bdf(id));
 }
 
-int iommu_supports_eim(void)
+bool_t iommu_supports_eim(void)
 {
     struct acpi_drhd_unit *drhd;
-    int apic;
+    unsigned int apic;
 
     if ( !iommu_qinval || !iommu_intremap || list_empty(&acpi_drhd_units) )
         return 0;
@@ -154,12 +154,12 @@ int iommu_supports_eim(void)
     /* We MUST have a DRHD unit for each IOAPIC. */
     for ( apic = 0; apic < nr_ioapics; apic++ )
         if ( !ioapic_to_drhd(IO_APIC_ID(apic)) )
-    {
+        {
             dprintk(XENLOG_WARNING VTDPREFIX,
                     "There is not a DRHD for IOAPIC %#x (id: %#x)!\n",
                     apic, IO_APIC_ID(apic));
             return 0;
-    }
+        }
 
     for_each_drhd_unit ( drhd )
         if ( !ecap_queued_inval(drhd->iommu->ecap) ||
@@ -833,10 +833,10 @@ int iommu_enable_x2apic_IR(void)
     struct iommu *iommu;
 
     if ( !iommu_supports_eim() )
-        return -1;
+        return -EOPNOTSUPP;
 
     if ( !platform_supports_x2apic() )
-        return -1;
+        return -ENXIO;
 
     for_each_drhd_unit ( drhd )
     {
@@ -861,7 +861,7 @@ int iommu_enable_x2apic_IR(void)
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "Failed to enable Queued Invalidation!\n");
-            return -1;
+            return -EIO;
         }
     }
 
@@ -873,7 +873,7 @@ int iommu_enable_x2apic_IR(void)
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "Failed to enable Interrupt Remapping!\n");
-            return -1;
+            return -EIO;
         }
     }
 
diff --git a/xen/include/asm-x86/iommu.h b/xen/include/asm-x86/iommu.h
index 29203d7..7e24b1a 100644
--- a/xen/include/asm-x86/iommu.h
+++ b/xen/include/asm-x86/iommu.h
@@ -27,7 +27,7 @@ int iommu_setup_hpet_msi(struct msi_desc *);
 /* While VT-d specific, this must get declared in a generic header. */
 int adjust_vtd_irq_affinities(void);
 void iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte, int order, int present);
-int iommu_supports_eim(void);
+bool_t iommu_supports_eim(void);
 int iommu_enable_x2apic_IR(void);
 void iommu_disable_x2apic_IR(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 Mon Oct 19 03:41:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1Jm-0001pH-6d; Mon, 19 Oct 2015 03:41:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Jk-0001ow-Qw
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:01 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	BA/6F-01421-C4664265; Mon, 19 Oct 2015 03:41:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445226058!49915625!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11091 invoked from network); 19 Oct 2015 03:40:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:40:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ji-0005jQ-En
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ji-0004fm-BP
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:40:58 +0000
Date: Mon, 19 Oct 2015 03:40:58 +0000
Message-Id: <E1Zo1Ji-0004fm-BP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: use proper error codes in
	iommu_enable_x2apic_IR()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6851e979874ebc05d270ea94360c49d920d3eaf4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 13 17:16:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:16:22 2015 +0200

    VT-d: use proper error codes in iommu_enable_x2apic_IR()
    
    ... allowing to suppress a confusing message combination: When
    ACPI_DMAR_X2APIC_OPT_OUT is set, so far we first logged a message
    that IR could not be enabled (hence not using x2APIC), followed by
    one indicating successful initialization of IR (if no other problems
    prevented that).
    
    Also adjust the return type of iommu_supports_eim() and fix some
    broken indentation in the function.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/arch/x86/apic.c                    |   12 +++++++++++-
 xen/drivers/passthrough/vtd/intremap.c |   16 ++++++++--------
 xen/include/asm-x86/iommu.h            |    2 +-
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 2c9ae4e..44b1ac9 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -943,8 +943,18 @@ void __init x2apic_bsp_setup(void)
     mask_8259A();
     mask_IO_APIC_setup(ioapic_entries);
 
-    if ( iommu_enable_x2apic_IR() )
+    switch ( iommu_enable_x2apic_IR() )
     {
+    case 0:
+        break;
+    case -ENXIO: /* ACPI_DMAR_X2APIC_OPT_OUT set */
+        if ( !x2apic_enabled )
+        {
+            printk("Not enabling x2APIC (upon firmware request)\n");
+            goto restore_out;
+        }
+        /* fall through */
+    default:
         if ( x2apic_enabled )
             panic("Interrupt remapping could not be enabled while "
                   "x2APIC is already enabled by BIOS");
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 987bbe9..f9ba0ce 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -143,10 +143,10 @@ static void set_hpet_source_id(unsigned int id, struct iremap_entry *ire)
     set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_13_IGNORE_3, hpetid_to_bdf(id));
 }
 
-int iommu_supports_eim(void)
+bool_t iommu_supports_eim(void)
 {
     struct acpi_drhd_unit *drhd;
-    int apic;
+    unsigned int apic;
 
     if ( !iommu_qinval || !iommu_intremap || list_empty(&acpi_drhd_units) )
         return 0;
@@ -154,12 +154,12 @@ int iommu_supports_eim(void)
     /* We MUST have a DRHD unit for each IOAPIC. */
     for ( apic = 0; apic < nr_ioapics; apic++ )
         if ( !ioapic_to_drhd(IO_APIC_ID(apic)) )
-    {
+        {
             dprintk(XENLOG_WARNING VTDPREFIX,
                     "There is not a DRHD for IOAPIC %#x (id: %#x)!\n",
                     apic, IO_APIC_ID(apic));
             return 0;
-    }
+        }
 
     for_each_drhd_unit ( drhd )
         if ( !ecap_queued_inval(drhd->iommu->ecap) ||
@@ -833,10 +833,10 @@ int iommu_enable_x2apic_IR(void)
     struct iommu *iommu;
 
     if ( !iommu_supports_eim() )
-        return -1;
+        return -EOPNOTSUPP;
 
     if ( !platform_supports_x2apic() )
-        return -1;
+        return -ENXIO;
 
     for_each_drhd_unit ( drhd )
     {
@@ -861,7 +861,7 @@ int iommu_enable_x2apic_IR(void)
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "Failed to enable Queued Invalidation!\n");
-            return -1;
+            return -EIO;
         }
     }
 
@@ -873,7 +873,7 @@ int iommu_enable_x2apic_IR(void)
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "Failed to enable Interrupt Remapping!\n");
-            return -1;
+            return -EIO;
         }
     }
 
diff --git a/xen/include/asm-x86/iommu.h b/xen/include/asm-x86/iommu.h
index 29203d7..7e24b1a 100644
--- a/xen/include/asm-x86/iommu.h
+++ b/xen/include/asm-x86/iommu.h
@@ -27,7 +27,7 @@ int iommu_setup_hpet_msi(struct msi_desc *);
 /* While VT-d specific, this must get declared in a generic header. */
 int adjust_vtd_irq_affinities(void);
 void iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte, int order, int present);
-int iommu_supports_eim(void);
+bool_t iommu_supports_eim(void);
 int iommu_enable_x2apic_IR(void);
 void iommu_disable_x2apic_IR(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 Mon Oct 19 03:41:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1Jy-0001rJ-Ax; Mon, 19 Oct 2015 03:41: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 1Zo1Jx-0001rA-I4
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:13 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	62/26-25435-85664265; Mon, 19 Oct 2015 03:41:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1445226068!53273009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10708 invoked from network); 19 Oct 2015 03:41:09 -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;
	19 Oct 2015 03:41:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Js-0005k1-Q0
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Js-0004ga-Nt
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:08 +0000
Date: Mon, 19 Oct 2015 03:41:08 +0000
Message-Id: <E1Zo1Js-0004ga-Nt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: section placement and type
	adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 245a0cc2ba7559942424b8b4fcc16bfbcf83a964
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 13 17:17:16 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:17:16 2015 +0200

    VT-d: section placement and type adjustments
    
    With x2APIC requiring iommu_supports_eim() to return true, we can
    adjust a few conditonals such that both it and
    platform_supports_x2apic() can be marked __init. For the latter as
    well as for platform_supports_intremap() also change the return types
    to bool_t.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/dmar.c     |    9 +++++----
 xen/drivers/passthrough/vtd/extern.h   |    4 ++--
 xen/drivers/passthrough/vtd/intremap.c |   18 ++++++++++++------
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 34ec4c7..7cad593 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -901,16 +901,17 @@ void acpi_dmar_zap(void)
         write_atomic((uint32_t*)&dmar_table->signature[0], sig);
 }
 
-int platform_supports_intremap(void)
+bool_t platform_supports_intremap(void)
 {
-    unsigned int mask = ACPI_DMAR_INTR_REMAP;
+    const unsigned int mask = ACPI_DMAR_INTR_REMAP;
 
     return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP;
 }
 
-int platform_supports_x2apic(void)
+bool_t __init platform_supports_x2apic(void)
 {
-    unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
+    const unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
+
     return cpu_has_x2apic && ((dmar_flags & mask) == ACPI_DMAR_INTR_REMAP);
 }
 
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index fbfd9a6..cbe0286 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -93,8 +93,8 @@ void vtd_ops_preamble_quirk(struct iommu* iommu);
 void vtd_ops_postamble_quirk(struct iommu* iommu);
 void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map);
 void pci_vtd_quirk(const struct pci_dev *);
-int platform_supports_intremap(void);
-int platform_supports_x2apic(void);
+bool_t platform_supports_intremap(void);
+bool_t platform_supports_x2apic(void);
 
 void vtd_set_hwdom_mapping(struct domain *d);
 
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index f9ba0ce..776ec54 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -143,7 +143,7 @@ static void set_hpet_source_id(unsigned int id, struct iremap_entry *ire)
     set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_13_IGNORE_3, hpetid_to_bdf(id));
 }
 
-bool_t iommu_supports_eim(void)
+bool_t __init iommu_supports_eim(void)
 {
     struct acpi_drhd_unit *drhd;
     unsigned int apic;
@@ -832,11 +832,16 @@ int iommu_enable_x2apic_IR(void)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
 
-    if ( !iommu_supports_eim() )
-        return -EOPNOTSUPP;
+    if ( system_state < SYS_STATE_active )
+    {
+        if ( !iommu_supports_eim() )
+            return -EOPNOTSUPP;
 
-    if ( !platform_supports_x2apic() )
-        return -ENXIO;
+        if ( !platform_supports_x2apic() )
+            return -ENXIO;
+    }
+    else if ( !x2apic_enabled )
+        return -EOPNOTSUPP;
 
     for_each_drhd_unit ( drhd )
     {
@@ -888,7 +893,8 @@ void iommu_disable_x2apic_IR(void)
 {
     struct acpi_drhd_unit *drhd;
 
-    if ( !iommu_supports_eim() )
+    /* x2apic_enabled implies iommu_supports_eim(). */
+    if ( !x2apic_enabled )
         return;
 
     for_each_drhd_unit ( drhd )
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:41:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1Jy-0001rJ-Ax; Mon, 19 Oct 2015 03:41: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 1Zo1Jx-0001rA-I4
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:13 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	62/26-25435-85664265; Mon, 19 Oct 2015 03:41:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1445226068!53273009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10708 invoked from network); 19 Oct 2015 03:41:09 -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;
	19 Oct 2015 03:41:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Js-0005k1-Q0
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Js-0004ga-Nt
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:08 +0000
Date: Mon, 19 Oct 2015 03:41:08 +0000
Message-Id: <E1Zo1Js-0004ga-Nt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: section placement and type
	adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 245a0cc2ba7559942424b8b4fcc16bfbcf83a964
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 13 17:17:16 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:17:16 2015 +0200

    VT-d: section placement and type adjustments
    
    With x2APIC requiring iommu_supports_eim() to return true, we can
    adjust a few conditonals such that both it and
    platform_supports_x2apic() can be marked __init. For the latter as
    well as for platform_supports_intremap() also change the return types
    to bool_t.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/dmar.c     |    9 +++++----
 xen/drivers/passthrough/vtd/extern.h   |    4 ++--
 xen/drivers/passthrough/vtd/intremap.c |   18 ++++++++++++------
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 34ec4c7..7cad593 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -901,16 +901,17 @@ void acpi_dmar_zap(void)
         write_atomic((uint32_t*)&dmar_table->signature[0], sig);
 }
 
-int platform_supports_intremap(void)
+bool_t platform_supports_intremap(void)
 {
-    unsigned int mask = ACPI_DMAR_INTR_REMAP;
+    const unsigned int mask = ACPI_DMAR_INTR_REMAP;
 
     return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP;
 }
 
-int platform_supports_x2apic(void)
+bool_t __init platform_supports_x2apic(void)
 {
-    unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
+    const unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
+
     return cpu_has_x2apic && ((dmar_flags & mask) == ACPI_DMAR_INTR_REMAP);
 }
 
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index fbfd9a6..cbe0286 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -93,8 +93,8 @@ void vtd_ops_preamble_quirk(struct iommu* iommu);
 void vtd_ops_postamble_quirk(struct iommu* iommu);
 void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map);
 void pci_vtd_quirk(const struct pci_dev *);
-int platform_supports_intremap(void);
-int platform_supports_x2apic(void);
+bool_t platform_supports_intremap(void);
+bool_t platform_supports_x2apic(void);
 
 void vtd_set_hwdom_mapping(struct domain *d);
 
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index f9ba0ce..776ec54 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -143,7 +143,7 @@ static void set_hpet_source_id(unsigned int id, struct iremap_entry *ire)
     set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_13_IGNORE_3, hpetid_to_bdf(id));
 }
 
-bool_t iommu_supports_eim(void)
+bool_t __init iommu_supports_eim(void)
 {
     struct acpi_drhd_unit *drhd;
     unsigned int apic;
@@ -832,11 +832,16 @@ int iommu_enable_x2apic_IR(void)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
 
-    if ( !iommu_supports_eim() )
-        return -EOPNOTSUPP;
+    if ( system_state < SYS_STATE_active )
+    {
+        if ( !iommu_supports_eim() )
+            return -EOPNOTSUPP;
 
-    if ( !platform_supports_x2apic() )
-        return -ENXIO;
+        if ( !platform_supports_x2apic() )
+            return -ENXIO;
+    }
+    else if ( !x2apic_enabled )
+        return -EOPNOTSUPP;
 
     for_each_drhd_unit ( drhd )
     {
@@ -888,7 +893,8 @@ void iommu_disable_x2apic_IR(void)
 {
     struct acpi_drhd_unit *drhd;
 
-    if ( !iommu_supports_eim() )
+    /* x2apic_enabled implies iommu_supports_eim(). */
+    if ( !x2apic_enabled )
         return;
 
     for_each_drhd_unit ( drhd )
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:41:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1K6-0001sf-DS; Mon, 19 Oct 2015 03:41:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1K5-0001sQ-NM
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:21 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	83/45-05979-06664265; Mon, 19 Oct 2015 03:41:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1445226079!54372036!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4877 invoked from network); 19 Oct 2015 03:41:20 -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;
	19 Oct 2015 03:41:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1K3-0005k9-5R
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1K3-0004hJ-3f
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:19 +0000
Date: Mon, 19 Oct 2015 03:41:19 +0000
Message-Id: <E1Zo1K3-0004hJ-3f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: hide MWAITX from PV domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 941cd44324db7eddc46cba4596fa13d505066ccf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 13 17:17:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:17:52 2015 +0200

    x86: hide MWAITX from PV domains
    
    Since MWAIT is hidden too. (Linux starting with 4.3 is making use of
    that feature, and is checking for it without looking at the MWAIT one.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c             |    1 +
 xen/include/asm-x86/cpufeature.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 07feb6d..f1fc7b7 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -964,6 +964,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_LWP % 32, &c);
         __clear_bit(X86_FEATURE_NODEID_MSR % 32, &c);
         __clear_bit(X86_FEATURE_TOPOEXT % 32, &c);
+        __clear_bit(X86_FEATURE_MWAITX % 32, &c);
         break;
 
     case 0x0000000a: /* Architectural Performance Monitor Features (Intel) */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index c88a6ab..3934934 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -140,6 +140,7 @@
 #define X86_FEATURE_TBM         (6*32+21) /* trailing bit manipulations */
 #define X86_FEATURE_TOPOEXT     (6*32+22) /* topology extensions CPUID leafs */
 #define X86_FEATURE_DBEXT       (6*32+26) /* data breakpoint extension */
+#define X86_FEATURE_MWAITX      (6*32+29) /* MWAIT extension (MONITORX/MWAITX) */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:41:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1K6-0001sf-DS; Mon, 19 Oct 2015 03:41:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1K5-0001sQ-NM
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:21 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	83/45-05979-06664265; Mon, 19 Oct 2015 03:41:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1445226079!54372036!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4877 invoked from network); 19 Oct 2015 03:41:20 -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;
	19 Oct 2015 03:41:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1K3-0005k9-5R
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1K3-0004hJ-3f
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:19 +0000
Date: Mon, 19 Oct 2015 03:41:19 +0000
Message-Id: <E1Zo1K3-0004hJ-3f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: hide MWAITX from PV domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 941cd44324db7eddc46cba4596fa13d505066ccf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 13 17:17:52 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:17:52 2015 +0200

    x86: hide MWAITX from PV domains
    
    Since MWAIT is hidden too. (Linux starting with 4.3 is making use of
    that feature, and is checking for it without looking at the MWAIT one.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c             |    1 +
 xen/include/asm-x86/cpufeature.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 07feb6d..f1fc7b7 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -964,6 +964,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_LWP % 32, &c);
         __clear_bit(X86_FEATURE_NODEID_MSR % 32, &c);
         __clear_bit(X86_FEATURE_TOPOEXT % 32, &c);
+        __clear_bit(X86_FEATURE_MWAITX % 32, &c);
         break;
 
     case 0x0000000a: /* Architectural Performance Monitor Features (Intel) */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index c88a6ab..3934934 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -140,6 +140,7 @@
 #define X86_FEATURE_TBM         (6*32+21) /* trailing bit manipulations */
 #define X86_FEATURE_TOPOEXT     (6*32+22) /* topology extensions CPUID leafs */
 #define X86_FEATURE_DBEXT       (6*32+26) /* data breakpoint extension */
+#define X86_FEATURE_MWAITX      (6*32+29) /* MWAIT extension (MONITORX/MWAITX) */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:41:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1KG-0001uC-GH; Mon, 19 Oct 2015 03:41:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KF-0001u3-Rj
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:31 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	05/46-25435-B6664265; Mon, 19 Oct 2015 03:41:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445226089!20497344!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22722 invoked from network); 19 Oct 2015 03:41: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;
	19 Oct 2015 03:41:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KD-0005kH-J5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KD-0004hy-Dr
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:29 +0000
Date: Mon, 19 Oct 2015 03:41:29 +0000
Message-Id: <E1Zo1KD-0004hy-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/time: slightly streamline
	__update_vcpu_system_time()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 838eefd6eb95af1009cd89feeb5dc02d365cf482
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 13 17:18:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:18:34 2015 +0200

    x86/time: slightly streamline __update_vcpu_system_time()
    
    Fold two if()-s using the same condition, converting the memset() so
    far separating them to a simple initializer. Move common assignments
    out of the conditional. Drop an unnecessary initializer.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/time.c |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index b334f2f..5d7452a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -790,9 +790,9 @@ uint64_t tsc_ticks2ns(uint64_t ticks)
 static void __update_vcpu_system_time(struct vcpu *v, int force)
 {
     struct cpu_time       *t;
-    struct vcpu_time_info *u, _u;
+    struct vcpu_time_info *u, _u = {};
     struct domain *d = v->domain;
-    s_time_t tsc_stamp = 0;
+    s_time_t tsc_stamp;
 
     if ( v->vcpu_info == NULL )
         return;
@@ -816,28 +816,21 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
         }
         else
             tsc_stamp = gtime_to_gtsc(d, stime);
-    }
-    else
-    {
-        tsc_stamp = t->local_tsc_stamp;
-    }
-
-    memset(&_u, 0, sizeof(_u));
 
-    if ( d->arch.vtsc )
-    {
-        _u.tsc_timestamp     = tsc_stamp;
-        _u.system_time       = t->stime_local_stamp;
         _u.tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
         _u.tsc_shift         = d->arch.vtsc_to_ns.shift;
     }
     else
     {
-        _u.tsc_timestamp     = t->local_tsc_stamp;
-        _u.system_time       = t->stime_local_stamp;
+        tsc_stamp = t->local_tsc_stamp;
+
         _u.tsc_to_system_mul = t->tsc_scale.mul_frac;
         _u.tsc_shift         = (s8)t->tsc_scale.shift;
     }
+
+    _u.tsc_timestamp = tsc_stamp;
+    _u.system_time   = t->stime_local_stamp;
+
     if ( is_hvm_domain(d) )
         _u.tsc_timestamp += v->arch.hvm_vcpu.cache_tsc_offset;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:41:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1KG-0001uC-GH; Mon, 19 Oct 2015 03:41:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KF-0001u3-Rj
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:31 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	05/46-25435-B6664265; Mon, 19 Oct 2015 03:41:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445226089!20497344!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22722 invoked from network); 19 Oct 2015 03:41: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;
	19 Oct 2015 03:41:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KD-0005kH-J5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KD-0004hy-Dr
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:29 +0000
Date: Mon, 19 Oct 2015 03:41:29 +0000
Message-Id: <E1Zo1KD-0004hy-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/time: slightly streamline
	__update_vcpu_system_time()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 838eefd6eb95af1009cd89feeb5dc02d365cf482
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 13 17:18:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:18:34 2015 +0200

    x86/time: slightly streamline __update_vcpu_system_time()
    
    Fold two if()-s using the same condition, converting the memset() so
    far separating them to a simple initializer. Move common assignments
    out of the conditional. Drop an unnecessary initializer.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/time.c |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index b334f2f..5d7452a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -790,9 +790,9 @@ uint64_t tsc_ticks2ns(uint64_t ticks)
 static void __update_vcpu_system_time(struct vcpu *v, int force)
 {
     struct cpu_time       *t;
-    struct vcpu_time_info *u, _u;
+    struct vcpu_time_info *u, _u = {};
     struct domain *d = v->domain;
-    s_time_t tsc_stamp = 0;
+    s_time_t tsc_stamp;
 
     if ( v->vcpu_info == NULL )
         return;
@@ -816,28 +816,21 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
         }
         else
             tsc_stamp = gtime_to_gtsc(d, stime);
-    }
-    else
-    {
-        tsc_stamp = t->local_tsc_stamp;
-    }
-
-    memset(&_u, 0, sizeof(_u));
 
-    if ( d->arch.vtsc )
-    {
-        _u.tsc_timestamp     = tsc_stamp;
-        _u.system_time       = t->stime_local_stamp;
         _u.tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
         _u.tsc_shift         = d->arch.vtsc_to_ns.shift;
     }
     else
     {
-        _u.tsc_timestamp     = t->local_tsc_stamp;
-        _u.system_time       = t->stime_local_stamp;
+        tsc_stamp = t->local_tsc_stamp;
+
         _u.tsc_to_system_mul = t->tsc_scale.mul_frac;
         _u.tsc_shift         = (s8)t->tsc_scale.shift;
     }
+
+    _u.tsc_timestamp = tsc_stamp;
+    _u.system_time   = t->stime_local_stamp;
+
     if ( is_hvm_domain(d) )
         _u.tsc_timestamp += v->arch.hvm_vcpu.cache_tsc_offset;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:41:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1KR-0001vm-It; Mon, 19 Oct 2015 03:41:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KQ-0001vY-CB
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:42 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	8A/6A-12889-57664265; Mon, 19 Oct 2015 03:41:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1445226100!40602862!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10862 invoked from network); 19 Oct 2015 03:41:40 -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;
	19 Oct 2015 03:41:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KN-0005kP-Th
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KN-0004iZ-Qg
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:39 +0000
Date: Mon, 19 Oct 2015 03:41:39 +0000
Message-Id: <E1Zo1KN-0004iZ-Qg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: drop unused declarations from
	processor.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ed740187a5d8a7fcec2116c410d850f1b54a0603
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 13 17:19:07 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:19:07 2015 +0200

    x86: drop unused declarations from processor.h
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c           |    1 -
 xen/include/asm-x86/processor.h |    5 -----
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 7ca9b93..91c04f8 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1475,7 +1475,6 @@ static void paravirt_ctxt_switch_to(struct vcpu *v)
 {
     unsigned long cr4;
 
-    set_int80_direct_trap(v);
     switch_kernel_stack(v);
 
     cr4 = pv_guest_cr4_to_real_cr4(v);
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index f507f5e..fcfa7dd 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -219,7 +219,6 @@ extern void identify_cpu(struct cpuinfo_x86 *);
 extern void setup_clear_cpu_cap(unsigned int);
 extern void print_cpu_info(unsigned int cpu);
 extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
-extern void dodgy_tsc(void);
 
 extern void detect_extended_topology(struct cpuinfo_x86 *c);
 
@@ -471,10 +470,6 @@ DECLARE_PER_CPU(struct tss_struct, init_tss);
 
 extern void init_int80_direct_trap(struct vcpu *v);
 
-#define set_int80_direct_trap(_ed)  ((void)0)
-
-extern int gpf_emulate_4gb(struct cpu_user_regs *regs);
-
 extern void write_ptbase(struct vcpu *v);
 
 void destroy_gdt(struct vcpu *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 Mon Oct 19 03:41:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1KR-0001vm-It; Mon, 19 Oct 2015 03:41:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KQ-0001vY-CB
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:42 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	8A/6A-12889-57664265; Mon, 19 Oct 2015 03:41:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1445226100!40602862!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10862 invoked from network); 19 Oct 2015 03:41:40 -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;
	19 Oct 2015 03:41:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KN-0005kP-Th
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KN-0004iZ-Qg
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:39 +0000
Date: Mon, 19 Oct 2015 03:41:39 +0000
Message-Id: <E1Zo1KN-0004iZ-Qg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: drop unused declarations from
	processor.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ed740187a5d8a7fcec2116c410d850f1b54a0603
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 13 17:19:07 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 13 17:19:07 2015 +0200

    x86: drop unused declarations from processor.h
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c           |    1 -
 xen/include/asm-x86/processor.h |    5 -----
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 7ca9b93..91c04f8 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1475,7 +1475,6 @@ static void paravirt_ctxt_switch_to(struct vcpu *v)
 {
     unsigned long cr4;
 
-    set_int80_direct_trap(v);
     switch_kernel_stack(v);
 
     cr4 = pv_guest_cr4_to_real_cr4(v);
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index f507f5e..fcfa7dd 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -219,7 +219,6 @@ extern void identify_cpu(struct cpuinfo_x86 *);
 extern void setup_clear_cpu_cap(unsigned int);
 extern void print_cpu_info(unsigned int cpu);
 extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
-extern void dodgy_tsc(void);
 
 extern void detect_extended_topology(struct cpuinfo_x86 *c);
 
@@ -471,10 +470,6 @@ DECLARE_PER_CPU(struct tss_struct, init_tss);
 
 extern void init_int80_direct_trap(struct vcpu *v);
 
-#define set_int80_direct_trap(_ed)  ((void)0)
-
-extern int gpf_emulate_4gb(struct cpu_user_regs *regs);
-
 extern void write_ptbase(struct vcpu *v);
 
 void destroy_gdt(struct vcpu *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 Mon Oct 19 03:41:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1Kc-0001xH-Ls; Mon, 19 Oct 2015 03:41: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 1Zo1Kb-0001x0-C8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:53 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	C7/9F-28221-08664265; Mon, 19 Oct 2015 03:41:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1445226110!56721073!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 26830 invoked from network); 19 Oct 2015 03:41:51 -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;
	19 Oct 2015 03:41:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KY-0005kY-8e
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KY-0004ju-5N
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:50 +0000
Date: Mon, 19 Oct 2015 03:41:50 +0000
Message-Id: <E1Zo1KY-0004ju-5N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: support enable CDP by boot
	parameter and add get CDP status
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 56b9a5130f08cca7c3a5853c87d62a2dd9b7ebc1
Author:     He Chen <he.chen@linux.intel.com>
AuthorDate: Wed Oct 14 12:44:40 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:44:40 2015 +0200

    x86: support enable CDP by boot parameter and add get CDP status
    
    Add boot parameter `psr=cdp` to enable CDP at boot time.
    Intel Code/Data Prioritization (CDP) feature is based on CAT. Note that
    cos_max would be half when CDP is on. struct psr_cat_cbm is extended to
    support CDP operation. Extend psr_get_cat_l3_info sysctl to get CDP
    status.
    
    Signed-off-by: He Chen <he.chen@linux.intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 docs/misc/xen-command-line.markdown |   11 ++++++-
 xen/arch/x86/psr.c                  |   51 ++++++++++++++++++++++++++++++++---
 xen/arch/x86/sysctl.c               |    5 ++-
 xen/include/asm-x86/msr-index.h     |    3 ++
 xen/include/asm-x86/psr.h           |    8 +++++-
 xen/include/public/sysctl.h         |    4 ++-
 6 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a565c1b..416e559 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1174,9 +1174,9 @@ This option can be specified more than once (up to 8 times at present).
 > `= <integer>`
 
 ### psr (Intel)
-> `= List of ( cmt:<boolean> | rmid_max:<integer> | cat:<boolean> | cos_max:<integer> )`
+> `= List of ( cmt:<boolean> | rmid_max:<integer> | cat:<boolean> | cos_max:<integer> | cdp:<boolean> )`
 
-> Default: `psr=cmt:0,rmid_max:255,cat:0,cos_max:255`
+> Default: `psr=cmt:0,rmid_max:255,cat:0,cos_max:255,cdp:0`
 
 Platform Shared Resource(PSR) Services.  Intel Haswell and later server
 platforms offer information about the sharing of resources.
@@ -1206,6 +1206,13 @@ The following resources are available:
   the cache allocation.
   * `cat` instructs Xen to enable/disable Cache Allocation Technology.
   * `cos_max` indicates the max value for COS ID.
+* Code and Data Prioritization Technology (Broadwell and later). Information
+  regarding the code cache and the data cache allocation. CDP is based on CAT.
+  * `cdp` instructs Xen to enable/disable Code and Data Prioritization. Note
+    that `cos_max` of CDP is a little different from `cos_max` of CAT. With
+    CDP, one COS will corespond two CBMs other than one with CAT, due to the
+    sum of CBMs is fixed, that means actual `cos_max` in use will automatically
+    reduce to half when CDP is enabled.
 
 ### reboot
 > `= t[riple] | k[bd] | a[cpi] | p[ci] | P[ower] | e[fi] | n[o] [, [w]arm | [c]old]`
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index c0daa2e..5ddeb2b 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -21,9 +21,16 @@
 
 #define PSR_CMT        (1<<0)
 #define PSR_CAT        (1<<1)
+#define PSR_CDP        (1<<2)
 
 struct psr_cat_cbm {
-    uint64_t cbm;
+    union {
+        uint64_t cbm;
+        struct {
+            uint64_t code;
+            uint64_t data;
+        };
+    };
     unsigned int ref;
 };
 
@@ -43,6 +50,7 @@ struct psr_cmt *__read_mostly psr_cmt;
 
 static unsigned long *__read_mostly cat_socket_enable;
 static struct psr_cat_socket_info *__read_mostly cat_socket_info;
+static unsigned long *__read_mostly cdp_socket_enable;
 
 static unsigned int __initdata opt_psr;
 static unsigned int __initdata opt_rmid_max = 255;
@@ -94,6 +102,7 @@ static void __init parse_psr_param(char *s)
 
         parse_psr_bool(s, val_str, "cmt", PSR_CMT);
         parse_psr_bool(s, val_str, "cat", PSR_CAT);
+        parse_psr_bool(s, val_str, "cdp", PSR_CDP);
 
         if ( val_str && !strcmp(s, "rmid_max") )
             opt_rmid_max = simple_strtoul(val_str, NULL, 0);
@@ -261,8 +270,13 @@ static struct psr_cat_socket_info *get_cat_socket_info(unsigned int socket)
     return cat_socket_info + socket;
 }
 
+static inline bool_t cdp_is_enabled(unsigned int socket)
+{
+    return cdp_socket_enable && test_bit(socket, cdp_socket_enable);
+}
+
 int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
-                        uint32_t *cos_max)
+                        uint32_t *cos_max, uint32_t *flags)
 {
     struct psr_cat_socket_info *info = get_cat_socket_info(socket);
 
@@ -272,6 +286,10 @@ int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
     *cbm_len = info->cbm_len;
     *cos_max = info->cos_max;
 
+    *flags = 0;
+    if ( cdp_is_enabled(socket) )
+        *flags |= XEN_SYSCTL_PSR_CAT_L3_CDP;
+
     return 0;
 }
 
@@ -470,6 +488,7 @@ static void cat_cpu_init(void)
     struct psr_cat_socket_info *info;
     unsigned int socket;
     unsigned int cpu = smp_processor_id();
+    uint64_t val;
     const struct cpuinfo_x86 *c = cpu_data + cpu;
 
     if ( !cpu_has(c, X86_FEATURE_CAT) || c->cpuid_level < PSR_CPUID_LEVEL_CAT )
@@ -495,8 +514,27 @@ static void cat_cpu_init(void)
         spin_lock_init(&info->cbm_lock);
 
         set_bit(socket, cat_socket_enable);
-        printk(XENLOG_INFO "CAT: enabled on socket %u, cos_max:%u, cbm_len:%u\n",
-               socket, info->cos_max, info->cbm_len);
+
+        if ( (ecx & PSR_CAT_CDP_CAPABILITY) && (opt_psr & PSR_CDP) &&
+             cdp_socket_enable && !test_bit(socket, cdp_socket_enable) )
+        {
+            info->cos_to_cbm[0].code = (1ull << info->cbm_len) - 1;
+            info->cos_to_cbm[0].data = (1ull << info->cbm_len) - 1;
+
+            /* We only write mask1 since mask0 is always all ones by default. */
+            wrmsrl(MSR_IA32_PSR_L3_MASK(1), (1ull << info->cbm_len) - 1);
+
+            rdmsrl(MSR_IA32_PSR_L3_QOS_CFG, val);
+            wrmsrl(MSR_IA32_PSR_L3_QOS_CFG, val | (1 << PSR_L3_QOS_CDP_ENABLE_BIT));
+
+            /* Cut half of cos_max when CDP is enabled. */
+            info->cos_max >>= 1;
+
+            set_bit(socket, cdp_socket_enable);
+        }
+        printk(XENLOG_INFO "CAT: enabled on socket %u, cos_max:%u, cbm_len:%u, CDP:%s\n",
+               socket, info->cos_max, info->cbm_len,
+               cdp_is_enabled(socket) ? "on" : "off");
     }
 }
 
@@ -513,6 +551,10 @@ static void cat_cpu_fini(unsigned int cpu)
             xfree(info->cos_to_cbm);
             info->cos_to_cbm = NULL;
         }
+
+        if ( cdp_is_enabled(socket) )
+            clear_bit(socket, cdp_socket_enable);
+
         clear_bit(socket, cat_socket_enable);
     }
 }
@@ -535,6 +577,7 @@ static void __init init_psr_cat(void)
 
     cat_socket_enable = xzalloc_array(unsigned long, BITS_TO_LONGS(nr_sockets));
     cat_socket_info = xzalloc_array(struct psr_cat_socket_info, nr_sockets);
+    cdp_socket_enable = xzalloc_array(unsigned long, BITS_TO_LONGS(nr_sockets));
 
     if ( !cat_socket_enable || !cat_socket_info )
         psr_cat_free();
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 38b5dcb..e54ddac 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -178,12 +178,13 @@ long arch_do_sysctl(
         case XEN_SYSCTL_PSR_CAT_get_l3_info:
             ret = psr_get_cat_l3_info(sysctl->u.psr_cat_op.target,
                                       &sysctl->u.psr_cat_op.u.l3_info.cbm_len,
-                                      &sysctl->u.psr_cat_op.u.l3_info.cos_max);
+                                      &sysctl->u.psr_cat_op.u.l3_info.cos_max,
+                                      &sysctl->u.psr_cat_op.u.l3_info.flags);
 
             if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) )
                 ret = -EFAULT;
-
             break;
+
         default:
             ret = -EOPNOTSUPP;
             break;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index e9c4723..65c1d02 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -328,7 +328,10 @@
 #define MSR_IA32_CMT_EVTSEL		0x00000c8d
 #define MSR_IA32_CMT_CTR		0x00000c8e
 #define MSR_IA32_PSR_ASSOC		0x00000c8f
+#define MSR_IA32_PSR_L3_QOS_CFG	0x00000c81
 #define MSR_IA32_PSR_L3_MASK(n)	(0x00000c90 + (n))
+#define MSR_IA32_PSR_L3_MASK_CODE(n)	(0x00000c90 + (n) * 2 + 1)
+#define MSR_IA32_PSR_L3_MASK_DATA(n)	(0x00000c90 + (n) * 2)
 
 /* Intel Model 6 */
 #define MSR_P6_PERFCTR(n)		(0x000000c1 + (n))
diff --git a/xen/include/asm-x86/psr.h b/xen/include/asm-x86/psr.h
index 081750f..5faeaaf 100644
--- a/xen/include/asm-x86/psr.h
+++ b/xen/include/asm-x86/psr.h
@@ -27,6 +27,12 @@
 /* L3 Monitoring Features */
 #define PSR_CMT_L3_OCCUPANCY           0x1
 
+/* CDP Capability */
+#define PSR_CAT_CDP_CAPABILITY       (1u << 2)
+
+/* L3 CDP Enable bit*/
+#define PSR_L3_QOS_CDP_ENABLE_BIT       0x0
+
 struct psr_cmt_l3 {
     unsigned int features;
     unsigned int upscaling_factor;
@@ -52,7 +58,7 @@ void psr_free_rmid(struct domain *d);
 void psr_ctxt_switch_to(struct domain *d);
 
 int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
-                        uint32_t *cos_max);
+                        uint32_t *cos_max, uint32_t *flags);
 int psr_get_l3_cbm(struct domain *d, unsigned int socket, uint64_t *cbm);
 int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm);
 
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 0cacacc..96680eb 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -36,7 +36,7 @@
 #include "physdev.h"
 #include "tmem.h"
 
-#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000C
+#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000D
 
 /*
  * Read console content from Xen buffer ring.
@@ -705,6 +705,8 @@ struct xen_sysctl_psr_cat_op {
         struct {
             uint32_t cbm_len;   /* OUT: CBM length */
             uint32_t cos_max;   /* OUT: Maximum COS */
+#define XEN_SYSCTL_PSR_CAT_L3_CDP       (1u << 0)
+            uint32_t flags;     /* OUT: CAT flags */
         } l3_info;
     } u;
 };
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:41:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:41: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 1Zo1Kc-0001xH-Ls; Mon, 19 Oct 2015 03:41: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 1Zo1Kb-0001x0-C8
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:53 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	C7/9F-28221-08664265; Mon, 19 Oct 2015 03:41:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1445226110!56721073!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 26830 invoked from network); 19 Oct 2015 03:41:51 -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;
	19 Oct 2015 03:41:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KY-0005kY-8e
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1KY-0004ju-5N
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:41:50 +0000
Date: Mon, 19 Oct 2015 03:41:50 +0000
Message-Id: <E1Zo1KY-0004ju-5N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: support enable CDP by boot
	parameter and add get CDP status
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 56b9a5130f08cca7c3a5853c87d62a2dd9b7ebc1
Author:     He Chen <he.chen@linux.intel.com>
AuthorDate: Wed Oct 14 12:44:40 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:44:40 2015 +0200

    x86: support enable CDP by boot parameter and add get CDP status
    
    Add boot parameter `psr=cdp` to enable CDP at boot time.
    Intel Code/Data Prioritization (CDP) feature is based on CAT. Note that
    cos_max would be half when CDP is on. struct psr_cat_cbm is extended to
    support CDP operation. Extend psr_get_cat_l3_info sysctl to get CDP
    status.
    
    Signed-off-by: He Chen <he.chen@linux.intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 docs/misc/xen-command-line.markdown |   11 ++++++-
 xen/arch/x86/psr.c                  |   51 ++++++++++++++++++++++++++++++++---
 xen/arch/x86/sysctl.c               |    5 ++-
 xen/include/asm-x86/msr-index.h     |    3 ++
 xen/include/asm-x86/psr.h           |    8 +++++-
 xen/include/public/sysctl.h         |    4 ++-
 6 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a565c1b..416e559 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1174,9 +1174,9 @@ This option can be specified more than once (up to 8 times at present).
 > `= <integer>`
 
 ### psr (Intel)
-> `= List of ( cmt:<boolean> | rmid_max:<integer> | cat:<boolean> | cos_max:<integer> )`
+> `= List of ( cmt:<boolean> | rmid_max:<integer> | cat:<boolean> | cos_max:<integer> | cdp:<boolean> )`
 
-> Default: `psr=cmt:0,rmid_max:255,cat:0,cos_max:255`
+> Default: `psr=cmt:0,rmid_max:255,cat:0,cos_max:255,cdp:0`
 
 Platform Shared Resource(PSR) Services.  Intel Haswell and later server
 platforms offer information about the sharing of resources.
@@ -1206,6 +1206,13 @@ The following resources are available:
   the cache allocation.
   * `cat` instructs Xen to enable/disable Cache Allocation Technology.
   * `cos_max` indicates the max value for COS ID.
+* Code and Data Prioritization Technology (Broadwell and later). Information
+  regarding the code cache and the data cache allocation. CDP is based on CAT.
+  * `cdp` instructs Xen to enable/disable Code and Data Prioritization. Note
+    that `cos_max` of CDP is a little different from `cos_max` of CAT. With
+    CDP, one COS will corespond two CBMs other than one with CAT, due to the
+    sum of CBMs is fixed, that means actual `cos_max` in use will automatically
+    reduce to half when CDP is enabled.
 
 ### reboot
 > `= t[riple] | k[bd] | a[cpi] | p[ci] | P[ower] | e[fi] | n[o] [, [w]arm | [c]old]`
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index c0daa2e..5ddeb2b 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -21,9 +21,16 @@
 
 #define PSR_CMT        (1<<0)
 #define PSR_CAT        (1<<1)
+#define PSR_CDP        (1<<2)
 
 struct psr_cat_cbm {
-    uint64_t cbm;
+    union {
+        uint64_t cbm;
+        struct {
+            uint64_t code;
+            uint64_t data;
+        };
+    };
     unsigned int ref;
 };
 
@@ -43,6 +50,7 @@ struct psr_cmt *__read_mostly psr_cmt;
 
 static unsigned long *__read_mostly cat_socket_enable;
 static struct psr_cat_socket_info *__read_mostly cat_socket_info;
+static unsigned long *__read_mostly cdp_socket_enable;
 
 static unsigned int __initdata opt_psr;
 static unsigned int __initdata opt_rmid_max = 255;
@@ -94,6 +102,7 @@ static void __init parse_psr_param(char *s)
 
         parse_psr_bool(s, val_str, "cmt", PSR_CMT);
         parse_psr_bool(s, val_str, "cat", PSR_CAT);
+        parse_psr_bool(s, val_str, "cdp", PSR_CDP);
 
         if ( val_str && !strcmp(s, "rmid_max") )
             opt_rmid_max = simple_strtoul(val_str, NULL, 0);
@@ -261,8 +270,13 @@ static struct psr_cat_socket_info *get_cat_socket_info(unsigned int socket)
     return cat_socket_info + socket;
 }
 
+static inline bool_t cdp_is_enabled(unsigned int socket)
+{
+    return cdp_socket_enable && test_bit(socket, cdp_socket_enable);
+}
+
 int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
-                        uint32_t *cos_max)
+                        uint32_t *cos_max, uint32_t *flags)
 {
     struct psr_cat_socket_info *info = get_cat_socket_info(socket);
 
@@ -272,6 +286,10 @@ int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
     *cbm_len = info->cbm_len;
     *cos_max = info->cos_max;
 
+    *flags = 0;
+    if ( cdp_is_enabled(socket) )
+        *flags |= XEN_SYSCTL_PSR_CAT_L3_CDP;
+
     return 0;
 }
 
@@ -470,6 +488,7 @@ static void cat_cpu_init(void)
     struct psr_cat_socket_info *info;
     unsigned int socket;
     unsigned int cpu = smp_processor_id();
+    uint64_t val;
     const struct cpuinfo_x86 *c = cpu_data + cpu;
 
     if ( !cpu_has(c, X86_FEATURE_CAT) || c->cpuid_level < PSR_CPUID_LEVEL_CAT )
@@ -495,8 +514,27 @@ static void cat_cpu_init(void)
         spin_lock_init(&info->cbm_lock);
 
         set_bit(socket, cat_socket_enable);
-        printk(XENLOG_INFO "CAT: enabled on socket %u, cos_max:%u, cbm_len:%u\n",
-               socket, info->cos_max, info->cbm_len);
+
+        if ( (ecx & PSR_CAT_CDP_CAPABILITY) && (opt_psr & PSR_CDP) &&
+             cdp_socket_enable && !test_bit(socket, cdp_socket_enable) )
+        {
+            info->cos_to_cbm[0].code = (1ull << info->cbm_len) - 1;
+            info->cos_to_cbm[0].data = (1ull << info->cbm_len) - 1;
+
+            /* We only write mask1 since mask0 is always all ones by default. */
+            wrmsrl(MSR_IA32_PSR_L3_MASK(1), (1ull << info->cbm_len) - 1);
+
+            rdmsrl(MSR_IA32_PSR_L3_QOS_CFG, val);
+            wrmsrl(MSR_IA32_PSR_L3_QOS_CFG, val | (1 << PSR_L3_QOS_CDP_ENABLE_BIT));
+
+            /* Cut half of cos_max when CDP is enabled. */
+            info->cos_max >>= 1;
+
+            set_bit(socket, cdp_socket_enable);
+        }
+        printk(XENLOG_INFO "CAT: enabled on socket %u, cos_max:%u, cbm_len:%u, CDP:%s\n",
+               socket, info->cos_max, info->cbm_len,
+               cdp_is_enabled(socket) ? "on" : "off");
     }
 }
 
@@ -513,6 +551,10 @@ static void cat_cpu_fini(unsigned int cpu)
             xfree(info->cos_to_cbm);
             info->cos_to_cbm = NULL;
         }
+
+        if ( cdp_is_enabled(socket) )
+            clear_bit(socket, cdp_socket_enable);
+
         clear_bit(socket, cat_socket_enable);
     }
 }
@@ -535,6 +577,7 @@ static void __init init_psr_cat(void)
 
     cat_socket_enable = xzalloc_array(unsigned long, BITS_TO_LONGS(nr_sockets));
     cat_socket_info = xzalloc_array(struct psr_cat_socket_info, nr_sockets);
+    cdp_socket_enable = xzalloc_array(unsigned long, BITS_TO_LONGS(nr_sockets));
 
     if ( !cat_socket_enable || !cat_socket_info )
         psr_cat_free();
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 38b5dcb..e54ddac 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -178,12 +178,13 @@ long arch_do_sysctl(
         case XEN_SYSCTL_PSR_CAT_get_l3_info:
             ret = psr_get_cat_l3_info(sysctl->u.psr_cat_op.target,
                                       &sysctl->u.psr_cat_op.u.l3_info.cbm_len,
-                                      &sysctl->u.psr_cat_op.u.l3_info.cos_max);
+                                      &sysctl->u.psr_cat_op.u.l3_info.cos_max,
+                                      &sysctl->u.psr_cat_op.u.l3_info.flags);
 
             if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) )
                 ret = -EFAULT;
-
             break;
+
         default:
             ret = -EOPNOTSUPP;
             break;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index e9c4723..65c1d02 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -328,7 +328,10 @@
 #define MSR_IA32_CMT_EVTSEL		0x00000c8d
 #define MSR_IA32_CMT_CTR		0x00000c8e
 #define MSR_IA32_PSR_ASSOC		0x00000c8f
+#define MSR_IA32_PSR_L3_QOS_CFG	0x00000c81
 #define MSR_IA32_PSR_L3_MASK(n)	(0x00000c90 + (n))
+#define MSR_IA32_PSR_L3_MASK_CODE(n)	(0x00000c90 + (n) * 2 + 1)
+#define MSR_IA32_PSR_L3_MASK_DATA(n)	(0x00000c90 + (n) * 2)
 
 /* Intel Model 6 */
 #define MSR_P6_PERFCTR(n)		(0x000000c1 + (n))
diff --git a/xen/include/asm-x86/psr.h b/xen/include/asm-x86/psr.h
index 081750f..5faeaaf 100644
--- a/xen/include/asm-x86/psr.h
+++ b/xen/include/asm-x86/psr.h
@@ -27,6 +27,12 @@
 /* L3 Monitoring Features */
 #define PSR_CMT_L3_OCCUPANCY           0x1
 
+/* CDP Capability */
+#define PSR_CAT_CDP_CAPABILITY       (1u << 2)
+
+/* L3 CDP Enable bit*/
+#define PSR_L3_QOS_CDP_ENABLE_BIT       0x0
+
 struct psr_cmt_l3 {
     unsigned int features;
     unsigned int upscaling_factor;
@@ -52,7 +58,7 @@ void psr_free_rmid(struct domain *d);
 void psr_ctxt_switch_to(struct domain *d);
 
 int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
-                        uint32_t *cos_max);
+                        uint32_t *cos_max, uint32_t *flags);
 int psr_get_l3_cbm(struct domain *d, unsigned int socket, uint64_t *cbm);
 int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm);
 
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 0cacacc..96680eb 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -36,7 +36,7 @@
 #include "physdev.h"
 #include "tmem.h"
 
-#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000C
+#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000D
 
 /*
  * Read console content from Xen buffer ring.
@@ -705,6 +705,8 @@ struct xen_sysctl_psr_cat_op {
         struct {
             uint32_t cbm_len;   /* OUT: CBM length */
             uint32_t cos_max;   /* OUT: Maximum COS */
+#define XEN_SYSCTL_PSR_CAT_L3_CDP       (1u << 0)
+            uint32_t flags;     /* OUT: CAT flags */
         } l3_info;
     } u;
 };
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:42:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1Km-0001z9-QV; Mon, 19 Oct 2015 03:42: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 1Zo1Kl-0001yy-PW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:03 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	10/34-03763-B8664265; Mon, 19 Oct 2015 03:42:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445226120!49915764!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15235 invoked from network); 19 Oct 2015 03:42:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:42:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ki-0005kg-Ia
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ki-0004kg-Gl
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:00 +0000
Date: Mon, 19 Oct 2015 03:42:00 +0000
Message-Id: <E1Zo1Ki-0004kg-Gl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add domctl cmd to set/get CDP
	code/data CBM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 44f126d3d3b03ec983590313af1d725937d4667c
Author:     He Chen <he.chen@linux.intel.com>
AuthorDate: Wed Oct 14 12:45:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:45:34 2015 +0200

    x86: add domctl cmd to set/get CDP code/data CBM
    
    CDP extends CAT and provides the capacity to control L3 code & data
    cache. With CDP, one COS corresponds to two CMBs(code & data). cbm_type
    is added to distinguish different CBM operations. Besides, new domctl
    cmds are introdunced to support set/get CDP CBM. Some CAT functions to
    operation CBMs are extended to support CDP.
    
    Signed-off-by: He Chen <he.chen@linux.intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 xen/arch/x86/domctl.c       |   32 +++++++-
 xen/arch/x86/psr.c          |  181 +++++++++++++++++++++++++++++++++----------
 xen/include/asm-x86/psr.h   |   12 +++-
 xen/include/public/domctl.h |    4 +
 4 files changed, 183 insertions(+), 46 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index f8a559c..0f6fdb9 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1168,12 +1168,40 @@ long arch_do_domctl(
         {
         case XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM:
             ret = psr_set_l3_cbm(d, domctl->u.psr_cat_op.target,
-                                 domctl->u.psr_cat_op.data);
+                                 domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3);
+            break;
+
+        case XEN_DOMCTL_PSR_CAT_OP_SET_L3_CODE:
+            ret = psr_set_l3_cbm(d, domctl->u.psr_cat_op.target,
+                                 domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3_CODE);
+            break;
+
+        case XEN_DOMCTL_PSR_CAT_OP_SET_L3_DATA:
+            ret = psr_set_l3_cbm(d, domctl->u.psr_cat_op.target,
+                                 domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3_DATA);
             break;
 
         case XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM:
             ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
-                                 &domctl->u.psr_cat_op.data);
+                                 &domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3);
+            copyback = 1;
+            break;
+
+        case XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE:
+            ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
+                                 &domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3_CODE);
+            copyback = 1;
+            break;
+
+        case XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA:
+            ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
+                                 &domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3_DATA);
             copyback = 1;
             break;
 
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 5ddeb2b..d3dec3a 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -293,14 +293,40 @@ int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
     return 0;
 }
 
-int psr_get_l3_cbm(struct domain *d, unsigned int socket, uint64_t *cbm)
+int psr_get_l3_cbm(struct domain *d, unsigned int socket,
+                   uint64_t *cbm, enum cbm_type type)
 {
     struct psr_cat_socket_info *info = get_cat_socket_info(socket);
+    bool_t cdp_enabled = cdp_is_enabled(socket);
 
     if ( IS_ERR(info) )
         return PTR_ERR(info);
 
-    *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].cbm;
+    switch ( type )
+    {
+    case PSR_CBM_TYPE_L3:
+        if ( cdp_enabled )
+            return -EXDEV;
+        *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].cbm;
+        break;
+
+    case PSR_CBM_TYPE_L3_CODE:
+        if ( !cdp_enabled )
+            *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].cbm;
+        else
+            *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].code;
+        break;
+
+    case PSR_CBM_TYPE_L3_DATA:
+        if ( !cdp_enabled )
+            *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].cbm;
+        else
+            *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].data;
+        break;
+
+    default:
+        ASSERT_UNREACHABLE();
+    }
 
     return 0;
 }
@@ -331,19 +357,34 @@ static bool_t psr_check_cbm(unsigned int cbm_len, uint64_t cbm)
 struct cos_cbm_info
 {
     unsigned int cos;
-    uint64_t cbm;
+    bool_t cdp;
+    uint64_t cbm_code;
+    uint64_t cbm_data;
 };
 
 static void do_write_l3_cbm(void *data)
 {
     struct cos_cbm_info *info = data;
 
-    wrmsrl(MSR_IA32_PSR_L3_MASK(info->cos), info->cbm);
+    if ( info->cdp )
+    {
+        wrmsrl(MSR_IA32_PSR_L3_MASK_CODE(info->cos), info->cbm_code);
+        wrmsrl(MSR_IA32_PSR_L3_MASK_DATA(info->cos), info->cbm_data);
+    }
+    else
+        wrmsrl(MSR_IA32_PSR_L3_MASK(info->cos), info->cbm_code);
 }
 
-static int write_l3_cbm(unsigned int socket, unsigned int cos, uint64_t cbm)
+static int write_l3_cbm(unsigned int socket, unsigned int cos,
+                        uint64_t cbm_code, uint64_t cbm_data, bool_t cdp)
 {
-    struct cos_cbm_info info = { .cos = cos, .cbm = cbm };
+    struct cos_cbm_info info =
+    {
+        .cos = cos,
+        .cbm_code = cbm_code,
+        .cbm_data = cbm_data,
+        .cdp = cdp,
+    };
 
     if ( socket == cpu_to_socket(smp_processor_id()) )
         do_write_l3_cbm(&info);
@@ -359,10 +400,48 @@ static int write_l3_cbm(unsigned int socket, unsigned int cos, uint64_t cbm)
     return 0;
 }
 
-int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm)
+static int find_cos(struct psr_cat_cbm *map, unsigned int cos_max,
+                    uint64_t cbm_code, uint64_t cbm_data, bool_t cdp_enabled)
+{
+    unsigned int cos;
+
+    for ( cos = 0; cos <= cos_max; cos++ )
+    {
+        if ( (map[cos].ref || cos == 0) &&
+             ((!cdp_enabled && map[cos].cbm == cbm_code) ||
+              (cdp_enabled && map[cos].code == cbm_code &&
+                              map[cos].data == cbm_data)) )
+            return cos;
+    }
+
+    return -ENOENT;
+}
+
+static int pick_avail_cos(struct psr_cat_cbm *map, unsigned int cos_max,
+                          unsigned int old_cos)
+{
+    unsigned int cos;
+
+    /* If old cos is referred only by the domain, then use it. */
+    if ( map[old_cos].ref == 1 && old_cos != 0 )
+        return old_cos;
+
+    /* Find an unused one other than cos0. */
+    for ( cos = 1; cos <= cos_max; cos++ )
+        if ( map[cos].ref == 0 )
+            return cos;
+
+    return -ENOENT;
+}
+
+int psr_set_l3_cbm(struct domain *d, unsigned int socket,
+                   uint64_t cbm, enum cbm_type type)
 {
-    unsigned int old_cos, cos;
-    struct psr_cat_cbm *map, *found = NULL;
+    unsigned int old_cos, cos_max;
+    int cos, ret;
+    uint64_t cbm_data, cbm_code;
+    bool_t cdp_enabled = cdp_is_enabled(socket);
+    struct psr_cat_cbm *map;
     struct psr_cat_socket_info *info = get_cat_socket_info(socket);
 
     if ( IS_ERR(info) )
@@ -371,53 +450,71 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm)
     if ( !psr_check_cbm(info->cbm_len, cbm) )
         return -EINVAL;
 
+    if ( !cdp_enabled && (type == PSR_CBM_TYPE_L3_CODE ||
+                          type == PSR_CBM_TYPE_L3_DATA) )
+        return -ENXIO;
+
+    cos_max = info->cos_max;
     old_cos = d->arch.psr_cos_ids[socket];
     map = info->cos_to_cbm;
 
-    spin_lock(&info->cbm_lock);
-
-    for ( cos = 0; cos <= info->cos_max; cos++ )
+    switch ( type )
     {
-        /* If still not found, then keep unused one. */
-        if ( !found && cos != 0 && map[cos].ref == 0 )
-            found = map + cos;
-        else if ( map[cos].cbm == cbm )
-        {
-            if ( unlikely(cos == old_cos) )
-            {
-                ASSERT(cos == 0 || map[cos].ref != 0);
-                spin_unlock(&info->cbm_lock);
-                return 0;
-            }
-            found = map + cos;
-            break;
-        }
-    }
+    case PSR_CBM_TYPE_L3:
+        cbm_code = cbm;
+        cbm_data = cbm;
+        break;
 
-    /* If old cos is referred only by the domain, then use it. */
-    if ( !found && map[old_cos].ref == 1 )
-        found = map + old_cos;
+    case PSR_CBM_TYPE_L3_CODE:
+        cbm_code = cbm;
+        cbm_data = map[old_cos].data;
+        break;
 
-    if ( !found )
-    {
-        spin_unlock(&info->cbm_lock);
-        return -EOVERFLOW;
+    case PSR_CBM_TYPE_L3_DATA:
+        cbm_code = map[old_cos].code;
+        cbm_data = cbm;
+        break;
+
+    default:
+        ASSERT_UNREACHABLE();
     }
 
-    cos = found - map;
-    if ( found->cbm != cbm )
+    spin_lock(&info->cbm_lock);
+    cos = find_cos(map, cos_max, cbm_code, cbm_data, cdp_enabled);
+    if ( cos >= 0 )
     {
-        int ret = write_l3_cbm(socket, cos, cbm);
-
-        if ( ret )
+        if ( cos == old_cos )
         {
             spin_unlock(&info->cbm_lock);
-            return ret;
+            return 0;
+        }
+    }
+    else
+    {
+        cos = pick_avail_cos(map, cos_max, old_cos);
+        if ( cos < 0 )
+        {
+            spin_unlock(&info->cbm_lock);
+            return cos;
+        }
+
+        /* We try to avoid writing MSR. */
+        if ( (cdp_enabled &&
+             (map[cos].code != cbm_code || map[cos].data != cbm_data)) ||
+             (!cdp_enabled && map[cos].cbm != cbm_code) )
+        {
+            ret = write_l3_cbm(socket, cos, cbm_code, cbm_data, cdp_enabled);
+            if ( ret )
+            {
+                spin_unlock(&info->cbm_lock);
+                return ret;
+            }
+            map[cos].code = cbm_code;
+            map[cos].data = cbm_data;
         }
-        found->cbm = cbm;
     }
 
-    found->ref++;
+    map[cos].ref++;
     map[old_cos].ref--;
     spin_unlock(&info->cbm_lock);
 
diff --git a/xen/include/asm-x86/psr.h b/xen/include/asm-x86/psr.h
index 5faeaaf..57f47e9 100644
--- a/xen/include/asm-x86/psr.h
+++ b/xen/include/asm-x86/psr.h
@@ -46,6 +46,12 @@ struct psr_cmt {
     struct psr_cmt_l3 l3;
 };
 
+enum cbm_type {
+    PSR_CBM_TYPE_L3,
+    PSR_CBM_TYPE_L3_CODE,
+    PSR_CBM_TYPE_L3_DATA,
+};
+
 extern struct psr_cmt *psr_cmt;
 
 static inline bool_t psr_cmt_enabled(void)
@@ -59,8 +65,10 @@ void psr_ctxt_switch_to(struct domain *d);
 
 int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
                         uint32_t *cos_max, uint32_t *flags);
-int psr_get_l3_cbm(struct domain *d, unsigned int socket, uint64_t *cbm);
-int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm);
+int psr_get_l3_cbm(struct domain *d, unsigned int socket,
+                   uint64_t *cbm, enum cbm_type type);
+int psr_set_l3_cbm(struct domain *d, unsigned int socket,
+                   uint64_t cbm, enum cbm_type type);
 
 int psr_domain_init(struct domain *d);
 void psr_domain_free(struct domain *d);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index ae241f2..86cd0ab 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1057,6 +1057,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_monitor_op_t);
 struct xen_domctl_psr_cat_op {
 #define XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM     0
 #define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM     1
+#define XEN_DOMCTL_PSR_CAT_OP_SET_L3_CODE    2
+#define XEN_DOMCTL_PSR_CAT_OP_SET_L3_DATA    3
+#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE    4
+#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA    5
     uint32_t cmd;       /* IN: XEN_DOMCTL_PSR_CAT_OP_* */
     uint32_t target;    /* IN */
     uint64_t data;      /* IN/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 Mon Oct 19 03:42:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1Km-0001z9-QV; Mon, 19 Oct 2015 03:42: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 1Zo1Kl-0001yy-PW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:03 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	10/34-03763-B8664265; Mon, 19 Oct 2015 03:42:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445226120!49915764!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15235 invoked from network); 19 Oct 2015 03:42:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:42:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ki-0005kg-Ia
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ki-0004kg-Gl
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:00 +0000
Date: Mon, 19 Oct 2015 03:42:00 +0000
Message-Id: <E1Zo1Ki-0004kg-Gl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add domctl cmd to set/get CDP
	code/data CBM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 44f126d3d3b03ec983590313af1d725937d4667c
Author:     He Chen <he.chen@linux.intel.com>
AuthorDate: Wed Oct 14 12:45:34 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:45:34 2015 +0200

    x86: add domctl cmd to set/get CDP code/data CBM
    
    CDP extends CAT and provides the capacity to control L3 code & data
    cache. With CDP, one COS corresponds to two CMBs(code & data). cbm_type
    is added to distinguish different CBM operations. Besides, new domctl
    cmds are introdunced to support set/get CDP CBM. Some CAT functions to
    operation CBMs are extended to support CDP.
    
    Signed-off-by: He Chen <he.chen@linux.intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 xen/arch/x86/domctl.c       |   32 +++++++-
 xen/arch/x86/psr.c          |  181 +++++++++++++++++++++++++++++++++----------
 xen/include/asm-x86/psr.h   |   12 +++-
 xen/include/public/domctl.h |    4 +
 4 files changed, 183 insertions(+), 46 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index f8a559c..0f6fdb9 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1168,12 +1168,40 @@ long arch_do_domctl(
         {
         case XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM:
             ret = psr_set_l3_cbm(d, domctl->u.psr_cat_op.target,
-                                 domctl->u.psr_cat_op.data);
+                                 domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3);
+            break;
+
+        case XEN_DOMCTL_PSR_CAT_OP_SET_L3_CODE:
+            ret = psr_set_l3_cbm(d, domctl->u.psr_cat_op.target,
+                                 domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3_CODE);
+            break;
+
+        case XEN_DOMCTL_PSR_CAT_OP_SET_L3_DATA:
+            ret = psr_set_l3_cbm(d, domctl->u.psr_cat_op.target,
+                                 domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3_DATA);
             break;
 
         case XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM:
             ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
-                                 &domctl->u.psr_cat_op.data);
+                                 &domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3);
+            copyback = 1;
+            break;
+
+        case XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE:
+            ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
+                                 &domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3_CODE);
+            copyback = 1;
+            break;
+
+        case XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA:
+            ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
+                                 &domctl->u.psr_cat_op.data,
+                                 PSR_CBM_TYPE_L3_DATA);
             copyback = 1;
             break;
 
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 5ddeb2b..d3dec3a 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -293,14 +293,40 @@ int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
     return 0;
 }
 
-int psr_get_l3_cbm(struct domain *d, unsigned int socket, uint64_t *cbm)
+int psr_get_l3_cbm(struct domain *d, unsigned int socket,
+                   uint64_t *cbm, enum cbm_type type)
 {
     struct psr_cat_socket_info *info = get_cat_socket_info(socket);
+    bool_t cdp_enabled = cdp_is_enabled(socket);
 
     if ( IS_ERR(info) )
         return PTR_ERR(info);
 
-    *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].cbm;
+    switch ( type )
+    {
+    case PSR_CBM_TYPE_L3:
+        if ( cdp_enabled )
+            return -EXDEV;
+        *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].cbm;
+        break;
+
+    case PSR_CBM_TYPE_L3_CODE:
+        if ( !cdp_enabled )
+            *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].cbm;
+        else
+            *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].code;
+        break;
+
+    case PSR_CBM_TYPE_L3_DATA:
+        if ( !cdp_enabled )
+            *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].cbm;
+        else
+            *cbm = info->cos_to_cbm[d->arch.psr_cos_ids[socket]].data;
+        break;
+
+    default:
+        ASSERT_UNREACHABLE();
+    }
 
     return 0;
 }
@@ -331,19 +357,34 @@ static bool_t psr_check_cbm(unsigned int cbm_len, uint64_t cbm)
 struct cos_cbm_info
 {
     unsigned int cos;
-    uint64_t cbm;
+    bool_t cdp;
+    uint64_t cbm_code;
+    uint64_t cbm_data;
 };
 
 static void do_write_l3_cbm(void *data)
 {
     struct cos_cbm_info *info = data;
 
-    wrmsrl(MSR_IA32_PSR_L3_MASK(info->cos), info->cbm);
+    if ( info->cdp )
+    {
+        wrmsrl(MSR_IA32_PSR_L3_MASK_CODE(info->cos), info->cbm_code);
+        wrmsrl(MSR_IA32_PSR_L3_MASK_DATA(info->cos), info->cbm_data);
+    }
+    else
+        wrmsrl(MSR_IA32_PSR_L3_MASK(info->cos), info->cbm_code);
 }
 
-static int write_l3_cbm(unsigned int socket, unsigned int cos, uint64_t cbm)
+static int write_l3_cbm(unsigned int socket, unsigned int cos,
+                        uint64_t cbm_code, uint64_t cbm_data, bool_t cdp)
 {
-    struct cos_cbm_info info = { .cos = cos, .cbm = cbm };
+    struct cos_cbm_info info =
+    {
+        .cos = cos,
+        .cbm_code = cbm_code,
+        .cbm_data = cbm_data,
+        .cdp = cdp,
+    };
 
     if ( socket == cpu_to_socket(smp_processor_id()) )
         do_write_l3_cbm(&info);
@@ -359,10 +400,48 @@ static int write_l3_cbm(unsigned int socket, unsigned int cos, uint64_t cbm)
     return 0;
 }
 
-int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm)
+static int find_cos(struct psr_cat_cbm *map, unsigned int cos_max,
+                    uint64_t cbm_code, uint64_t cbm_data, bool_t cdp_enabled)
+{
+    unsigned int cos;
+
+    for ( cos = 0; cos <= cos_max; cos++ )
+    {
+        if ( (map[cos].ref || cos == 0) &&
+             ((!cdp_enabled && map[cos].cbm == cbm_code) ||
+              (cdp_enabled && map[cos].code == cbm_code &&
+                              map[cos].data == cbm_data)) )
+            return cos;
+    }
+
+    return -ENOENT;
+}
+
+static int pick_avail_cos(struct psr_cat_cbm *map, unsigned int cos_max,
+                          unsigned int old_cos)
+{
+    unsigned int cos;
+
+    /* If old cos is referred only by the domain, then use it. */
+    if ( map[old_cos].ref == 1 && old_cos != 0 )
+        return old_cos;
+
+    /* Find an unused one other than cos0. */
+    for ( cos = 1; cos <= cos_max; cos++ )
+        if ( map[cos].ref == 0 )
+            return cos;
+
+    return -ENOENT;
+}
+
+int psr_set_l3_cbm(struct domain *d, unsigned int socket,
+                   uint64_t cbm, enum cbm_type type)
 {
-    unsigned int old_cos, cos;
-    struct psr_cat_cbm *map, *found = NULL;
+    unsigned int old_cos, cos_max;
+    int cos, ret;
+    uint64_t cbm_data, cbm_code;
+    bool_t cdp_enabled = cdp_is_enabled(socket);
+    struct psr_cat_cbm *map;
     struct psr_cat_socket_info *info = get_cat_socket_info(socket);
 
     if ( IS_ERR(info) )
@@ -371,53 +450,71 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm)
     if ( !psr_check_cbm(info->cbm_len, cbm) )
         return -EINVAL;
 
+    if ( !cdp_enabled && (type == PSR_CBM_TYPE_L3_CODE ||
+                          type == PSR_CBM_TYPE_L3_DATA) )
+        return -ENXIO;
+
+    cos_max = info->cos_max;
     old_cos = d->arch.psr_cos_ids[socket];
     map = info->cos_to_cbm;
 
-    spin_lock(&info->cbm_lock);
-
-    for ( cos = 0; cos <= info->cos_max; cos++ )
+    switch ( type )
     {
-        /* If still not found, then keep unused one. */
-        if ( !found && cos != 0 && map[cos].ref == 0 )
-            found = map + cos;
-        else if ( map[cos].cbm == cbm )
-        {
-            if ( unlikely(cos == old_cos) )
-            {
-                ASSERT(cos == 0 || map[cos].ref != 0);
-                spin_unlock(&info->cbm_lock);
-                return 0;
-            }
-            found = map + cos;
-            break;
-        }
-    }
+    case PSR_CBM_TYPE_L3:
+        cbm_code = cbm;
+        cbm_data = cbm;
+        break;
 
-    /* If old cos is referred only by the domain, then use it. */
-    if ( !found && map[old_cos].ref == 1 )
-        found = map + old_cos;
+    case PSR_CBM_TYPE_L3_CODE:
+        cbm_code = cbm;
+        cbm_data = map[old_cos].data;
+        break;
 
-    if ( !found )
-    {
-        spin_unlock(&info->cbm_lock);
-        return -EOVERFLOW;
+    case PSR_CBM_TYPE_L3_DATA:
+        cbm_code = map[old_cos].code;
+        cbm_data = cbm;
+        break;
+
+    default:
+        ASSERT_UNREACHABLE();
     }
 
-    cos = found - map;
-    if ( found->cbm != cbm )
+    spin_lock(&info->cbm_lock);
+    cos = find_cos(map, cos_max, cbm_code, cbm_data, cdp_enabled);
+    if ( cos >= 0 )
     {
-        int ret = write_l3_cbm(socket, cos, cbm);
-
-        if ( ret )
+        if ( cos == old_cos )
         {
             spin_unlock(&info->cbm_lock);
-            return ret;
+            return 0;
+        }
+    }
+    else
+    {
+        cos = pick_avail_cos(map, cos_max, old_cos);
+        if ( cos < 0 )
+        {
+            spin_unlock(&info->cbm_lock);
+            return cos;
+        }
+
+        /* We try to avoid writing MSR. */
+        if ( (cdp_enabled &&
+             (map[cos].code != cbm_code || map[cos].data != cbm_data)) ||
+             (!cdp_enabled && map[cos].cbm != cbm_code) )
+        {
+            ret = write_l3_cbm(socket, cos, cbm_code, cbm_data, cdp_enabled);
+            if ( ret )
+            {
+                spin_unlock(&info->cbm_lock);
+                return ret;
+            }
+            map[cos].code = cbm_code;
+            map[cos].data = cbm_data;
         }
-        found->cbm = cbm;
     }
 
-    found->ref++;
+    map[cos].ref++;
     map[old_cos].ref--;
     spin_unlock(&info->cbm_lock);
 
diff --git a/xen/include/asm-x86/psr.h b/xen/include/asm-x86/psr.h
index 5faeaaf..57f47e9 100644
--- a/xen/include/asm-x86/psr.h
+++ b/xen/include/asm-x86/psr.h
@@ -46,6 +46,12 @@ struct psr_cmt {
     struct psr_cmt_l3 l3;
 };
 
+enum cbm_type {
+    PSR_CBM_TYPE_L3,
+    PSR_CBM_TYPE_L3_CODE,
+    PSR_CBM_TYPE_L3_DATA,
+};
+
 extern struct psr_cmt *psr_cmt;
 
 static inline bool_t psr_cmt_enabled(void)
@@ -59,8 +65,10 @@ void psr_ctxt_switch_to(struct domain *d);
 
 int psr_get_cat_l3_info(unsigned int socket, uint32_t *cbm_len,
                         uint32_t *cos_max, uint32_t *flags);
-int psr_get_l3_cbm(struct domain *d, unsigned int socket, uint64_t *cbm);
-int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm);
+int psr_get_l3_cbm(struct domain *d, unsigned int socket,
+                   uint64_t *cbm, enum cbm_type type);
+int psr_set_l3_cbm(struct domain *d, unsigned int socket,
+                   uint64_t cbm, enum cbm_type type);
 
 int psr_domain_init(struct domain *d);
 void psr_domain_free(struct domain *d);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index ae241f2..86cd0ab 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1057,6 +1057,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_monitor_op_t);
 struct xen_domctl_psr_cat_op {
 #define XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM     0
 #define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM     1
+#define XEN_DOMCTL_PSR_CAT_OP_SET_L3_CODE    2
+#define XEN_DOMCTL_PSR_CAT_OP_SET_L3_DATA    3
+#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE    4
+#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA    5
     uint32_t cmd;       /* IN: XEN_DOMCTL_PSR_CAT_OP_* */
     uint32_t target;    /* IN */
     uint64_t data;      /* IN/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 Mon Oct 19 03:42:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1Kw-00020X-T8; Mon, 19 Oct 2015 03:42: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 1Zo1Kv-00020M-Uy
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:14 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	EF/BF-28221-59664265; Mon, 19 Oct 2015 03:42:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445226131!59309010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20033 invoked from network); 19 Oct 2015 03:42:12 -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;
	19 Oct 2015 03:42:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ks-0005lG-UW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ks-0004lU-Sj
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:10 +0000
Date: Mon, 19 Oct 2015 03:42:10 +0000
Message-Id: <E1Zo1Ks-0004lU-Sj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/NUMA: fix SRAT table processor
	entry parsing and consumption
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83281fc9b31396e94c0bfb6550b75c165037a0ad
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 12:46:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:46:27 2015 +0200

    x86/NUMA: fix SRAT table processor entry parsing and consumption
    
    - don't overrun apicid_to_node[] (possible in the x2APIC case)
    - don't limit number of processor related SRAT entries we can consume
    - make acpi_numa_{processor,x2apic}_affinity_init() as similar to one
      another as possible
    - print APIC IDs in hex (to ease matching with other log messages), at
      once making legacy and x2APIC ones distinguishable (by width)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/numa.c     |    2 +-
 xen/arch/x86/setup.c    |    2 +-
 xen/arch/x86/smpboot.c  |    3 ++-
 xen/arch/x86/srat.c     |   18 +++++++++++-------
 xen/drivers/acpi/numa.c |    4 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 0e82dd4..7e492d4 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -349,7 +349,7 @@ void __init init_cpu_to_node(void)
         u32 apicid = x86_cpu_to_apicid[i];
         if ( apicid == BAD_APICID )
             continue;
-        node = apicid_to_node[apicid];
+        node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
         if ( node == NUMA_NO_NODE || !node_online(node) )
             node = 0;
         numa_set_node(i, node);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3f4868e..972fbef 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -200,7 +200,7 @@ void __devinit srat_detect_node(int cpu)
     nodeid_t node;
     u32 apicid = x86_cpu_to_apicid[cpu];
 
-    node = apicid_to_node[apicid];
+    node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
     if ( node == NUMA_NO_NODE )
         node = 0;
 
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 0d55d7f..0946992 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -993,7 +993,8 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm)
             cpu = node;
             goto out;
         }
-        apicid_to_node[apic_id] = node;
+        if ( apic_id < MAX_LOCAL_APIC )
+             apicid_to_node[apic_id] = node;
     }
 
     /* Physically added CPUs do not have synchronised TSC. */
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 4242d10..909c6f7 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -209,7 +209,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 {
 	unsigned pxm;
 	nodeid_t node;
-	u32 apic_id;
 
 	if (srat_disabled())
 		return;
@@ -217,8 +216,13 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		bad_srat();
 		return;
 	}
-	if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
+	if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
+		return;
+	if (pa->apic_id >= MAX_LOCAL_APIC) {
+		printk(KERN_INFO "SRAT: APIC %08x ignored\n", pa->apic_id);
 		return;
+	}
+
 	pxm = pa->proximity_domain;
 	node = setup_node(pxm);
 	if (node == NUMA_NO_NODE) {
@@ -226,11 +230,11 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		return;
 	}
 
-	apic_id = pa->apic_id;
-	apicid_to_node[apic_id] = node;
+	apicid_to_node[pa->apic_id] = node;
+	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
-	       pxm, apic_id, node);
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n",
+	       pxm, pa->apic_id, node);
 }
 
 /* Callback for Proximity Domain -> LAPIC mapping */
@@ -262,7 +266,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	apicid_to_node[pa->apic_id] = node;
 	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n",
 	       pxm, pa->apic_id, node);
 }
 
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 434194e..c1fd753 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -198,9 +198,9 @@ int __init acpi_numa_init(void)
 	/* SRAT: Static Resource Affinity Table */
 	if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
-				      acpi_parse_x2apic_affinity, NR_CPUS);
+				      acpi_parse_x2apic_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
-				      acpi_parse_processor_affinity, NR_CPUS);
+				      acpi_parse_processor_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
 				      acpi_parse_memory_affinity,
 				      NR_NODE_MEMBLKS);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:42:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1Kw-00020X-T8; Mon, 19 Oct 2015 03:42: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 1Zo1Kv-00020M-Uy
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:14 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	EF/BF-28221-59664265; Mon, 19 Oct 2015 03:42:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445226131!59309010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20033 invoked from network); 19 Oct 2015 03:42:12 -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;
	19 Oct 2015 03:42:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ks-0005lG-UW
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ks-0004lU-Sj
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:10 +0000
Date: Mon, 19 Oct 2015 03:42:10 +0000
Message-Id: <E1Zo1Ks-0004lU-Sj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/NUMA: fix SRAT table processor
	entry parsing and consumption
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83281fc9b31396e94c0bfb6550b75c165037a0ad
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 12:46:27 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:46:27 2015 +0200

    x86/NUMA: fix SRAT table processor entry parsing and consumption
    
    - don't overrun apicid_to_node[] (possible in the x2APIC case)
    - don't limit number of processor related SRAT entries we can consume
    - make acpi_numa_{processor,x2apic}_affinity_init() as similar to one
      another as possible
    - print APIC IDs in hex (to ease matching with other log messages), at
      once making legacy and x2APIC ones distinguishable (by width)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/numa.c     |    2 +-
 xen/arch/x86/setup.c    |    2 +-
 xen/arch/x86/smpboot.c  |    3 ++-
 xen/arch/x86/srat.c     |   18 +++++++++++-------
 xen/drivers/acpi/numa.c |    4 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 0e82dd4..7e492d4 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -349,7 +349,7 @@ void __init init_cpu_to_node(void)
         u32 apicid = x86_cpu_to_apicid[i];
         if ( apicid == BAD_APICID )
             continue;
-        node = apicid_to_node[apicid];
+        node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
         if ( node == NUMA_NO_NODE || !node_online(node) )
             node = 0;
         numa_set_node(i, node);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3f4868e..972fbef 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -200,7 +200,7 @@ void __devinit srat_detect_node(int cpu)
     nodeid_t node;
     u32 apicid = x86_cpu_to_apicid[cpu];
 
-    node = apicid_to_node[apicid];
+    node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
     if ( node == NUMA_NO_NODE )
         node = 0;
 
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 0d55d7f..0946992 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -993,7 +993,8 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm)
             cpu = node;
             goto out;
         }
-        apicid_to_node[apic_id] = node;
+        if ( apic_id < MAX_LOCAL_APIC )
+             apicid_to_node[apic_id] = node;
     }
 
     /* Physically added CPUs do not have synchronised TSC. */
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 4242d10..909c6f7 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -209,7 +209,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 {
 	unsigned pxm;
 	nodeid_t node;
-	u32 apic_id;
 
 	if (srat_disabled())
 		return;
@@ -217,8 +216,13 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		bad_srat();
 		return;
 	}
-	if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
+	if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
+		return;
+	if (pa->apic_id >= MAX_LOCAL_APIC) {
+		printk(KERN_INFO "SRAT: APIC %08x ignored\n", pa->apic_id);
 		return;
+	}
+
 	pxm = pa->proximity_domain;
 	node = setup_node(pxm);
 	if (node == NUMA_NO_NODE) {
@@ -226,11 +230,11 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		return;
 	}
 
-	apic_id = pa->apic_id;
-	apicid_to_node[apic_id] = node;
+	apicid_to_node[pa->apic_id] = node;
+	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
-	       pxm, apic_id, node);
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n",
+	       pxm, pa->apic_id, node);
 }
 
 /* Callback for Proximity Domain -> LAPIC mapping */
@@ -262,7 +266,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	apicid_to_node[pa->apic_id] = node;
 	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n",
 	       pxm, pa->apic_id, node);
 }
 
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 434194e..c1fd753 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -198,9 +198,9 @@ int __init acpi_numa_init(void)
 	/* SRAT: Static Resource Affinity Table */
 	if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
-				      acpi_parse_x2apic_affinity, NR_CPUS);
+				      acpi_parse_x2apic_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
-				      acpi_parse_processor_affinity, NR_CPUS);
+				      acpi_parse_processor_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
 				      acpi_parse_memory_affinity,
 				      NR_NODE_MEMBLKS);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:42:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1L6-00022A-Ve; Mon, 19 Oct 2015 03:42:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1L5-00021x-TV
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:24 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	EC/BA-04752-F9664265; Mon, 19 Oct 2015 03:42:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445226141!59309031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21058 invoked from network); 19 Oct 2015 03:42:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:42:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1L3-0005lO-B2
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1L3-0004m2-5W
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:21 +0000
Date: Mon, 19 Oct 2015 03:42:21 +0000
Message-Id: <E1Zo1L3-0004m2-5W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/NUMA: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db34a096b3aabfea3093867a54c442e41509c8ed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 12:47:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:47:08 2015 +0200

    x86/NUMA: cleanup
    
    - constification
    - prefer container_of() over casts
    - check original pointer against NULL instead of the container_of()
      result
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/srat.c     |    6 +++---
 xen/drivers/acpi/numa.c |   19 ++++++++++---------
 xen/include/xen/acpi.h  |    6 +++---
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 909c6f7..d86783e 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -205,7 +205,7 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
 
 /* Callback for Proximity Domain -> x2APIC mapping */
 void __init
-acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
+acpi_numa_x2apic_affinity_init(const struct acpi_srat_x2apic_cpu_affinity *pa)
 {
 	unsigned pxm;
 	nodeid_t node;
@@ -239,7 +239,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 
 /* Callback for Proximity Domain -> LAPIC mapping */
 void __init
-acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
+acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *pa)
 {
 	unsigned pxm;
 	nodeid_t node;
@@ -272,7 +272,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 
 /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
 void __init
-acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
+acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma)
 {
 	u64 start, end;
 	unsigned pxm;
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index c1fd753..50bf9f8 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -124,10 +124,11 @@ static int __init
 acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
 			   const unsigned long end)
 {
-	struct acpi_srat_x2apic_cpu_affinity *processor_affinity;
+	const struct acpi_srat_x2apic_cpu_affinity *processor_affinity
+		= container_of(header, struct acpi_srat_x2apic_cpu_affinity,
+			       header);
 
-	processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
-	if (!processor_affinity)
+	if (!header)
 		return -EINVAL;
 
 	acpi_table_print_srat_entry(header);
@@ -139,13 +140,13 @@ acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
 }
 
 static int __init
-acpi_parse_processor_affinity(struct acpi_subtable_header * header,
+acpi_parse_processor_affinity(struct acpi_subtable_header *header,
 			      const unsigned long end)
 {
-	struct acpi_srat_cpu_affinity *processor_affinity
+	const struct acpi_srat_cpu_affinity *processor_affinity
 		= container_of(header, struct acpi_srat_cpu_affinity, header);
 
-	if (!processor_affinity)
+	if (!header)
 		return -EINVAL;
 
 	acpi_table_print_srat_entry(header);
@@ -157,13 +158,13 @@ acpi_parse_processor_affinity(struct acpi_subtable_header * header,
 }
 
 static int __init
-acpi_parse_memory_affinity(struct acpi_subtable_header * header,
+acpi_parse_memory_affinity(struct acpi_subtable_header *header,
 			   const unsigned long end)
 {
-	struct acpi_srat_mem_affinity *memory_affinity
+	const struct acpi_srat_mem_affinity *memory_affinity
 		= container_of(header, struct acpi_srat_mem_affinity, header);
 
-	if (!memory_affinity)
+	if (!header)
 		return -EINVAL;
 
 	acpi_table_print_srat_entry(header);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index f26658f..0f1077d 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -76,9 +76,9 @@ void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
 
 /* the following four functions are architecture-dependent */
 void acpi_numa_slit_init (struct acpi_table_slit *slit);
-void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
-void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
-void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
+void acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *);
+void acpi_numa_x2apic_affinity_init(const struct acpi_srat_x2apic_cpu_affinity *);
+void acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *);
 void acpi_numa_arch_fixup(void);
 
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:42:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1L6-00022A-Ve; Mon, 19 Oct 2015 03:42:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1L5-00021x-TV
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:24 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	EC/BA-04752-F9664265; Mon, 19 Oct 2015 03:42:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445226141!59309031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21058 invoked from network); 19 Oct 2015 03:42:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:42:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1L3-0005lO-B2
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1L3-0004m2-5W
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:21 +0000
Date: Mon, 19 Oct 2015 03:42:21 +0000
Message-Id: <E1Zo1L3-0004m2-5W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/NUMA: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db34a096b3aabfea3093867a54c442e41509c8ed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 12:47:08 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:47:08 2015 +0200

    x86/NUMA: cleanup
    
    - constification
    - prefer container_of() over casts
    - check original pointer against NULL instead of the container_of()
      result
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/srat.c     |    6 +++---
 xen/drivers/acpi/numa.c |   19 ++++++++++---------
 xen/include/xen/acpi.h  |    6 +++---
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 909c6f7..d86783e 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -205,7 +205,7 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
 
 /* Callback for Proximity Domain -> x2APIC mapping */
 void __init
-acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
+acpi_numa_x2apic_affinity_init(const struct acpi_srat_x2apic_cpu_affinity *pa)
 {
 	unsigned pxm;
 	nodeid_t node;
@@ -239,7 +239,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 
 /* Callback for Proximity Domain -> LAPIC mapping */
 void __init
-acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
+acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *pa)
 {
 	unsigned pxm;
 	nodeid_t node;
@@ -272,7 +272,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 
 /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
 void __init
-acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
+acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma)
 {
 	u64 start, end;
 	unsigned pxm;
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index c1fd753..50bf9f8 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -124,10 +124,11 @@ static int __init
 acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
 			   const unsigned long end)
 {
-	struct acpi_srat_x2apic_cpu_affinity *processor_affinity;
+	const struct acpi_srat_x2apic_cpu_affinity *processor_affinity
+		= container_of(header, struct acpi_srat_x2apic_cpu_affinity,
+			       header);
 
-	processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
-	if (!processor_affinity)
+	if (!header)
 		return -EINVAL;
 
 	acpi_table_print_srat_entry(header);
@@ -139,13 +140,13 @@ acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
 }
 
 static int __init
-acpi_parse_processor_affinity(struct acpi_subtable_header * header,
+acpi_parse_processor_affinity(struct acpi_subtable_header *header,
 			      const unsigned long end)
 {
-	struct acpi_srat_cpu_affinity *processor_affinity
+	const struct acpi_srat_cpu_affinity *processor_affinity
 		= container_of(header, struct acpi_srat_cpu_affinity, header);
 
-	if (!processor_affinity)
+	if (!header)
 		return -EINVAL;
 
 	acpi_table_print_srat_entry(header);
@@ -157,13 +158,13 @@ acpi_parse_processor_affinity(struct acpi_subtable_header * header,
 }
 
 static int __init
-acpi_parse_memory_affinity(struct acpi_subtable_header * header,
+acpi_parse_memory_affinity(struct acpi_subtable_header *header,
 			   const unsigned long end)
 {
-	struct acpi_srat_mem_affinity *memory_affinity
+	const struct acpi_srat_mem_affinity *memory_affinity
 		= container_of(header, struct acpi_srat_mem_affinity, header);
 
-	if (!memory_affinity)
+	if (!header)
 		return -EINVAL;
 
 	acpi_table_print_srat_entry(header);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index f26658f..0f1077d 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -76,9 +76,9 @@ void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
 
 /* the following four functions are architecture-dependent */
 void acpi_numa_slit_init (struct acpi_table_slit *slit);
-void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
-void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
-void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
+void acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *);
+void acpi_numa_x2apic_affinity_init(const struct acpi_srat_x2apic_cpu_affinity *);
+void acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *);
 void acpi_numa_arch_fixup(void);
 
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:42:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1LI-00023e-1w; Mon, 19 Oct 2015 03:42:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LG-00023T-HC
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:34 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	61/1C-32641-9A664265; Mon, 19 Oct 2015 03:42:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445226151!49915822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17080 invoked from network); 19 Oct 2015 03:42:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:42:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LD-0005lW-J5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LD-0004mo-HF
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:31 +0000
Date: Mon, 19 Oct 2015 03:42:31 +0000
Message-Id: <E1Zo1LD-0004mo-HF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: use mnemonics rather than
	magic numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 813ae80d82e77250dc12547cf78d50b887be62ca
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 14 12:48:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:48:00 2015 +0200

    x86/boot: use mnemonics rather than magic numbers
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/trampoline.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index ccb40fb..3452979 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -98,7 +98,8 @@ trampoline_protmode_entry:
 1:      wrmsr
 .Lskip_efer:
 
-        mov     $0x80050033,%eax /* hi-to-lo: PG,AM,WP,NE,ET,MP,PE */
+        mov     $(X86_CR0_PG | X86_CR0_AM | X86_CR0_WP | X86_CR0_NE |\
+                  X86_CR0_ET | X86_CR0_MP | X86_CR0_PE), %eax
         mov     %eax,%cr0
         jmp     1f
 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 Mon Oct 19 03:42:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1LI-00023e-1w; Mon, 19 Oct 2015 03:42:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LG-00023T-HC
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:34 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	61/1C-32641-9A664265; Mon, 19 Oct 2015 03:42:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445226151!49915822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17080 invoked from network); 19 Oct 2015 03:42:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:42:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LD-0005lW-J5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LD-0004mo-HF
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:31 +0000
Date: Mon, 19 Oct 2015 03:42:31 +0000
Message-Id: <E1Zo1LD-0004mo-HF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: use mnemonics rather than
	magic numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 813ae80d82e77250dc12547cf78d50b887be62ca
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 14 12:48:00 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:48:00 2015 +0200

    x86/boot: use mnemonics rather than magic numbers
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/trampoline.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index ccb40fb..3452979 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -98,7 +98,8 @@ trampoline_protmode_entry:
 1:      wrmsr
 .Lskip_efer:
 
-        mov     $0x80050033,%eax /* hi-to-lo: PG,AM,WP,NE,ET,MP,PE */
+        mov     $(X86_CR0_PG | X86_CR0_AM | X86_CR0_WP | X86_CR0_NE |\
+                  X86_CR0_ET | X86_CR0_MP | X86_CR0_PE), %eax
         mov     %eax,%cr0
         jmp     1f
 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 Mon Oct 19 03:42:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1LS-00025c-6c; Mon, 19 Oct 2015 03:42:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LR-00025Q-1y
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:45 +0000
Content-Length: 3415
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	83/71-19110-4B664265; Mon, 19 Oct 2015 03:42:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445226162!59309067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22098 invoked from network); 19 Oct 2015 03:42:43 -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;
	19 Oct 2015 03:42:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LO-0005le-Ip
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LO-0004ny-Bb
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:42 +0000
Date: Mon, 19 Oct 2015 03:42:42 +0000
Message-Id: <E1Zo1LO-0004ny-Bb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: create an initial FPU state for
	HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2832799319805831197=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2832799319805831197==
Content-Length: 3050
Content-Transfer-Encoding: quoted-printable

commit d64dbbcc7c9934a46126c59d78536235908377ad
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 13 18:27:20 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 14 11:04:10 2015 +0100

    libxc: create an initial FPU state for HVM guests
    
    Xen always set the FPU as initialized when loading a HVM context, so libxc
    has to provide a valid FPU context when setting the CPU registers.
    
    This is a stop-gap measure in order to unblock OSSTest Windows 7 failures
    while a proper fix for the HVM CPU save/restore is being worked on.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    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>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_x86.c |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index dd331bf..034abe0 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -841,6 +841,27 @@ static int vcpu_hvm(struct xc_dom_image *dom)
         struct hvm_save_descriptor end_d;
         HVM_SAVE_TYPE(END) end;
     } bsp_ctx;
+    /*
+     * The layout of the fpu context structure is the same for
+     * both 32 and 64 bits.
+     */
+    struct {
+        uint16_t fcw;
+        uint16_t fsw;
+        uint8_t ftw;
+        uint8_t rsvd1;
+        uint16_t fop;
+        union {
+            uint64_t addr;
+            struct {
+                uint32_t offs;
+                uint16_t sel;
+                uint16_t rsvd;
+            };
+        } fip, fdp;
+        uint32_t mxcsr;
+        uint32_t mxcsr_mask;
+    } *fpu_ctxt;
     uint8_t *full_ctx =3D NULL;
     int rc;
 
@@ -908,6 +929,23 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     /* Set the control registers. */
     bsp_ctx.cpu.cr0 =3D X86_CR0_PE | X86_CR0_ET;
 
+    /*
+     * XXX: Set initial FPU state.
+     *
+     * This should be removed once Xen is able to know if the
+     * FPU state saved is valid or not, now Xen always sets
+     * fpu_initialised to true regardless of the FPU state.
+     *
+     * The code below mimics the FPU sate after executing
+     * fninit
+     * ldmxcsr 0x1f80
+     */
+    fpu_ctxt =3D (typeof(fpu_ctxt))bsp_ctx.cpu.fpu_regs;
+
+    fpu_ctxt->fcw =3D 0x37f;
+    fpu_ctxt->ftw =3D 0xff;
+    fpu_ctxt->mxcsr =3D 0x1f80;
+
     /* Set the IP. */
     bsp_ctx.cpu.rip =3D dom->parms.phys_entry;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:42:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1LS-00025c-6c; Mon, 19 Oct 2015 03:42:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LR-00025Q-1y
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:45 +0000
Content-Length: 3415
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	83/71-19110-4B664265; Mon, 19 Oct 2015 03:42:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445226162!59309067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22098 invoked from network); 19 Oct 2015 03:42:43 -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;
	19 Oct 2015 03:42:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LO-0005le-Ip
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LO-0004ny-Bb
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:42 +0000
Date: Mon, 19 Oct 2015 03:42:42 +0000
Message-Id: <E1Zo1LO-0004ny-Bb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: create an initial FPU state for
	HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2832799319805831197=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2832799319805831197==
Content-Length: 3050
Content-Transfer-Encoding: quoted-printable

commit d64dbbcc7c9934a46126c59d78536235908377ad
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 13 18:27:20 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 14 11:04:10 2015 +0100

    libxc: create an initial FPU state for HVM guests
    
    Xen always set the FPU as initialized when loading a HVM context, so libxc
    has to provide a valid FPU context when setting the CPU registers.
    
    This is a stop-gap measure in order to unblock OSSTest Windows 7 failures
    while a proper fix for the HVM CPU save/restore is being worked on.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    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>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_x86.c |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index dd331bf..034abe0 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -841,6 +841,27 @@ static int vcpu_hvm(struct xc_dom_image *dom)
         struct hvm_save_descriptor end_d;
         HVM_SAVE_TYPE(END) end;
     } bsp_ctx;
+    /*
+     * The layout of the fpu context structure is the same for
+     * both 32 and 64 bits.
+     */
+    struct {
+        uint16_t fcw;
+        uint16_t fsw;
+        uint8_t ftw;
+        uint8_t rsvd1;
+        uint16_t fop;
+        union {
+            uint64_t addr;
+            struct {
+                uint32_t offs;
+                uint16_t sel;
+                uint16_t rsvd;
+            };
+        } fip, fdp;
+        uint32_t mxcsr;
+        uint32_t mxcsr_mask;
+    } *fpu_ctxt;
     uint8_t *full_ctx =3D NULL;
     int rc;
 
@@ -908,6 +929,23 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     /* Set the control registers. */
     bsp_ctx.cpu.cr0 =3D X86_CR0_PE | X86_CR0_ET;
 
+    /*
+     * XXX: Set initial FPU state.
+     *
+     * This should be removed once Xen is able to know if the
+     * FPU state saved is valid or not, now Xen always sets
+     * fpu_initialised to true regardless of the FPU state.
+     *
+     * The code below mimics the FPU sate after executing
+     * fninit
+     * ldmxcsr 0x1f80
+     */
+    fpu_ctxt =3D (typeof(fpu_ctxt))bsp_ctx.cpu.fpu_regs;
+
+    fpu_ctxt->fcw =3D 0x37f;
+    fpu_ctxt->ftw =3D 0xff;
+    fpu_ctxt->mxcsr =3D 0x1f80;
+
     /* Set the IP. */
     bsp_ctx.cpu.rip =3D dom->parms.phys_entry;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:42:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1Lc-000277-96; Mon, 19 Oct 2015 03:42:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lb-00026v-0q
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:55 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	0A/E9-24856-EB664265; Mon, 19 Oct 2015 03:42:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1445226173!43136100!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17608 invoked from network); 19 Oct 2015 03:42:53 -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;
	19 Oct 2015 03:42:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LY-0005lm-Uv
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LY-0004p6-Sr
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:52 +0000
Date: Mon, 19 Oct 2015 03:42:52 +0000
Message-Id: <E1Zo1LY-0004p6-Sr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: domain_build: Removed unused
	variable in write_properties
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66c8e456b7f152989c556123bd56d1d940abad8e
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 14 10:34:32 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 14 11:04:56 2015 +0100

    xen/arm: domain_build: Removed unused variable in write_properties
    
    The variable new_data is initialized to NULL and free but never
    allocated neither used.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index eb93a3a..0c3441a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -415,7 +415,6 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
     dt_for_each_property_node (node, prop)
     {
         const void *prop_data = prop->value;
-        void *new_data = NULL;
         u32 prop_len = prop->length;
 
         /*
@@ -471,8 +470,6 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
 
         res = fdt_property(kinfo->fdt, prop->name, prop_data, prop_len);
 
-        xfree(new_data);
-
         if ( res )
             return res;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:42:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:42: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 1Zo1Lc-000277-96; Mon, 19 Oct 2015 03:42:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lb-00026v-0q
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:55 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	0A/E9-24856-EB664265; Mon, 19 Oct 2015 03:42:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1445226173!43136100!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17608 invoked from network); 19 Oct 2015 03:42:53 -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;
	19 Oct 2015 03:42:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LY-0005lm-Uv
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1LY-0004p6-Sr
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:42:52 +0000
Date: Mon, 19 Oct 2015 03:42:52 +0000
Message-Id: <E1Zo1LY-0004p6-Sr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: domain_build: Removed unused
	variable in write_properties
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66c8e456b7f152989c556123bd56d1d940abad8e
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Oct 14 10:34:32 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 14 11:04:56 2015 +0100

    xen/arm: domain_build: Removed unused variable in write_properties
    
    The variable new_data is initialized to NULL and free but never
    allocated neither used.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index eb93a3a..0c3441a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -415,7 +415,6 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
     dt_for_each_property_node (node, prop)
     {
         const void *prop_data = prop->value;
-        void *new_data = NULL;
         u32 prop_len = prop->length;
 
         /*
@@ -471,8 +470,6 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
 
         res = fdt_property(kinfo->fdt, prop->name, prop_data, prop_len);
 
-        xfree(new_data);
-
         if ( res )
             return res;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1Lp-00028l-Bp; Mon, 19 Oct 2015 03:43: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 1Zo1Ln-00028Z-Gn
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:07 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	6E/C4-03763-AC664265; Mon, 19 Oct 2015 03:43:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445226185!19686026!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 18547 invoked from network); 19 Oct 2015 03:43:05 -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;
	19 Oct 2015 03:43:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lj-0005mN-BT
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lj-0004pp-8h
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:03 +0000
Date: Mon, 19 Oct 2015 03:43:03 +0000
Message-Id: <E1Zo1Lj-0004pp-8h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cxenstored: avoid using hardcoded paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a9203633ef8a7f215deee531d47aa203f195395
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 13 14:40:28 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 14 11:05:35 2015 +0100

    cxenstored: avoid using hardcoded paths
    
    Use library functions which return socket paths instead.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/xenstored_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 25a548d..3c0307e 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1769,8 +1769,8 @@ static int xs_get_sd_fd(const char *connect_to)
 
 static int xs_validate_active_socket(const char *connect_to)
 {
-	if ((strcmp("/var/run/xenstored/socket_ro", connect_to) != 0) &&
-	    (strcmp("/var/run/xenstored/socket", connect_to) != 0)) {
+	if ((strcmp(xs_daemon_socket_ro(), connect_to) != 0) &&
+	    (strcmp(xs_daemon_socket(), connect_to) != 0)) {
 		sd_notifyf(0, "STATUS=unexpected socket: %s\n"
 			   "ERRNO=%i",
 			   connect_to,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1Lp-00028l-Bp; Mon, 19 Oct 2015 03:43: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 1Zo1Ln-00028Z-Gn
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:07 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	6E/C4-03763-AC664265; Mon, 19 Oct 2015 03:43:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445226185!19686026!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 18547 invoked from network); 19 Oct 2015 03:43:05 -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;
	19 Oct 2015 03:43:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lj-0005mN-BT
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lj-0004pp-8h
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:03 +0000
Date: Mon, 19 Oct 2015 03:43:03 +0000
Message-Id: <E1Zo1Lj-0004pp-8h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cxenstored: avoid using hardcoded paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a9203633ef8a7f215deee531d47aa203f195395
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 13 14:40:28 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 14 11:05:35 2015 +0100

    cxenstored: avoid using hardcoded paths
    
    Use library functions which return socket paths instead.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/xenstored_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 25a548d..3c0307e 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1769,8 +1769,8 @@ static int xs_get_sd_fd(const char *connect_to)
 
 static int xs_validate_active_socket(const char *connect_to)
 {
-	if ((strcmp("/var/run/xenstored/socket_ro", connect_to) != 0) &&
-	    (strcmp("/var/run/xenstored/socket", connect_to) != 0)) {
+	if ((strcmp(xs_daemon_socket_ro(), connect_to) != 0) &&
+	    (strcmp(xs_daemon_socket(), connect_to) != 0)) {
 		sd_notifyf(0, "STATUS=unexpected socket: %s\n"
 			   "ERRNO=%i",
 			   connect_to,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1Lz-0002AE-EW; Mon, 19 Oct 2015 03:43: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 1Zo1Lx-00029y-K5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:17 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	40/3B-31069-4D664265; Mon, 19 Oct 2015 03:43:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445226195!21525038!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8917 invoked from network); 19 Oct 2015 03:43: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;
	19 Oct 2015 03:43:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lv-0005mV-9z
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lv-0004qW-8N
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:15 +0000
Date: Mon, 19 Oct 2015 03:43:15 +0000
Message-Id: <E1Zo1Lv-0004qW-8N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: ctxt_switch: Document the
	erratum #852523 related to Cortex A57
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b50c03d281fd1cfaf1f99654a2d6987a702b41a3
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 20:22:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 14 11:06:54 2015 +0100

    xen/arm: ctxt_switch: Document the erratum #852523 related to Cortex A57
    
    When restoring the system register state for an AArch32 guest at EL2,
    writes to DACR32_EL2 may not be correctly synchronised by Cortex-A57,
    which can lead to the guest effectively running into unexpected domain
    faults.
    
    Thankfully, we don't hit this erratum in Xen. Nonetheless, document the
    code to prevent any introduction of the erratum if the context switch
    code is re-ordered.
    
    Link: http://lists.xen.org/archives/html/xen-devel/2015-09/msg01746.html
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- comment nits ]
---
 xen/arch/arm/domain.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 575745c..4c08073 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -181,6 +181,12 @@ static void ctxt_switch_to(struct vcpu *n)
     WRITE_SYSREG(n->arch.ttbcr, TCR_EL1);
     WRITE_SYSREG64(n->arch.ttbr0, TTBR0_EL1);
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
+
+    /*
+     * Erratum #852523: DACR32_EL2 must be restored before one of the
+     * following sysregs: SCTLR_EL1, TCR_EL1, TTBR0_EL1, TTBR1_EL1 or
+     * CONTEXTIDR_EL1.
+     */
     if ( is_32bit_domain(n->domain) )
         WRITE_SYSREG(n->arch.dacr, DACR32_EL2);
     WRITE_SYSREG64(n->arch.par, PAR_EL1);
@@ -198,6 +204,10 @@ static void ctxt_switch_to(struct vcpu *n)
     /* Control Registers */
     WRITE_SYSREG(n->arch.cpacr, CPACR_EL1);
 
+    /*
+     * This write to sysreg CONTEXTIDR_EL1 ensures we don't hit erratum
+     * #852523. I.e DACR32_EL2 is not correctly synchronized.
+     */
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
     WRITE_SYSREG(n->arch.tpidr_el0, TPIDR_EL0);
     WRITE_SYSREG(n->arch.tpidrro_el0, TPIDRRO_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1Lz-0002AE-EW; Mon, 19 Oct 2015 03:43: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 1Zo1Lx-00029y-K5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:17 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	40/3B-31069-4D664265; Mon, 19 Oct 2015 03:43:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445226195!21525038!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8917 invoked from network); 19 Oct 2015 03:43: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;
	19 Oct 2015 03:43:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lv-0005mV-9z
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Lv-0004qW-8N
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:15 +0000
Date: Mon, 19 Oct 2015 03:43:15 +0000
Message-Id: <E1Zo1Lv-0004qW-8N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: ctxt_switch: Document the
	erratum #852523 related to Cortex A57
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b50c03d281fd1cfaf1f99654a2d6987a702b41a3
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 20:22:37 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 14 11:06:54 2015 +0100

    xen/arm: ctxt_switch: Document the erratum #852523 related to Cortex A57
    
    When restoring the system register state for an AArch32 guest at EL2,
    writes to DACR32_EL2 may not be correctly synchronised by Cortex-A57,
    which can lead to the guest effectively running into unexpected domain
    faults.
    
    Thankfully, we don't hit this erratum in Xen. Nonetheless, document the
    code to prevent any introduction of the erratum if the context switch
    code is re-ordered.
    
    Link: http://lists.xen.org/archives/html/xen-devel/2015-09/msg01746.html
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- comment nits ]
---
 xen/arch/arm/domain.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 575745c..4c08073 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -181,6 +181,12 @@ static void ctxt_switch_to(struct vcpu *n)
     WRITE_SYSREG(n->arch.ttbcr, TCR_EL1);
     WRITE_SYSREG64(n->arch.ttbr0, TTBR0_EL1);
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
+
+    /*
+     * Erratum #852523: DACR32_EL2 must be restored before one of the
+     * following sysregs: SCTLR_EL1, TCR_EL1, TTBR0_EL1, TTBR1_EL1 or
+     * CONTEXTIDR_EL1.
+     */
     if ( is_32bit_domain(n->domain) )
         WRITE_SYSREG(n->arch.dacr, DACR32_EL2);
     WRITE_SYSREG64(n->arch.par, PAR_EL1);
@@ -198,6 +204,10 @@ static void ctxt_switch_to(struct vcpu *n)
     /* Control Registers */
     WRITE_SYSREG(n->arch.cpacr, CPACR_EL1);
 
+    /*
+     * This write to sysreg CONTEXTIDR_EL1 ensures we don't hit erratum
+     * #852523. I.e DACR32_EL2 is not correctly synchronized.
+     */
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
     WRITE_SYSREG(n->arch.tpidr_el0, TPIDR_EL0);
     WRITE_SYSREG(n->arch.tpidrro_el0, TPIDRRO_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1MA-0002Bk-HF; Mon, 19 Oct 2015 03:43: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 1Zo1M9-0002BY-2l
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:29 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	CC/A1-01143-0E664265; Mon, 19 Oct 2015 03:43:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1445226205!59390791!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25642 invoked from network); 19 Oct 2015 03:43:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:43:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1M5-0005md-KT
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1M5-0004r8-GP
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:25 +0000
Date: Mon, 19 Oct 2015 03:43:25 +0000
Message-Id: <E1Zo1M5-0004r8-GP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	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 9d967cb979e92fd6bd46c967f1d204f33b24fb08
Merge: 813ae80d82e77250dc12547cf78d50b887be62ca b50c03d281fd1cfaf1f99654a2d6987a702b41a3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 12:48:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:48:22 2015 +0200

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

 tools/libxc/xc_dom_x86.c        |   38 ++++++++++++++++++++++++++++++++++++++
 tools/xenstore/xenstored_core.c |    4 ++--
 xen/arch/arm/domain.c           |   10 ++++++++++
 xen/arch/arm/domain_build.c     |    3 ---
 4 files changed, 50 insertions(+), 5 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1MA-0002Bk-HF; Mon, 19 Oct 2015 03:43: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 1Zo1M9-0002BY-2l
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:29 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	CC/A1-01143-0E664265; Mon, 19 Oct 2015 03:43:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1445226205!59390791!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25642 invoked from network); 19 Oct 2015 03:43:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:43:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1M5-0005md-KT
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1M5-0004r8-GP
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:25 +0000
Date: Mon, 19 Oct 2015 03:43:25 +0000
Message-Id: <E1Zo1M5-0004r8-GP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	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 9d967cb979e92fd6bd46c967f1d204f33b24fb08
Merge: 813ae80d82e77250dc12547cf78d50b887be62ca b50c03d281fd1cfaf1f99654a2d6987a702b41a3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 12:48:22 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:48:22 2015 +0200

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

 tools/libxc/xc_dom_x86.c        |   38 ++++++++++++++++++++++++++++++++++++++
 tools/xenstore/xenstored_core.c |    4 ++--
 xen/arch/arm/domain.c           |   10 ++++++++++
 xen/arch/arm/domain_build.c     |    3 ---
 4 files changed, 50 insertions(+), 5 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1MK-0002DB-Jn; Mon, 19 Oct 2015 03:43: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 1Zo1MJ-0002D0-08
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:39 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	F2/E5-28791-AE664265; Mon, 19 Oct 2015 03:43:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445226216!20497590!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 29733 invoked from network); 19 Oct 2015 03:43:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:43:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1MG-0005ml-0m
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1MF-0004rj-Tb
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:35 +0000
Date: Mon, 19 Oct 2015 03:43:35 +0000
Message-Id: <E1Zo1MF-0004rj-Tb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: don't use 16bit reads of
	segment 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 ee653b97ce369decfdd4d18979fd9f6aec0073c2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 14 12:48:36 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:48:36 2015 +0200

    x86/traps: don't use 16bit reads of segment registers
    
    When executing `mov %sreg, %r32`, older Intel processors would leave the
    upper 16 bits of %r32 undefined.  P4 processors and newer, as well as
    all AMD processors will zero extend the segment selector.
    
    As Xen only supports 64bit these days, there is no need to use the
    operand-size override prefix and suffer the resulting pipeline overhead.
    
    Rename read_segment_register() to read_sreg() and drop the existing
    read_sreg() wrapper which took a regs parameter and did nothing with it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c        |    8 ++++----
 xen/arch/x86/traps.c         |   26 ++++++++++++--------------
 xen/arch/x86/x86_64/traps.c  |   16 ++++++++--------
 xen/include/asm-x86/system.h |    6 +++---
 4 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 91c04f8..fe3be30 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1412,10 +1412,10 @@ static void save_segments(struct vcpu *v)
     struct cpu_user_regs *regs = &v->arch.user_regs;
     unsigned int dirty_segment_mask = 0;
 
-    regs->ds = read_segment_register(ds);
-    regs->es = read_segment_register(es);
-    regs->fs = read_segment_register(fs);
-    regs->gs = read_segment_register(gs);
+    regs->ds = read_sreg(ds);
+    regs->es = read_sreg(es);
+    regs->fs = read_sreg(fs);
+    regs->gs = read_sreg(gs);
 
     if ( cpu_has_fsgsbase && !is_pv_32bit_vcpu(v) )
     {
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f1fc7b7..8093535 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1981,8 +1981,6 @@ static inline uint64_t guest_misc_enable(uint64_t val)
     }                                                                       \
     (eip) += sizeof(_x); _x; })
 
-#define read_sreg(regs, sr) read_segment_register(sr)
-
 static int is_cpufreq_controller(struct domain *d)
 {
     return ((cpufreq_controller == FREQCTL_dom0_kernel) &&
@@ -2029,7 +2027,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         goto fail;
 
     /* emulating only opcodes not allowing SS to be default */
-    data_sel = read_sreg(regs, ds);
+    data_sel = read_sreg(ds);
 
     /* Legacy prefixes. */
     for ( i = 0; i < 8; i++, rex == opcode || (rex = 0) )
@@ -2047,17 +2045,17 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             data_sel = regs->cs;
             continue;
         case 0x3e: /* DS override */
-            data_sel = read_sreg(regs, ds);
+            data_sel = read_sreg(ds);
             continue;
         case 0x26: /* ES override */
-            data_sel = read_sreg(regs, es);
+            data_sel = read_sreg(es);
             continue;
         case 0x64: /* FS override */
-            data_sel = read_sreg(regs, fs);
+            data_sel = read_sreg(fs);
             lm_ovr = lm_seg_fs;
             continue;
         case 0x65: /* GS override */
-            data_sel = read_sreg(regs, gs);
+            data_sel = read_sreg(gs);
             lm_ovr = lm_seg_gs;
             continue;
         case 0x36: /* SS override */
@@ -2104,7 +2102,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
 
         if ( !(opcode & 2) )
         {
-            data_sel = read_sreg(regs, es);
+            data_sel = read_sreg(es);
             lm_ovr = lm_seg_none;
         }
 
@@ -2912,22 +2910,22 @@ static void emulate_gate_op(struct cpu_user_regs *regs)
             ASSERT(opnd_sel);
             continue;
         case 0x3e: /* DS override */
-            opnd_sel = read_sreg(regs, ds);
+            opnd_sel = read_sreg(ds);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x26: /* ES override */
-            opnd_sel = read_sreg(regs, es);
+            opnd_sel = read_sreg(es);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x64: /* FS override */
-            opnd_sel = read_sreg(regs, fs);
+            opnd_sel = read_sreg(fs);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x65: /* GS override */
-            opnd_sel = read_sreg(regs, gs);
+            opnd_sel = read_sreg(gs);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
@@ -2980,7 +2978,7 @@ static void emulate_gate_op(struct cpu_user_regs *regs)
                             switch ( modrm & 7 )
                             {
                             default:
-                                opnd_sel = read_sreg(regs, ds);
+                                opnd_sel = read_sreg(ds);
                                 break;
                             case 4: case 5:
                                 opnd_sel = regs->ss;
@@ -3008,7 +3006,7 @@ static void emulate_gate_op(struct cpu_user_regs *regs)
                             break;
                         }
                         if ( !opnd_sel )
-                            opnd_sel = read_sreg(regs, ds);
+                            opnd_sel = read_sreg(ds);
                         switch ( modrm & 7 )
                         {
                         case 0: case 2: case 4:
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 0846a19..b7c2759 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -125,10 +125,10 @@ void show_registers(const struct cpu_user_regs *regs)
         fault_crs[0] = read_cr0();
         fault_crs[3] = read_cr3();
         fault_crs[4] = read_cr4();
-        fault_regs.ds = read_segment_register(ds);
-        fault_regs.es = read_segment_register(es);
-        fault_regs.fs = read_segment_register(fs);
-        fault_regs.gs = read_segment_register(gs);
+        fault_regs.ds = read_sreg(ds);
+        fault_regs.es = read_sreg(es);
+        fault_regs.fs = read_sreg(fs);
+        fault_regs.gs = read_sreg(gs);
     }
 
     print_xen_info();
@@ -242,10 +242,10 @@ void do_double_fault(struct cpu_user_regs *regs)
     crs[2] = read_cr2();
     crs[3] = read_cr3();
     crs[4] = read_cr4();
-    regs->ds = read_segment_register(ds);
-    regs->es = read_segment_register(es);
-    regs->fs = read_segment_register(fs);
-    regs->gs = read_segment_register(gs);
+    regs->ds = read_sreg(ds);
+    regs->es = read_sreg(es);
+    regs->fs = read_sreg(fs);
+    regs->gs = read_sreg(gs);
 
     printk("CPU:    %d\n", cpu);
     _show_registers(regs, crs, CTXT_hypervisor, NULL);
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 9fb70f5..eb498f5 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -5,9 +5,9 @@
 #include <xen/bitops.h>
 #include <asm/processor.h>
 
-#define read_segment_register(name)                             \
-({  u16 __sel;                                                  \
-    asm volatile ( "movw %%" STR(name) ",%0" : "=r" (__sel) );  \
+#define read_sreg(name)                                         \
+({  unsigned int __sel;                                         \
+    asm volatile ( "mov %%" STR(name) ",%0" : "=r" (__sel) );   \
     __sel;                                                      \
 })
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:43:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1MK-0002DB-Jn; Mon, 19 Oct 2015 03:43: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 1Zo1MJ-0002D0-08
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:39 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	F2/E5-28791-AE664265; Mon, 19 Oct 2015 03:43:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445226216!20497590!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 29733 invoked from network); 19 Oct 2015 03:43:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:43:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1MG-0005ml-0m
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1MF-0004rj-Tb
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:35 +0000
Date: Mon, 19 Oct 2015 03:43:35 +0000
Message-Id: <E1Zo1MF-0004rj-Tb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: don't use 16bit reads of
	segment 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 ee653b97ce369decfdd4d18979fd9f6aec0073c2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 14 12:48:36 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 12:48:36 2015 +0200

    x86/traps: don't use 16bit reads of segment registers
    
    When executing `mov %sreg, %r32`, older Intel processors would leave the
    upper 16 bits of %r32 undefined.  P4 processors and newer, as well as
    all AMD processors will zero extend the segment selector.
    
    As Xen only supports 64bit these days, there is no need to use the
    operand-size override prefix and suffer the resulting pipeline overhead.
    
    Rename read_segment_register() to read_sreg() and drop the existing
    read_sreg() wrapper which took a regs parameter and did nothing with it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c        |    8 ++++----
 xen/arch/x86/traps.c         |   26 ++++++++++++--------------
 xen/arch/x86/x86_64/traps.c  |   16 ++++++++--------
 xen/include/asm-x86/system.h |    6 +++---
 4 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 91c04f8..fe3be30 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1412,10 +1412,10 @@ static void save_segments(struct vcpu *v)
     struct cpu_user_regs *regs = &v->arch.user_regs;
     unsigned int dirty_segment_mask = 0;
 
-    regs->ds = read_segment_register(ds);
-    regs->es = read_segment_register(es);
-    regs->fs = read_segment_register(fs);
-    regs->gs = read_segment_register(gs);
+    regs->ds = read_sreg(ds);
+    regs->es = read_sreg(es);
+    regs->fs = read_sreg(fs);
+    regs->gs = read_sreg(gs);
 
     if ( cpu_has_fsgsbase && !is_pv_32bit_vcpu(v) )
     {
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f1fc7b7..8093535 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1981,8 +1981,6 @@ static inline uint64_t guest_misc_enable(uint64_t val)
     }                                                                       \
     (eip) += sizeof(_x); _x; })
 
-#define read_sreg(regs, sr) read_segment_register(sr)
-
 static int is_cpufreq_controller(struct domain *d)
 {
     return ((cpufreq_controller == FREQCTL_dom0_kernel) &&
@@ -2029,7 +2027,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         goto fail;
 
     /* emulating only opcodes not allowing SS to be default */
-    data_sel = read_sreg(regs, ds);
+    data_sel = read_sreg(ds);
 
     /* Legacy prefixes. */
     for ( i = 0; i < 8; i++, rex == opcode || (rex = 0) )
@@ -2047,17 +2045,17 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             data_sel = regs->cs;
             continue;
         case 0x3e: /* DS override */
-            data_sel = read_sreg(regs, ds);
+            data_sel = read_sreg(ds);
             continue;
         case 0x26: /* ES override */
-            data_sel = read_sreg(regs, es);
+            data_sel = read_sreg(es);
             continue;
         case 0x64: /* FS override */
-            data_sel = read_sreg(regs, fs);
+            data_sel = read_sreg(fs);
             lm_ovr = lm_seg_fs;
             continue;
         case 0x65: /* GS override */
-            data_sel = read_sreg(regs, gs);
+            data_sel = read_sreg(gs);
             lm_ovr = lm_seg_gs;
             continue;
         case 0x36: /* SS override */
@@ -2104,7 +2102,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
 
         if ( !(opcode & 2) )
         {
-            data_sel = read_sreg(regs, es);
+            data_sel = read_sreg(es);
             lm_ovr = lm_seg_none;
         }
 
@@ -2912,22 +2910,22 @@ static void emulate_gate_op(struct cpu_user_regs *regs)
             ASSERT(opnd_sel);
             continue;
         case 0x3e: /* DS override */
-            opnd_sel = read_sreg(regs, ds);
+            opnd_sel = read_sreg(ds);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x26: /* ES override */
-            opnd_sel = read_sreg(regs, es);
+            opnd_sel = read_sreg(es);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x64: /* FS override */
-            opnd_sel = read_sreg(regs, fs);
+            opnd_sel = read_sreg(fs);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
         case 0x65: /* GS override */
-            opnd_sel = read_sreg(regs, gs);
+            opnd_sel = read_sreg(gs);
             if ( !opnd_sel )
                 opnd_sel = dpl;
             continue;
@@ -2980,7 +2978,7 @@ static void emulate_gate_op(struct cpu_user_regs *regs)
                             switch ( modrm & 7 )
                             {
                             default:
-                                opnd_sel = read_sreg(regs, ds);
+                                opnd_sel = read_sreg(ds);
                                 break;
                             case 4: case 5:
                                 opnd_sel = regs->ss;
@@ -3008,7 +3006,7 @@ static void emulate_gate_op(struct cpu_user_regs *regs)
                             break;
                         }
                         if ( !opnd_sel )
-                            opnd_sel = read_sreg(regs, ds);
+                            opnd_sel = read_sreg(ds);
                         switch ( modrm & 7 )
                         {
                         case 0: case 2: case 4:
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 0846a19..b7c2759 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -125,10 +125,10 @@ void show_registers(const struct cpu_user_regs *regs)
         fault_crs[0] = read_cr0();
         fault_crs[3] = read_cr3();
         fault_crs[4] = read_cr4();
-        fault_regs.ds = read_segment_register(ds);
-        fault_regs.es = read_segment_register(es);
-        fault_regs.fs = read_segment_register(fs);
-        fault_regs.gs = read_segment_register(gs);
+        fault_regs.ds = read_sreg(ds);
+        fault_regs.es = read_sreg(es);
+        fault_regs.fs = read_sreg(fs);
+        fault_regs.gs = read_sreg(gs);
     }
 
     print_xen_info();
@@ -242,10 +242,10 @@ void do_double_fault(struct cpu_user_regs *regs)
     crs[2] = read_cr2();
     crs[3] = read_cr3();
     crs[4] = read_cr4();
-    regs->ds = read_segment_register(ds);
-    regs->es = read_segment_register(es);
-    regs->fs = read_segment_register(fs);
-    regs->gs = read_segment_register(gs);
+    regs->ds = read_sreg(ds);
+    regs->es = read_sreg(es);
+    regs->fs = read_sreg(fs);
+    regs->gs = read_sreg(gs);
 
     printk("CPU:    %d\n", cpu);
     _show_registers(regs, crs, CTXT_hypervisor, NULL);
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 9fb70f5..eb498f5 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -5,9 +5,9 @@
 #include <xen/bitops.h>
 #include <asm/processor.h>
 
-#define read_segment_register(name)                             \
-({  u16 __sel;                                                  \
-    asm volatile ( "movw %%" STR(name) ",%0" : "=r" (__sel) );  \
+#define read_sreg(name)                                         \
+({  unsigned int __sel;                                         \
+    asm volatile ( "mov %%" STR(name) ",%0" : "=r" (__sel) );   \
     __sel;                                                      \
 })
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:43:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1MU-0002Eg-MR; Mon, 19 Oct 2015 03:43: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 1Zo1MS-0002EN-LS
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:48 +0000
Content-Length: 2603
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	E8/54-12371-4F664265; Mon, 19 Oct 2015 03:43:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1445226226!56721292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1124 invoked from network); 19 Oct 2015 03:43:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:43:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1MQ-0005mt-CQ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1MQ-0004t0-9u
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:46 +0000
Date: Mon, 19 Oct 2015 03:43:46 +0000
Message-Id: <E1Zo1MQ-0004t0-9u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Initialize vcpu context for
	64-bit PVH VCPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8852121013088229089=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8852121013088229089==
Content-Length: 2205
Content-Transfer-Encoding: quoted-printable

commit c7e21966e6fe1e8640a4d1cb452118c43e27356d
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Oct 15 10:44:26 2015 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 15 15:52:31 2015 +0100

    libxc: Initialize vcpu context for 64-bit PVH VCPUs
    
    Commit 5b921b49f08 ("libxc: rework BSP initialization") forgot to call
    xc_vcpu_setcontext() for 64-bit PVH VCPUs.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_x86.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 034abe0..4c4182f 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -810,18 +810,18 @@ static int vcpu_x86_64(struct xc_dom_image *dom)
     DOMPRINTF("%s: cr3: pfn 0x%" PRIpfn " mfn 0x%" PRIpfn "",
               __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn);
 
-    if ( dom->pvh_enabled )
-        return 0;
-
-    ctxt->user_regs.ds =3D FLAT_KERNEL_DS_X86_64;
-    ctxt->user_regs.es =3D FLAT_KERNEL_DS_X86_64;
-    ctxt->user_regs.fs =3D FLAT_KERNEL_DS_X86_64;
-    ctxt->user_regs.gs =3D FLAT_KERNEL_DS_X86_64;
-    ctxt->user_regs.ss =3D FLAT_KERNEL_SS_X86_64;
-    ctxt->user_regs.cs =3D FLAT_KERNEL_CS_X86_64;
+    if ( !dom->pvh_enabled )
+    {
+        ctxt->user_regs.ds =3D FLAT_KERNEL_DS_X86_64;
+        ctxt->user_regs.es =3D FLAT_KERNEL_DS_X86_64;
+        ctxt->user_regs.fs =3D FLAT_KERNEL_DS_X86_64;
+        ctxt->user_regs.gs =3D FLAT_KERNEL_DS_X86_64;
+        ctxt->user_regs.ss =3D FLAT_KERNEL_SS_X86_64;
+        ctxt->user_regs.cs =3D FLAT_KERNEL_CS_X86_64;
 
-    ctxt->kernel_ss =3D ctxt->user_regs.ss;
-    ctxt->kernel_sp =3D ctxt->user_regs.esp;
+        ctxt->kernel_ss =3D ctxt->user_regs.ss;
+        ctxt->kernel_sp =3D ctxt->user_regs.esp;
+    }
 
     rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
     if ( rc !=3D 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1MU-0002Eg-MR; Mon, 19 Oct 2015 03:43: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 1Zo1MS-0002EN-LS
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:48 +0000
Content-Length: 2603
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	E8/54-12371-4F664265; Mon, 19 Oct 2015 03:43:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1445226226!56721292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1124 invoked from network); 19 Oct 2015 03:43:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:43:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1MQ-0005mt-CQ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1MQ-0004t0-9u
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:46 +0000
Date: Mon, 19 Oct 2015 03:43:46 +0000
Message-Id: <E1Zo1MQ-0004t0-9u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Initialize vcpu context for
	64-bit PVH VCPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8852121013088229089=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8852121013088229089==
Content-Length: 2205
Content-Transfer-Encoding: quoted-printable

commit c7e21966e6fe1e8640a4d1cb452118c43e27356d
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Oct 15 10:44:26 2015 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 15 15:52:31 2015 +0100

    libxc: Initialize vcpu context for 64-bit PVH VCPUs
    
    Commit 5b921b49f08 ("libxc: rework BSP initialization") forgot to call
    xc_vcpu_setcontext() for 64-bit PVH VCPUs.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_x86.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 034abe0..4c4182f 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -810,18 +810,18 @@ static int vcpu_x86_64(struct xc_dom_image *dom)
     DOMPRINTF("%s: cr3: pfn 0x%" PRIpfn " mfn 0x%" PRIpfn "",
               __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn);
 
-    if ( dom->pvh_enabled )
-        return 0;
-
-    ctxt->user_regs.ds =3D FLAT_KERNEL_DS_X86_64;
-    ctxt->user_regs.es =3D FLAT_KERNEL_DS_X86_64;
-    ctxt->user_regs.fs =3D FLAT_KERNEL_DS_X86_64;
-    ctxt->user_regs.gs =3D FLAT_KERNEL_DS_X86_64;
-    ctxt->user_regs.ss =3D FLAT_KERNEL_SS_X86_64;
-    ctxt->user_regs.cs =3D FLAT_KERNEL_CS_X86_64;
+    if ( !dom->pvh_enabled )
+    {
+        ctxt->user_regs.ds =3D FLAT_KERNEL_DS_X86_64;
+        ctxt->user_regs.es =3D FLAT_KERNEL_DS_X86_64;
+        ctxt->user_regs.fs =3D FLAT_KERNEL_DS_X86_64;
+        ctxt->user_regs.gs =3D FLAT_KERNEL_DS_X86_64;
+        ctxt->user_regs.ss =3D FLAT_KERNEL_SS_X86_64;
+        ctxt->user_regs.cs =3D FLAT_KERNEL_CS_X86_64;
 
-    ctxt->kernel_ss =3D ctxt->user_regs.ss;
-    ctxt->kernel_sp =3D ctxt->user_regs.esp;
+        ctxt->kernel_ss =3D ctxt->user_regs.ss;
+        ctxt->kernel_sp =3D ctxt->user_regs.esp;
+    }
 
     rc =3D xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx);
     if ( rc !=3D 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1Md-0002GO-RI; Mon, 19 Oct 2015 03:43:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Md-0002GC-5F
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:59 +0000
Content-Length: 2083
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	C0/AC-00536-EF664265; Mon, 19 Oct 2015 03:43:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1445226236!54298571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22214 invoked from network); 19 Oct 2015 03:43:57 -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;
	19 Oct 2015 03:43:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ma-0005n1-Nt
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ma-0004tc-LN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:56 +0000
Date: Mon, 19 Oct 2015 03:43:56 +0000
Message-Id: <E1Zo1Ma-0004tc-LN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: fix the types used in
	xc_dom_image to build HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4816399850413295842=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4816399850413295842==
Content-Length: 1675
Content-Transfer-Encoding: quoted-printable

commit c787425fdf2a4b42ffbff257123dfcb25528efbb
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Oct 15 19:23:57 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 16 09:54:44 2015 +0100

    libxc: fix the types used in xc_dom_image to build HVM guests
    
    Fix the types used to store the memory parameters of an HVM guest,
    previously they defaulted to unsigned long on 32bit toolstack builds, which
    is wrong because a 32bit value cannot hold a 64bit memory address that
    crosses the 4GB boundary.
    
    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: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index e52b023..7cb6b0c 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -187,10 +187,10 @@ struct xc_dom_image {
 
     /* HVM specific fields. */
     xen_pfn_t target_pages;
-    xen_pfn_t mmio_start;
-    xen_pfn_t mmio_size;
-    xen_pfn_t lowmem_end;
-    xen_pfn_t highmem_end;
+    xen_paddr_t mmio_start;
+    xen_paddr_t mmio_size;
+    xen_paddr_t lowmem_end;
+    xen_paddr_t highmem_end;
 
     /* Extra ACPI tables passed to HVMLOADER */
     struct xc_hvm_firmware_module acpi_module;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:43:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:43: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 1Zo1Md-0002GO-RI; Mon, 19 Oct 2015 03:43:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Md-0002GC-5F
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:59 +0000
Content-Length: 2083
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	C0/AC-00536-EF664265; Mon, 19 Oct 2015 03:43:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1445226236!54298571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22214 invoked from network); 19 Oct 2015 03:43:57 -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;
	19 Oct 2015 03:43:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ma-0005n1-Nt
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ma-0004tc-LN
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:43:56 +0000
Date: Mon, 19 Oct 2015 03:43:56 +0000
Message-Id: <E1Zo1Ma-0004tc-LN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: fix the types used in
	xc_dom_image to build HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4816399850413295842=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4816399850413295842==
Content-Length: 1675
Content-Transfer-Encoding: quoted-printable

commit c787425fdf2a4b42ffbff257123dfcb25528efbb
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Oct 15 19:23:57 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 16 09:54:44 2015 +0100

    libxc: fix the types used in xc_dom_image to build HVM guests
    
    Fix the types used to store the memory parameters of an HVM guest,
    previously they defaulted to unsigned long on 32bit toolstack builds, which
    is wrong because a 32bit value cannot hold a 64bit memory address that
    crosses the 4GB boundary.
    
    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: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index e52b023..7cb6b0c 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -187,10 +187,10 @@ struct xc_dom_image {
 
     /* HVM specific fields. */
     xen_pfn_t target_pages;
-    xen_pfn_t mmio_start;
-    xen_pfn_t mmio_size;
-    xen_pfn_t lowmem_end;
-    xen_pfn_t highmem_end;
+    xen_paddr_t mmio_start;
+    xen_paddr_t mmio_size;
+    xen_paddr_t lowmem_end;
+    xen_paddr_t highmem_end;
 
     /* Extra ACPI tables passed to HVMLOADER */
     struct xc_hvm_firmware_module acpi_module;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:44:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1Mn-0002Hz-UT; Mon, 19 Oct 2015 03:44:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Mn-0002Hm-Ei
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:09 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	68/06-09570-80764265; Mon, 19 Oct 2015 03:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1445226247!17414112!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21899 invoked from network); 19 Oct 2015 03:44:08 -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;
	19 Oct 2015 03:44:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ml-0005ng-05
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Mk-0004uX-UZ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:06 +0000
Date: Mon, 19 Oct 2015 03:44:06 +0000
Message-Id: <E1Zo1Mk-0004uX-UZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PSR: fix compilation error after
	44f126d
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 73b3bf10b475f4f8f92aba9a9de9ac433e53ead5
Author:     He Chen <he.chen@linux.intel.com>
AuthorDate: Fri Oct 16 17:43:19 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:43:19 2015 +0200

    x86/PSR: fix compilation error after 44f126d
    
    In non-debug build ASSERT_UNREACHABLE is nop and some compilers will
    complain that cbm_code/cbm_data may be used uninitialized in function
    psr_set_l3_cbm. Add return after ASSERT_UNREACHABLE to fix it.
    
    Signed-off-by: He Chen <he.chen@linux.intel.com>
---
 xen/arch/x86/psr.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index d3dec3a..f57ee77 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -477,6 +477,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket,
 
     default:
         ASSERT_UNREACHABLE();
+        return -EINVAL;
     }
 
     spin_lock(&info->cbm_lock);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:44:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1Mn-0002Hz-UT; Mon, 19 Oct 2015 03:44:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Mn-0002Hm-Ei
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:09 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	68/06-09570-80764265; Mon, 19 Oct 2015 03:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1445226247!17414112!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21899 invoked from network); 19 Oct 2015 03:44:08 -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;
	19 Oct 2015 03:44:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Ml-0005ng-05
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Mk-0004uX-UZ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:06 +0000
Date: Mon, 19 Oct 2015 03:44:06 +0000
Message-Id: <E1Zo1Mk-0004uX-UZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PSR: fix compilation error after
	44f126d
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 73b3bf10b475f4f8f92aba9a9de9ac433e53ead5
Author:     He Chen <he.chen@linux.intel.com>
AuthorDate: Fri Oct 16 17:43:19 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:43:19 2015 +0200

    x86/PSR: fix compilation error after 44f126d
    
    In non-debug build ASSERT_UNREACHABLE is nop and some compilers will
    complain that cbm_code/cbm_data may be used uninitialized in function
    psr_set_l3_cbm. Add return after ASSERT_UNREACHABLE to fix it.
    
    Signed-off-by: He Chen <he.chen@linux.intel.com>
---
 xen/arch/x86/psr.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index d3dec3a..f57ee77 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -477,6 +477,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket,
 
     default:
         ASSERT_UNREACHABLE();
+        return -EINVAL;
     }
 
     spin_lock(&info->cbm_lock);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 19 03:44:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1N0-0002JS-12; Mon, 19 Oct 2015 03:44:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1My-0002JK-F5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:20 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	E4/3D-01753-31764265; Mon, 19 Oct 2015 03:44:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445226257!54305885!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21758 invoked from network); 19 Oct 2015 03:44:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:44:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Mv-0005no-BZ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Mv-0004v5-9O
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:17 +0000
Date: Mon, 19 Oct 2015 03:44:17 +0000
Message-Id: <E1Zo1Mv-0004v5-9O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove unused x87 remnants of
	32-bit days
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3638ec1c5cdf48811b18c4059ce339c6a8b278b2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 16 17:44:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:44:35 2015 +0200

    x86: remove unused x87 remnants of 32-bit days
    
    x86-64 requires FXSR, XMM, and XMM2, so there's no point in hiding
    respective code behind conditionals.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/emulate.c       |    3 +-
 xen/arch/x86/i387.c              |   41 ++++++-------------------------------
 xen/arch/x86/setup.c             |    5 +---
 xen/include/asm-x86/cpufeature.h |    3 --
 xen/include/asm-x86/i387.h       |   25 ++++++++--------------
 xen/include/asm-x86/page.h       |    9 ++-----
 6 files changed, 21 insertions(+), 65 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 39774b7..eeb5963 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1542,8 +1542,7 @@ static int hvmemul_get_fpu(
             return X86EMUL_UNHANDLEABLE;
         break;
     case X86EMUL_FPU_xmm:
-        if ( !cpu_has_xmm ||
-             (curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_EM) ||
+        if ( (curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_EM) ||
              !(curr->arch.hvm_vcpu.guest_cr[4] & X86_CR4_OSFXSR) )
             return X86EMUL_UNHANDLEABLE;
         break;
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 14f2a79..66b51cb 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -19,15 +19,12 @@
 
 static void fpu_init(void)
 {
-    unsigned long val;
-    
+    uint32_t val = MXCSR_DEFAULT;
+
     asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
+
+    /* load default value into MXCSR control/status register */
+    asm volatile ( "ldmxcsr %0" : : "m" (val) );
 }
 
 /*******************************/
@@ -122,14 +119,6 @@ static inline void fpu_fxrstor(struct vcpu *v)
     }
 }
 
-/* Restore x87 extended state */
-static inline void fpu_frstor(struct vcpu *v)
-{
-    const char *fpu_ctxt = v->arch.fpu_ctxt;
-
-    asm volatile ( "frstor %0" : : "m" (*fpu_ctxt) );
-}
-
 /*******************************/
 /*      FPU Save Functions     */
 /*******************************/
@@ -206,15 +195,6 @@ static inline void fpu_fxsave(struct vcpu *v)
         fpu_ctxt->x[FPU_WORD_SIZE_OFFSET] = word_size;
 }
 
-/* Save x87 FPU state */
-static inline void fpu_fsave(struct vcpu *v)
-{
-    char *fpu_ctxt = v->arch.fpu_ctxt;
-
-    /* FWAIT is required to make FNSAVE synchronous. */
-    asm volatile ( "fnsave %0 ; fwait" : "=m" (*fpu_ctxt) );
-}
-
 /*******************************/
 /*       VCPU FPU Functions    */
 /*******************************/
@@ -249,12 +229,7 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
     else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
+        fpu_fxrstor(v);
     else
         fpu_init();
 
@@ -278,10 +253,8 @@ static bool_t _vcpu_save_fpu(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xsave(v);
-    else if ( cpu_has_fxsr )
-        fpu_fxsave(v);
     else
-        fpu_fsave(v);
+        fpu_fxsave(v);
 
     v->fpu_dirtied = 0;
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 972fbef..9975cd2 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1295,10 +1295,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     identify_cpu(&boot_cpu_data);
 
-    if ( cpu_has_fxsr )
-        set_in_cr4(X86_CR4_OSFXSR);
-    if ( cpu_has_xmm )
-        set_in_cr4(X86_CR4_OSXMMEXCPT);
+    set_in_cr4(X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT);
 
     if ( disable_smep )
         setup_clear_cpu_cap(X86_FEATURE_SMEP);
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 3934934..9f0368e 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -184,9 +184,6 @@
 #define cpu_has_sep		boot_cpu_has(X86_FEATURE_SEP)
 #define cpu_has_mtrr		1
 #define cpu_has_mmx		1
-#define cpu_has_fxsr		1
-#define cpu_has_xmm		1
-#define cpu_has_xmm2		1
 #define cpu_has_xmm3		boot_cpu_has(X86_FEATURE_XMM3)
 #define cpu_has_ht		boot_cpu_has(X86_FEATURE_HT)
 #define cpu_has_syscall		1
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 150a09e..7cfa215 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -17,22 +17,15 @@
 /* Byte offset of the stored word size within the FXSAVE area/portion. */
 #define FPU_WORD_SIZE_OFFSET 511
 
-struct ix87_state {
-    struct ix87_env {
-        uint16_t fcw, _res0;
-        uint16_t fsw, _res1;
-        uint16_t ftw, _res2;
-        uint32_t fip;
-        uint16_t fcs;
-        uint16_t fop;
-        uint32_t fdp;
-        uint16_t fds, _res6;
-    } env;
-    struct __packed ix87_reg {
-        uint64_t mantissa;
-        uint16_t exponent:15;
-        uint16_t sign:1;
-    } r[8];
+struct ix87_env {
+    uint16_t fcw, _res0;
+    uint16_t fsw, _res1;
+    uint16_t ftw, _res2;
+    uint32_t fip;
+    uint16_t fcs;
+    uint16_t fop;
+    uint32_t fdp;
+    uint16_t fds, _res6;
 };
 
 void vcpu_restore_fpu_eager(struct vcpu *v);
diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h
index 87b3341..a095a93 100644
--- a/xen/include/asm-x86/page.h
+++ b/xen/include/asm-x86/page.h
@@ -206,13 +206,10 @@ typedef struct { u64 pfn; } pagetable_t;
 #define pagetable_null()        pagetable_from_pfn(0)
 
 void clear_page_sse2(void *);
-#define clear_page(_p)      (cpu_has_xmm2 ?                             \
-                             clear_page_sse2((void *)(_p)) :            \
-                             (void)memset((void *)(_p), 0, PAGE_SIZE))
 void copy_page_sse2(void *, const void *);
-#define copy_page(_t,_f)    (cpu_has_xmm2 ?                             \
-                             copy_page_sse2(_t, _f) :                   \
-                             (void)memcpy(_t, _f, PAGE_SIZE))
+
+#define clear_page(_p)      clear_page_sse2(_p)
+#define copy_page(_t, _f)   copy_page_sse2(_t, _f)
 
 /* Convert between Xen-heap virtual addresses and machine addresses. */
 #define __pa(x)             (virt_to_maddr(x))
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:44:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1N0-0002JS-12; Mon, 19 Oct 2015 03:44:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1My-0002JK-F5
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:20 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	E4/3D-01753-31764265; Mon, 19 Oct 2015 03:44:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445226257!54305885!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21758 invoked from network); 19 Oct 2015 03:44:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2015 03:44:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Mv-0005no-BZ
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1Mv-0004v5-9O
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:17 +0000
Date: Mon, 19 Oct 2015 03:44:17 +0000
Message-Id: <E1Zo1Mv-0004v5-9O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove unused x87 remnants of
	32-bit days
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3638ec1c5cdf48811b18c4059ce339c6a8b278b2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 16 17:44:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:44:35 2015 +0200

    x86: remove unused x87 remnants of 32-bit days
    
    x86-64 requires FXSR, XMM, and XMM2, so there's no point in hiding
    respective code behind conditionals.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/emulate.c       |    3 +-
 xen/arch/x86/i387.c              |   41 ++++++-------------------------------
 xen/arch/x86/setup.c             |    5 +---
 xen/include/asm-x86/cpufeature.h |    3 --
 xen/include/asm-x86/i387.h       |   25 ++++++++--------------
 xen/include/asm-x86/page.h       |    9 ++-----
 6 files changed, 21 insertions(+), 65 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 39774b7..eeb5963 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1542,8 +1542,7 @@ static int hvmemul_get_fpu(
             return X86EMUL_UNHANDLEABLE;
         break;
     case X86EMUL_FPU_xmm:
-        if ( !cpu_has_xmm ||
-             (curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_EM) ||
+        if ( (curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_EM) ||
              !(curr->arch.hvm_vcpu.guest_cr[4] & X86_CR4_OSFXSR) )
             return X86EMUL_UNHANDLEABLE;
         break;
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 14f2a79..66b51cb 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -19,15 +19,12 @@
 
 static void fpu_init(void)
 {
-    unsigned long val;
-    
+    uint32_t val = MXCSR_DEFAULT;
+
     asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
+
+    /* load default value into MXCSR control/status register */
+    asm volatile ( "ldmxcsr %0" : : "m" (val) );
 }
 
 /*******************************/
@@ -122,14 +119,6 @@ static inline void fpu_fxrstor(struct vcpu *v)
     }
 }
 
-/* Restore x87 extended state */
-static inline void fpu_frstor(struct vcpu *v)
-{
-    const char *fpu_ctxt = v->arch.fpu_ctxt;
-
-    asm volatile ( "frstor %0" : : "m" (*fpu_ctxt) );
-}
-
 /*******************************/
 /*      FPU Save Functions     */
 /*******************************/
@@ -206,15 +195,6 @@ static inline void fpu_fxsave(struct vcpu *v)
         fpu_ctxt->x[FPU_WORD_SIZE_OFFSET] = word_size;
 }
 
-/* Save x87 FPU state */
-static inline void fpu_fsave(struct vcpu *v)
-{
-    char *fpu_ctxt = v->arch.fpu_ctxt;
-
-    /* FWAIT is required to make FNSAVE synchronous. */
-    asm volatile ( "fnsave %0 ; fwait" : "=m" (*fpu_ctxt) );
-}
-
 /*******************************/
 /*       VCPU FPU Functions    */
 /*******************************/
@@ -249,12 +229,7 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
     else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
+        fpu_fxrstor(v);
     else
         fpu_init();
 
@@ -278,10 +253,8 @@ static bool_t _vcpu_save_fpu(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xsave(v);
-    else if ( cpu_has_fxsr )
-        fpu_fxsave(v);
     else
-        fpu_fsave(v);
+        fpu_fxsave(v);
 
     v->fpu_dirtied = 0;
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 972fbef..9975cd2 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1295,10 +1295,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     identify_cpu(&boot_cpu_data);
 
-    if ( cpu_has_fxsr )
-        set_in_cr4(X86_CR4_OSFXSR);
-    if ( cpu_has_xmm )
-        set_in_cr4(X86_CR4_OSXMMEXCPT);
+    set_in_cr4(X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT);
 
     if ( disable_smep )
         setup_clear_cpu_cap(X86_FEATURE_SMEP);
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 3934934..9f0368e 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -184,9 +184,6 @@
 #define cpu_has_sep		boot_cpu_has(X86_FEATURE_SEP)
 #define cpu_has_mtrr		1
 #define cpu_has_mmx		1
-#define cpu_has_fxsr		1
-#define cpu_has_xmm		1
-#define cpu_has_xmm2		1
 #define cpu_has_xmm3		boot_cpu_has(X86_FEATURE_XMM3)
 #define cpu_has_ht		boot_cpu_has(X86_FEATURE_HT)
 #define cpu_has_syscall		1
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 150a09e..7cfa215 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -17,22 +17,15 @@
 /* Byte offset of the stored word size within the FXSAVE area/portion. */
 #define FPU_WORD_SIZE_OFFSET 511
 
-struct ix87_state {
-    struct ix87_env {
-        uint16_t fcw, _res0;
-        uint16_t fsw, _res1;
-        uint16_t ftw, _res2;
-        uint32_t fip;
-        uint16_t fcs;
-        uint16_t fop;
-        uint32_t fdp;
-        uint16_t fds, _res6;
-    } env;
-    struct __packed ix87_reg {
-        uint64_t mantissa;
-        uint16_t exponent:15;
-        uint16_t sign:1;
-    } r[8];
+struct ix87_env {
+    uint16_t fcw, _res0;
+    uint16_t fsw, _res1;
+    uint16_t ftw, _res2;
+    uint32_t fip;
+    uint16_t fcs;
+    uint16_t fop;
+    uint32_t fdp;
+    uint16_t fds, _res6;
 };
 
 void vcpu_restore_fpu_eager(struct vcpu *v);
diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h
index 87b3341..a095a93 100644
--- a/xen/include/asm-x86/page.h
+++ b/xen/include/asm-x86/page.h
@@ -206,13 +206,10 @@ typedef struct { u64 pfn; } pagetable_t;
 #define pagetable_null()        pagetable_from_pfn(0)
 
 void clear_page_sse2(void *);
-#define clear_page(_p)      (cpu_has_xmm2 ?                             \
-                             clear_page_sse2((void *)(_p)) :            \
-                             (void)memset((void *)(_p), 0, PAGE_SIZE))
 void copy_page_sse2(void *, const void *);
-#define copy_page(_t,_f)    (cpu_has_xmm2 ?                             \
-                             copy_page_sse2(_t, _f) :                   \
-                             (void)memcpy(_t, _f, PAGE_SIZE))
+
+#define clear_page(_p)      clear_page_sse2(_p)
+#define copy_page(_t, _f)   copy_page_sse2(_t, _f)
 
 /* Convert between Xen-heap virtual addresses and machine addresses. */
 #define __pa(x)             (virt_to_maddr(x))
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:44:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44: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 1Zo1NA-0002Kq-3g; Mon, 19 Oct 2015 03:44:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1N8-0002Kc-Ht
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:30 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	F2/A1-01421-D1764265; Mon, 19 Oct 2015 03:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445226268!19686175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23679 invoked from network); 19 Oct 2015 03:44:29 -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;
	19 Oct 2015 03:44:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1N6-0005nw-1D
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1N5-0004vg-V0
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:27 +0000
Date: Mon, 19 Oct 2015 03:44:27 +0000
Message-Id: <E1Zo1N5-0004vg-V0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: drop further constant cpu_has_*
	predicates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 684ea31309cf83769836c007da00860b3410ddb7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 16 17:46:47 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:46:47 2015 +0200

    x86: drop further constant cpu_has_* predicates
    
    EFER and SYSCALL are required on x86-64, and I think there's no point
    in assuming there might be no TSC. A few other predicates are simply
    unused. Of the ones left but constant I'm not convinced we should drop
    them; for some of them we may actually better make them non-constant
    (see also next patch in this series).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/acpi/power.c        |    3 +--
 xen/arch/x86/apic.c              |   22 ++++++++--------------
 xen/arch/x86/boot/trampoline.S   |    8 ++------
 xen/arch/x86/setup.c             |    3 +--
 xen/arch/x86/smpboot.c           |    3 +--
 xen/include/asm-x86/cpufeature.h |    7 -------
 6 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index f41f0de..7eaae6e 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -194,8 +194,7 @@ static int enter_state(u32 state)
     /* Restore CR4 and EFER from cached values. */
     cr4 = read_cr4();
     write_cr4(cr4 & ~X86_CR4_MCE);
-    if ( cpu_has_efer )
-        write_efer(read_efer());
+    write_efer(read_efer());
 
     device_power_up();
 
diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 44b1ac9..75f4a2d 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1130,7 +1130,7 @@ static void __devinit setup_APIC_timer(void)
 
 static int __init calibrate_APIC_clock(void)
 {
-    unsigned long long t1 = 0, t2 = 0;
+    unsigned long long t1, t2;
     long tt1, tt2;
     long result;
     int i;
@@ -1157,8 +1157,7 @@ static int __init calibrate_APIC_clock(void)
     /*
      * We wrapped around just now. Let's start:
      */
-    if (cpu_has_tsc)
-        t1 = rdtsc();
+    t1 = rdtsc();
     tt1 = apic_read(APIC_TMCCT);
 
     /*
@@ -1168,8 +1167,7 @@ static int __init calibrate_APIC_clock(void)
         wait_8254_wraparound();
 
     tt2 = apic_read(APIC_TMCCT);
-    if (cpu_has_tsc)
-        t2 = rdtsc();
+    t2 = rdtsc();
 
     /*
      * The APIC bus clock counter is 32 bits only, it
@@ -1181,16 +1179,12 @@ static int __init calibrate_APIC_clock(void)
 
     result = (tt1-tt2)*APIC_DIVISOR/LOOPS;
 
-    if (cpu_has_tsc)
-        apic_printk(APIC_VERBOSE, "..... CPU clock speed is "
-                    "%ld.%04ld MHz.\n",
-                    ((long)(t2-t1)/LOOPS)/(1000000/HZ),
-                    ((long)(t2-t1)/LOOPS)%(1000000/HZ));
+    apic_printk(APIC_VERBOSE, "..... CPU clock speed is %ld.%04ld MHz.\n",
+                ((long)(t2 - t1) / LOOPS) / (1000000 / HZ),
+                ((long)(t2 - t1) / LOOPS) % (1000000 / HZ));
 
-    apic_printk(APIC_VERBOSE, "..... host bus clock speed is "
-                "%ld.%04ld MHz.\n",
-                result/(1000000/HZ),
-                result%(1000000/HZ));
+    apic_printk(APIC_VERBOSE, "..... host bus clock speed is %ld.%04ld MHz.\n",
+                result / (1000000 / HZ), result % (1000000 / HZ));
 
     /* set up multipliers for accurate timer code */
     bus_freq   = result*HZ;
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 3452979..8b0d9c1 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -86,17 +86,13 @@ trampoline_protmode_entry:
 
         /* Set up EFER (Extended Feature Enable Register). */
         mov     bootsym_rel(cpuid_ext_features,4,%edi)
-        test    $0x20100800,%edi /* SYSCALL/SYSRET, No Execute, Long Mode? */
-        jz      .Lskip_efer
         movl    $MSR_EFER,%ecx
         rdmsr
-        btsl    $_EFER_LME,%eax /* Long Mode      */
-        btsl    $_EFER_SCE,%eax /* SYSCALL/SYSRET */
-        btl     $20,%edi        /* No Execute?    */
+        or      $EFER_LME|EFER_SCE,%eax   /* Long Mode + SYSCALL/SYSRET */
+        bt      $X86_FEATURE_NX % 32,%edi /* No Execute? */
         jnc     1f
         btsl    $_EFER_NX,%eax  /* No Execute     */
 1:      wrmsr
-.Lskip_efer:
 
         mov     $(X86_CR0_PG | X86_CR0_AM | X86_CR0_WP | X86_CR0_NE |\
                   X86_CR0_ET | X86_CR0_MP | X86_CR0_PE), %eax
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 9975cd2..4ed0110 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -625,8 +625,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     parse_video_info();
 
-    if ( cpu_has_efer )
-        rdmsrl(MSR_EFER, this_cpu(efer));
+    rdmsrl(MSR_EFER, this_cpu(efer));
     asm volatile ( "mov %%cr4,%0" : "=r" (this_cpu(cr4)) );
 
     /* We initialise the serial devices very early so we can get debugging. */
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 0946992..dabc929 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -332,8 +332,7 @@ void start_secondary(void *unused)
     set_processor_id(cpu);
     set_current(idle_vcpu[cpu]);
     this_cpu(curr_vcpu) = idle_vcpu[cpu];
-    if ( cpu_has_efer )
-        rdmsrl(MSR_EFER, this_cpu(efer));
+    rdmsrl(MSR_EFER, this_cpu(efer));
 
     /*
      * Just as during early bootstrap, it is convenient here to disable
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 9f0368e..e94b04d 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -174,10 +174,8 @@
 #define CPUID_PM_LEAF                    6
 #define CPUID6_ECX_APERFMPERF_CAPABILITY 0x1
 
-#define cpu_has_vme		0
 #define cpu_has_de		1
 #define cpu_has_pse		1
-#define cpu_has_tsc		1
 #define cpu_has_pge		1
 #define cpu_has_pat		1
 #define cpu_has_apic		boot_cpu_has(X86_FEATURE_APIC)
@@ -186,15 +184,10 @@
 #define cpu_has_mmx		1
 #define cpu_has_xmm3		boot_cpu_has(X86_FEATURE_XMM3)
 #define cpu_has_ht		boot_cpu_has(X86_FEATURE_HT)
-#define cpu_has_syscall		1
 #define cpu_has_mp		1
 #define cpu_has_nx		boot_cpu_has(X86_FEATURE_NX)
-#define cpu_has_k6_mtrr		0
-#define cpu_has_cyrix_arr	0
-#define cpu_has_centaur_mcr	0
 #define cpu_has_clflush		boot_cpu_has(X86_FEATURE_CLFLSH)
 #define cpu_has_page1gb		boot_cpu_has(X86_FEATURE_PAGE1GB)
-#define cpu_has_efer		1
 #define cpu_has_fsgsbase	boot_cpu_has(X86_FEATURE_FSGSBASE)
 #define cpu_has_aperfmperf	boot_cpu_has(X86_FEATURE_APERFMPERF)
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:44:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44: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 1Zo1NA-0002Kq-3g; Mon, 19 Oct 2015 03:44:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1N8-0002Kc-Ht
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:30 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	F2/A1-01421-D1764265; Mon, 19 Oct 2015 03:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445226268!19686175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23679 invoked from network); 19 Oct 2015 03:44:29 -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;
	19 Oct 2015 03:44:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1N6-0005nw-1D
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1N5-0004vg-V0
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:27 +0000
Date: Mon, 19 Oct 2015 03:44:27 +0000
Message-Id: <E1Zo1N5-0004vg-V0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: drop further constant cpu_has_*
	predicates
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 684ea31309cf83769836c007da00860b3410ddb7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 16 17:46:47 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:46:47 2015 +0200

    x86: drop further constant cpu_has_* predicates
    
    EFER and SYSCALL are required on x86-64, and I think there's no point
    in assuming there might be no TSC. A few other predicates are simply
    unused. Of the ones left but constant I'm not convinced we should drop
    them; for some of them we may actually better make them non-constant
    (see also next patch in this series).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/acpi/power.c        |    3 +--
 xen/arch/x86/apic.c              |   22 ++++++++--------------
 xen/arch/x86/boot/trampoline.S   |    8 ++------
 xen/arch/x86/setup.c             |    3 +--
 xen/arch/x86/smpboot.c           |    3 +--
 xen/include/asm-x86/cpufeature.h |    7 -------
 6 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index f41f0de..7eaae6e 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -194,8 +194,7 @@ static int enter_state(u32 state)
     /* Restore CR4 and EFER from cached values. */
     cr4 = read_cr4();
     write_cr4(cr4 & ~X86_CR4_MCE);
-    if ( cpu_has_efer )
-        write_efer(read_efer());
+    write_efer(read_efer());
 
     device_power_up();
 
diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 44b1ac9..75f4a2d 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1130,7 +1130,7 @@ static void __devinit setup_APIC_timer(void)
 
 static int __init calibrate_APIC_clock(void)
 {
-    unsigned long long t1 = 0, t2 = 0;
+    unsigned long long t1, t2;
     long tt1, tt2;
     long result;
     int i;
@@ -1157,8 +1157,7 @@ static int __init calibrate_APIC_clock(void)
     /*
      * We wrapped around just now. Let's start:
      */
-    if (cpu_has_tsc)
-        t1 = rdtsc();
+    t1 = rdtsc();
     tt1 = apic_read(APIC_TMCCT);
 
     /*
@@ -1168,8 +1167,7 @@ static int __init calibrate_APIC_clock(void)
         wait_8254_wraparound();
 
     tt2 = apic_read(APIC_TMCCT);
-    if (cpu_has_tsc)
-        t2 = rdtsc();
+    t2 = rdtsc();
 
     /*
      * The APIC bus clock counter is 32 bits only, it
@@ -1181,16 +1179,12 @@ static int __init calibrate_APIC_clock(void)
 
     result = (tt1-tt2)*APIC_DIVISOR/LOOPS;
 
-    if (cpu_has_tsc)
-        apic_printk(APIC_VERBOSE, "..... CPU clock speed is "
-                    "%ld.%04ld MHz.\n",
-                    ((long)(t2-t1)/LOOPS)/(1000000/HZ),
-                    ((long)(t2-t1)/LOOPS)%(1000000/HZ));
+    apic_printk(APIC_VERBOSE, "..... CPU clock speed is %ld.%04ld MHz.\n",
+                ((long)(t2 - t1) / LOOPS) / (1000000 / HZ),
+                ((long)(t2 - t1) / LOOPS) % (1000000 / HZ));
 
-    apic_printk(APIC_VERBOSE, "..... host bus clock speed is "
-                "%ld.%04ld MHz.\n",
-                result/(1000000/HZ),
-                result%(1000000/HZ));
+    apic_printk(APIC_VERBOSE, "..... host bus clock speed is %ld.%04ld MHz.\n",
+                result / (1000000 / HZ), result % (1000000 / HZ));
 
     /* set up multipliers for accurate timer code */
     bus_freq   = result*HZ;
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 3452979..8b0d9c1 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -86,17 +86,13 @@ trampoline_protmode_entry:
 
         /* Set up EFER (Extended Feature Enable Register). */
         mov     bootsym_rel(cpuid_ext_features,4,%edi)
-        test    $0x20100800,%edi /* SYSCALL/SYSRET, No Execute, Long Mode? */
-        jz      .Lskip_efer
         movl    $MSR_EFER,%ecx
         rdmsr
-        btsl    $_EFER_LME,%eax /* Long Mode      */
-        btsl    $_EFER_SCE,%eax /* SYSCALL/SYSRET */
-        btl     $20,%edi        /* No Execute?    */
+        or      $EFER_LME|EFER_SCE,%eax   /* Long Mode + SYSCALL/SYSRET */
+        bt      $X86_FEATURE_NX % 32,%edi /* No Execute? */
         jnc     1f
         btsl    $_EFER_NX,%eax  /* No Execute     */
 1:      wrmsr
-.Lskip_efer:
 
         mov     $(X86_CR0_PG | X86_CR0_AM | X86_CR0_WP | X86_CR0_NE |\
                   X86_CR0_ET | X86_CR0_MP | X86_CR0_PE), %eax
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 9975cd2..4ed0110 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -625,8 +625,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     parse_video_info();
 
-    if ( cpu_has_efer )
-        rdmsrl(MSR_EFER, this_cpu(efer));
+    rdmsrl(MSR_EFER, this_cpu(efer));
     asm volatile ( "mov %%cr4,%0" : "=r" (this_cpu(cr4)) );
 
     /* We initialise the serial devices very early so we can get debugging. */
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 0946992..dabc929 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -332,8 +332,7 @@ void start_secondary(void *unused)
     set_processor_id(cpu);
     set_current(idle_vcpu[cpu]);
     this_cpu(curr_vcpu) = idle_vcpu[cpu];
-    if ( cpu_has_efer )
-        rdmsrl(MSR_EFER, this_cpu(efer));
+    rdmsrl(MSR_EFER, this_cpu(efer));
 
     /*
      * Just as during early bootstrap, it is convenient here to disable
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 9f0368e..e94b04d 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -174,10 +174,8 @@
 #define CPUID_PM_LEAF                    6
 #define CPUID6_ECX_APERFMPERF_CAPABILITY 0x1
 
-#define cpu_has_vme		0
 #define cpu_has_de		1
 #define cpu_has_pse		1
-#define cpu_has_tsc		1
 #define cpu_has_pge		1
 #define cpu_has_pat		1
 #define cpu_has_apic		boot_cpu_has(X86_FEATURE_APIC)
@@ -186,15 +184,10 @@
 #define cpu_has_mmx		1
 #define cpu_has_xmm3		boot_cpu_has(X86_FEATURE_XMM3)
 #define cpu_has_ht		boot_cpu_has(X86_FEATURE_HT)
-#define cpu_has_syscall		1
 #define cpu_has_mp		1
 #define cpu_has_nx		boot_cpu_has(X86_FEATURE_NX)
-#define cpu_has_k6_mtrr		0
-#define cpu_has_cyrix_arr	0
-#define cpu_has_centaur_mcr	0
 #define cpu_has_clflush		boot_cpu_has(X86_FEATURE_CLFLSH)
 #define cpu_has_page1gb		boot_cpu_has(X86_FEATURE_PAGE1GB)
-#define cpu_has_efer		1
 #define cpu_has_fsgsbase	boot_cpu_has(X86_FEATURE_FSGSBASE)
 #define cpu_has_aperfmperf	boot_cpu_has(X86_FEATURE_APERFMPERF)
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:44:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44: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 1Zo1NK-0002MC-6R; Mon, 19 Oct 2015 03:44:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NJ-0002M2-2x
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:41 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	67/B1-01421-82764265; Mon, 19 Oct 2015 03:44:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445226278!19686195!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 24248 invoked from network); 19 Oct 2015 03:44:39 -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;
	19 Oct 2015 03:44:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NG-0005o4-8Y
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NG-0004wL-6c
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:38 +0000
Date: Mon, 19 Oct 2015 03:44:38 +0000
Message-Id: <E1Zo1NG-0004wL-6c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/capabilities: set/clear them using
	non-locked bitops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dcaf4e3f531fcc348dcb07c72393e2f6cabdc550
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 16 17:47:45 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:47:45 2015 +0200

    x86/capabilities: set/clear them using non-locked bitops
    
    Their initialization happens without races, so there's no point in
    using atomic (locked) operations to update the respective flags.
    (There's one case where the clear_bit() was completely pointless.)
    
    Also drop a neighboring stale comment from AMD code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/apic.c        |    5 ++---
 xen/arch/x86/cpu/amd.c     |   25 ++++++++++---------------
 xen/arch/x86/cpu/centaur.c |    2 +-
 xen/arch/x86/cpu/common.c  |    4 ++--
 xen/arch/x86/cpu/intel.c   |   19 ++++++++++---------
 5 files changed, 25 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 75f4a2d..7f6fea9 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -872,7 +872,7 @@ static int __init detect_init_APIC (void)
         return -1;
     }
 
-    set_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
+    __set_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
     mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
 
     /* The BIOS may have set up the APIC at some other address */
@@ -1369,7 +1369,7 @@ void pmu_apic_interrupt(struct cpu_user_regs *regs)
 int __init APIC_init_uniprocessor (void)
 {
     if (enable_local_apic < 0)
-        clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
+        __clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
 
     if (!smp_found_config && !cpu_has_apic) {
         skip_ioapic_setup = 1;
@@ -1382,7 +1382,6 @@ int __init APIC_init_uniprocessor (void)
     if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
         printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
                boot_cpu_physical_apicid);
-        clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
         skip_ioapic_setup = 1;
         return -1;
     }
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ad5fd09..fd57370 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -442,15 +442,9 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		wrmsrl(MSR_K7_HWCR, value);
 	}
 
-	/*
-	 *	FIXME: We should handle the K5 here. Set up the write
-	 *	range and also turn on MSR 83 bits 4 and 31 (write alloc,
-	 *	no bus pipeline)
-	 */
-
 	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
 	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
-	clear_bit(0*32+31, c->x86_capability);
+	__clear_bit(0*32+31, c->x86_capability);
 	
 	if (c->x86 == 0xf && c->x86_model < 0x14
 	    && cpu_has(c, X86_FEATURE_LAHF_LM)) {
@@ -459,7 +453,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		 * revision D (model = 0x14) and later actually support it.
 		 * (AMD Erratum #110, docId: 25759).
 		 */
-		clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
+		__clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
 		if (!rdmsr_amd_safe(0xc001100d, &l, &h))
 			wrmsr_amd_safe(0xc001100d, l, h & ~1);
 	}
@@ -482,10 +476,11 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 	if (c->extended_cpuid_level >= 0x80000007) {
 		c->x86_power = cpuid_edx(0x80000007);
 		if (c->x86_power & (1<<8)) {
-			set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
-			set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
+			__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
+			__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
 			if (c->x86 != 0x11)
-				set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
+				__set_bit(X86_FEATURE_TSC_RELIABLE,
+					  c->x86_capability);
 		}
 	}
 
@@ -498,7 +493,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		wrmsr_safe(MSR_K8_EXT_FEATURE_MASK, value);
 		rdmsrl(MSR_K8_EXT_FEATURE_MASK, value);
 		if (value & (1ULL << 54)) {
-			set_bit(X86_FEATURE_TOPOEXT, c->x86_capability);
+			__set_bit(X86_FEATURE_TOPOEXT, c->x86_capability);
 			printk(KERN_INFO "CPU: Re-enabling disabled "
 			       "Topology Extensions Support\n");
 		}
@@ -516,7 +511,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 
 	/* Pointless to use MWAIT on Family10 as it does not deep sleep. */
 	if (c->x86 >= 0x10 && !force_mwait)
-		clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
+		__clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
 
 	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
 		opt_allow_unsafe = 1;
@@ -566,7 +561,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
-	clear_bit(X86_FEATURE_SEP, c->x86_capability);
+	__clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
 	if (c->x86 == 0x10) {
 		/* do this for boot cpu */
@@ -592,7 +587,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 	 * running in deep C states.
 	 */
 	if ( opt_arat && c->x86 > 0x11 )
-		set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
 	/*
 	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
diff --git a/xen/arch/x86/cpu/centaur.c b/xen/arch/x86/cpu/centaur.c
index aaa0386..64730e5 100644
--- a/xen/arch/x86/cpu/centaur.c
+++ b/xen/arch/x86/cpu/centaur.c
@@ -47,7 +47,7 @@ static void __init init_c3(struct cpuinfo_x86 *c)
 
 	if (c->x86 == 0x6 && c->x86_model >= 0xf) {
 		c->x86_cache_alignment = c->x86_clflush_size * 2;
-		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
+		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 	}
 
 	get_model_name(c);
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 6da1471..f256444 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -312,7 +312,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
 
         /* Initialize xsave/xrstor features */
 	if ( !use_xsave )
-		clear_bit(X86_FEATURE_XSAVE, boot_cpu_data.x86_capability);
+		__clear_bit(X86_FEATURE_XSAVE, boot_cpu_data.x86_capability);
 
 	if ( cpu_has_xsave )
 		xstate_init(c);
@@ -392,7 +392,7 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
 	if ( ebx == 0 || (LEAFB_SUBTYPE(ecx) != SMT_TYPE) )
 		return;
 
-	set_bit(X86_FEATURE_XTOPOLOGY, c->x86_capability);
+	__set_bit(X86_FEATURE_XTOPOLOGY, c->x86_capability);
 
 	initial_apicid = edx;
 
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 53bfec8..c00657e 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -209,7 +209,7 @@ static void __devinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
 
 	if (c->x86 == 6 && cpu_has_clflush &&
 	    (c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47))
-		set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
+		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 }
 
 
@@ -244,7 +244,7 @@ static void __devinit init_intel(struct cpuinfo_x86 *c)
 		unsigned eax = cpuid_eax(10);
 		/* Check for version and the number of counters */
 		if ((eax & 0xff) && (((eax>>8) & 0xff) > 1))
-			set_bit(X86_FEATURE_ARCH_PERFMON, c->x86_capability);
+			__set_bit(X86_FEATURE_ARCH_PERFMON, c->x86_capability);
 	}
 
 	if ( !cpu_has(c, X86_FEATURE_XTOPOLOGY) )
@@ -255,10 +255,11 @@ static void __devinit init_intel(struct cpuinfo_x86 *c)
 
 	if (c == &boot_cpu_data && c->x86 == 6) {
 		if (probe_intel_cpuid_faulting())
-			set_bit(X86_FEATURE_CPUID_FAULTING, c->x86_capability);
+			__set_bit(X86_FEATURE_CPUID_FAULTING,
+				  c->x86_capability);
 	} else if (boot_cpu_has(X86_FEATURE_CPUID_FAULTING)) {
 		BUG_ON(!probe_intel_cpuid_faulting());
-		set_bit(X86_FEATURE_CPUID_FAULTING, c->x86_capability);
+		__set_bit(X86_FEATURE_CPUID_FAULTING, c->x86_capability);
 	}
 
 	if (!cpu_has_cpuid_faulting)
@@ -274,16 +275,16 @@ static void __devinit init_intel(struct cpuinfo_x86 *c)
 
 	if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
 		(c->x86 == 0x6 && c->x86_model >= 0x0e))
-		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
+		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 	if (cpuid_edx(0x80000007) & (1u<<8)) {
-		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
-		set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
-		set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
+		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
+		__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
+		__set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
 	}
 	if ( opt_arat &&
 	     ( c->cpuid_level >= 0x00000006 ) &&
 	     ( cpuid_eax(0x00000006) & (1u<<2) ) )
-		set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
 }
 
 static const struct cpu_dev intel_cpu_dev = {
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:44:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44: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 1Zo1NK-0002MC-6R; Mon, 19 Oct 2015 03:44:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NJ-0002M2-2x
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:41 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	67/B1-01421-82764265; Mon, 19 Oct 2015 03:44:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445226278!19686195!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 24248 invoked from network); 19 Oct 2015 03:44:39 -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;
	19 Oct 2015 03:44:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NG-0005o4-8Y
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NG-0004wL-6c
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:38 +0000
Date: Mon, 19 Oct 2015 03:44:38 +0000
Message-Id: <E1Zo1NG-0004wL-6c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/capabilities: set/clear them using
	non-locked bitops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dcaf4e3f531fcc348dcb07c72393e2f6cabdc550
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 16 17:47:45 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:47:45 2015 +0200

    x86/capabilities: set/clear them using non-locked bitops
    
    Their initialization happens without races, so there's no point in
    using atomic (locked) operations to update the respective flags.
    (There's one case where the clear_bit() was completely pointless.)
    
    Also drop a neighboring stale comment from AMD code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/apic.c        |    5 ++---
 xen/arch/x86/cpu/amd.c     |   25 ++++++++++---------------
 xen/arch/x86/cpu/centaur.c |    2 +-
 xen/arch/x86/cpu/common.c  |    4 ++--
 xen/arch/x86/cpu/intel.c   |   19 ++++++++++---------
 5 files changed, 25 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 75f4a2d..7f6fea9 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -872,7 +872,7 @@ static int __init detect_init_APIC (void)
         return -1;
     }
 
-    set_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
+    __set_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
     mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
 
     /* The BIOS may have set up the APIC at some other address */
@@ -1369,7 +1369,7 @@ void pmu_apic_interrupt(struct cpu_user_regs *regs)
 int __init APIC_init_uniprocessor (void)
 {
     if (enable_local_apic < 0)
-        clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
+        __clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
 
     if (!smp_found_config && !cpu_has_apic) {
         skip_ioapic_setup = 1;
@@ -1382,7 +1382,6 @@ int __init APIC_init_uniprocessor (void)
     if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
         printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
                boot_cpu_physical_apicid);
-        clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
         skip_ioapic_setup = 1;
         return -1;
     }
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ad5fd09..fd57370 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -442,15 +442,9 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		wrmsrl(MSR_K7_HWCR, value);
 	}
 
-	/*
-	 *	FIXME: We should handle the K5 here. Set up the write
-	 *	range and also turn on MSR 83 bits 4 and 31 (write alloc,
-	 *	no bus pipeline)
-	 */
-
 	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
 	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
-	clear_bit(0*32+31, c->x86_capability);
+	__clear_bit(0*32+31, c->x86_capability);
 	
 	if (c->x86 == 0xf && c->x86_model < 0x14
 	    && cpu_has(c, X86_FEATURE_LAHF_LM)) {
@@ -459,7 +453,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		 * revision D (model = 0x14) and later actually support it.
 		 * (AMD Erratum #110, docId: 25759).
 		 */
-		clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
+		__clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
 		if (!rdmsr_amd_safe(0xc001100d, &l, &h))
 			wrmsr_amd_safe(0xc001100d, l, h & ~1);
 	}
@@ -482,10 +476,11 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 	if (c->extended_cpuid_level >= 0x80000007) {
 		c->x86_power = cpuid_edx(0x80000007);
 		if (c->x86_power & (1<<8)) {
-			set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
-			set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
+			__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
+			__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
 			if (c->x86 != 0x11)
-				set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
+				__set_bit(X86_FEATURE_TSC_RELIABLE,
+					  c->x86_capability);
 		}
 	}
 
@@ -498,7 +493,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		wrmsr_safe(MSR_K8_EXT_FEATURE_MASK, value);
 		rdmsrl(MSR_K8_EXT_FEATURE_MASK, value);
 		if (value & (1ULL << 54)) {
-			set_bit(X86_FEATURE_TOPOEXT, c->x86_capability);
+			__set_bit(X86_FEATURE_TOPOEXT, c->x86_capability);
 			printk(KERN_INFO "CPU: Re-enabling disabled "
 			       "Topology Extensions Support\n");
 		}
@@ -516,7 +511,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 
 	/* Pointless to use MWAIT on Family10 as it does not deep sleep. */
 	if (c->x86 >= 0x10 && !force_mwait)
-		clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
+		__clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
 
 	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
 		opt_allow_unsafe = 1;
@@ -566,7 +561,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
-	clear_bit(X86_FEATURE_SEP, c->x86_capability);
+	__clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
 	if (c->x86 == 0x10) {
 		/* do this for boot cpu */
@@ -592,7 +587,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 	 * running in deep C states.
 	 */
 	if ( opt_arat && c->x86 > 0x11 )
-		set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
 	/*
 	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
diff --git a/xen/arch/x86/cpu/centaur.c b/xen/arch/x86/cpu/centaur.c
index aaa0386..64730e5 100644
--- a/xen/arch/x86/cpu/centaur.c
+++ b/xen/arch/x86/cpu/centaur.c
@@ -47,7 +47,7 @@ static void __init init_c3(struct cpuinfo_x86 *c)
 
 	if (c->x86 == 0x6 && c->x86_model >= 0xf) {
 		c->x86_cache_alignment = c->x86_clflush_size * 2;
-		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
+		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 	}
 
 	get_model_name(c);
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 6da1471..f256444 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -312,7 +312,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
 
         /* Initialize xsave/xrstor features */
 	if ( !use_xsave )
-		clear_bit(X86_FEATURE_XSAVE, boot_cpu_data.x86_capability);
+		__clear_bit(X86_FEATURE_XSAVE, boot_cpu_data.x86_capability);
 
 	if ( cpu_has_xsave )
 		xstate_init(c);
@@ -392,7 +392,7 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
 	if ( ebx == 0 || (LEAFB_SUBTYPE(ecx) != SMT_TYPE) )
 		return;
 
-	set_bit(X86_FEATURE_XTOPOLOGY, c->x86_capability);
+	__set_bit(X86_FEATURE_XTOPOLOGY, c->x86_capability);
 
 	initial_apicid = edx;
 
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 53bfec8..c00657e 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -209,7 +209,7 @@ static void __devinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
 
 	if (c->x86 == 6 && cpu_has_clflush &&
 	    (c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47))
-		set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
+		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 }
 
 
@@ -244,7 +244,7 @@ static void __devinit init_intel(struct cpuinfo_x86 *c)
 		unsigned eax = cpuid_eax(10);
 		/* Check for version and the number of counters */
 		if ((eax & 0xff) && (((eax>>8) & 0xff) > 1))
-			set_bit(X86_FEATURE_ARCH_PERFMON, c->x86_capability);
+			__set_bit(X86_FEATURE_ARCH_PERFMON, c->x86_capability);
 	}
 
 	if ( !cpu_has(c, X86_FEATURE_XTOPOLOGY) )
@@ -255,10 +255,11 @@ static void __devinit init_intel(struct cpuinfo_x86 *c)
 
 	if (c == &boot_cpu_data && c->x86 == 6) {
 		if (probe_intel_cpuid_faulting())
-			set_bit(X86_FEATURE_CPUID_FAULTING, c->x86_capability);
+			__set_bit(X86_FEATURE_CPUID_FAULTING,
+				  c->x86_capability);
 	} else if (boot_cpu_has(X86_FEATURE_CPUID_FAULTING)) {
 		BUG_ON(!probe_intel_cpuid_faulting());
-		set_bit(X86_FEATURE_CPUID_FAULTING, c->x86_capability);
+		__set_bit(X86_FEATURE_CPUID_FAULTING, c->x86_capability);
 	}
 
 	if (!cpu_has_cpuid_faulting)
@@ -274,16 +275,16 @@ static void __devinit init_intel(struct cpuinfo_x86 *c)
 
 	if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
 		(c->x86 == 0x6 && c->x86_model >= 0x0e))
-		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
+		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 	if (cpuid_edx(0x80000007) & (1u<<8)) {
-		set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
-		set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
-		set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
+		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
+		__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
+		__set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
 	}
 	if ( opt_arat &&
 	     ( c->cpuid_level >= 0x00000006 ) &&
 	     ( cpuid_eax(0x00000006) & (1u<<2) ) )
-		set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
 }
 
 static const struct cpu_dev intel_cpu_dev = {
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 19 03:44:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1NU-0002OE-Bb; Mon, 19 Oct 2015 03:44:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NS-0002Nt-N1
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:50 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	8B/2C-31069-23764265; Mon, 19 Oct 2015 03:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445226288!54173302!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9698 invoked from network); 19 Oct 2015 03:44:49 -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;
	19 Oct 2015 03:44:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NQ-0005oC-ID
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NQ-0004xW-G3
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:48 +0000
Date: Mon, 19 Oct 2015 03:44:48 +0000
Message-Id: <E1Zo1NQ-0004xW-G3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/Centaur: drop __init annotations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a95c3f9c26a4b877598d45886eae95963c5d793
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 16 17:49:51 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:49:51 2015 +0200

    x86/Centaur: drop __init annotations
    
    Commit 6f8f53cc64 ("x86 cpu: Fix bug: unify cpu_dev attr as
    __cpuinitdata") fixed centaur_cpu_dev's annotation without also fixing
    the pointers hanging off of it. Even if CPU hotplig support may be
    purely theoretical for Centaur, we should still not leave this as is.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/centaur.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/centaur.c b/xen/arch/x86/cpu/centaur.c
index 64730e5..66b1995 100644
--- a/xen/arch/x86/cpu/centaur.c
+++ b/xen/arch/x86/cpu/centaur.c
@@ -15,7 +15,7 @@
 #define RNG_ENABLED	(1 << 3)
 #define RNG_ENABLE	(1 << 6)	/* MSR_VIA_RNG */
 
-static void __init init_c3(struct cpuinfo_x86 *c)
+static void init_c3(struct cpuinfo_x86 *c)
 {
 	uint64_t msr_content;
 
@@ -54,7 +54,7 @@ static void __init init_c3(struct cpuinfo_x86 *c)
 	display_cacheinfo(c);
 }
 
-static void __init init_centaur(struct cpuinfo_x86 *c)
+static void init_centaur(struct cpuinfo_x86 *c)
 {
 	if (c->x86 == 6)
 		init_c3(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 Mon Oct 19 03:44:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Oct 2015 03:44:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zo1NU-0002OE-Bb; Mon, 19 Oct 2015 03:44:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NS-0002Nt-N1
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:50 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	8B/2C-31069-23764265; Mon, 19 Oct 2015 03:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445226288!54173302!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9698 invoked from network); 19 Oct 2015 03:44:49 -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;
	19 Oct 2015 03:44:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NQ-0005oC-ID
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zo1NQ-0004xW-G3
	for xen-changelog@lists.xensource.com; Mon, 19 Oct 2015 03:44:48 +0000
Date: Mon, 19 Oct 2015 03:44:48 +0000
Message-Id: <E1Zo1NQ-0004xW-G3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/Centaur: drop __init annotations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a95c3f9c26a4b877598d45886eae95963c5d793
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 16 17:49:51 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 16 17:49:51 2015 +0200

    x86/Centaur: drop __init annotations
    
    Commit 6f8f53cc64 ("x86 cpu: Fix bug: unify cpu_dev attr as
    __cpuinitdata") fixed centaur_cpu_dev's annotation without also fixing
    the pointers hanging off of it. Even if CPU hotplig support may be
    purely theoretical for Centaur, we should still not leave this as is.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/centaur.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/centaur.c b/xen/arch/x86/cpu/centaur.c
index 64730e5..66b1995 100644
--- a/xen/arch/x86/cpu/centaur.c
+++ b/xen/arch/x86/cpu/centaur.c
@@ -15,7 +15,7 @@
 #define RNG_ENABLED	(1 << 3)
 #define RNG_ENABLE	(1 << 6)	/* MSR_VIA_RNG */
 
-static void __init init_c3(struct cpuinfo_x86 *c)
+static void init_c3(struct cpuinfo_x86 *c)
 {
 	uint64_t msr_content;
 
@@ -54,7 +54,7 @@ static void __init init_c3(struct cpuinfo_x86 *c)
 	display_cacheinfo(c);
 }
 
-static void __init init_centaur(struct cpuinfo_x86 *c)
+static void init_centaur(struct cpuinfo_x86 *c)
 {
 	if (c->x86 == 6)
 		init_c3(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 Tue Oct 20 14:55:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55: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 1ZoYJk-0004jB-6n; Tue, 20 Oct 2015 14:55: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 1ZoYJj-0004j5-5b
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:11 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	6D/FC-10715-EC556265; Tue, 20 Oct 2015 14:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1445352908!48543652!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23841 invoked from network); 20 Oct 2015 14:55:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:55:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJg-0001iV-AD
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJd-0001s7-UC
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:06 +0000
Date: Tue, 20 Oct 2015 14:55:05 +0000
Message-Id: <E1ZoYJd-0001s7-UC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] virtio-blk: initialise unused
	blkcfg.size_max field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 835928ed5d9a707c95e19213e1a201366678cb1c
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:23:24 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:05 2015 +0100

    virtio-blk: initialise unused blkcfg.size_max field
    
    Newer GCC warns about memcpy()ing uninitialised data.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1056088
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/virtio-blk.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 520ad1b..fcf893a 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -252,6 +252,7 @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
     stw_raw(&blkcfg.cylinders, cylinders);
     blkcfg.heads = heads;
     blkcfg.sectors = secs;
+    blkcfg.size_max = 0;
     memcpy(config, &blkcfg, sizeof(blkcfg));
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55: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 1ZoYJk-0004jB-6n; Tue, 20 Oct 2015 14:55: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 1ZoYJj-0004j5-5b
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:11 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	6D/FC-10715-EC556265; Tue, 20 Oct 2015 14:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1445352908!48543652!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23841 invoked from network); 20 Oct 2015 14:55:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:55:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJg-0001iV-AD
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJd-0001s7-UC
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:06 +0000
Date: Tue, 20 Oct 2015 14:55:05 +0000
Message-Id: <E1ZoYJd-0001s7-UC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] virtio-blk: initialise unused
	blkcfg.size_max field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 835928ed5d9a707c95e19213e1a201366678cb1c
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:23:24 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:05 2015 +0100

    virtio-blk: initialise unused blkcfg.size_max field
    
    Newer GCC warns about memcpy()ing uninitialised data.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1056088
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/virtio-blk.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 520ad1b..fcf893a 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -252,6 +252,7 @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
     stw_raw(&blkcfg.cylinders, cylinders);
     blkcfg.heads = heads;
     blkcfg.sectors = secs;
+    blkcfg.size_max = 0;
     memcpy(config, &blkcfg, sizeof(blkcfg));
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYJu-0004kE-9E; Tue, 20 Oct 2015 14:55:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJt-0004jz-5e
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:21 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	59/7E-16965-8D556265; Tue, 20 Oct 2015 14:55:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1445352919!18095590!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21883 invoked from network); 20 Oct 2015 14:55:19 -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;
	20 Oct 2015 14:55:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJq-0001j8-OE
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJq-0001sW-Lq
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:18 +0000
Date: Tue, 20 Oct 2015 14:55:18 +0000
Message-Id: <E1ZoYJq-0001sW-Lq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] cirrus_vga: default all I/O
	port reads to 0xff
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c615d81a3c0fca9ca4706f6505cc032c737cf0c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:39:43 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:05 2015 +0100

    cirrus_vga: default all I/O port reads to 0xff
    
    Some error paths in vga_ioport_read() would return undefined values.
    Always default the result to 0xff.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a26b051..11ce212 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2674,7 +2674,7 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
 static uint32_t vga_ioport_read(void *opaque, uint32_t addr)
 {
     CirrusVGAState *s = opaque;
-    int val, index;
+    int val = 0xff, index;
 
     /* check port range access depending on color/monochrome mode */
     if ((addr >= 0x3b0 && addr <= 0x3bf && (s->msr & MSR_COLOR_EMULATION))
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYJu-0004kE-9E; Tue, 20 Oct 2015 14:55:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJt-0004jz-5e
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:21 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	59/7E-16965-8D556265; Tue, 20 Oct 2015 14:55:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1445352919!18095590!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21883 invoked from network); 20 Oct 2015 14:55:19 -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;
	20 Oct 2015 14:55:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJq-0001j8-OE
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYJq-0001sW-Lq
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:18 +0000
Date: Tue, 20 Oct 2015 14:55:18 +0000
Message-Id: <E1ZoYJq-0001sW-Lq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] cirrus_vga: default all I/O
	port reads to 0xff
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c615d81a3c0fca9ca4706f6505cc032c737cf0c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:39:43 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:05 2015 +0100

    cirrus_vga: default all I/O port reads to 0xff
    
    Some error paths in vga_ioport_read() would return undefined values.
    Always default the result to 0xff.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a26b051..11ce212 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2674,7 +2674,7 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
 static uint32_t vga_ioport_read(void *opaque, uint32_t addr)
 {
     CirrusVGAState *s = opaque;
-    int val, index;
+    int val = 0xff, index;
 
     /* check port range access depending on color/monochrome mode */
     if ((addr >= 0x3b0 && addr <= 0x3bf && (s->msr & MSR_COLOR_EMULATION))
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYK5-0004lZ-Bl; Tue, 20 Oct 2015 14:55: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 1ZoYK3-0004lP-R3
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:32 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	51/7A-15765-2E556265; Tue, 20 Oct 2015 14:55:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445352929!23949776!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9296 invoked from network); 20 Oct 2015 14:55:30 -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;
	20 Oct 2015 14:55:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYK1-0001jG-44
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYK1-0001st-0c
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:29 +0000
Date: Tue, 20 Oct 2015 14:55:29 +0000
Message-Id: <E1ZoYK1-0001st-0c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] lm832x: don't overrun file
	buffer on save/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 fb9ee2e1049f7ca8f597a00360745ead64fd974b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:46:46 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    lm832x: don't overrun file buffer on save/restore
    
    Saving and restoring an lm832x record would overrun the pwm.file array
    since pwm.file is uint16_t elements and sizeof(pwm.file) twice as many
    elements.
    
    To ensure compatibility, padding bytes are added to the record.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-IDs: 1055728 1055729
---
 hw/lm832x.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/lm832x.c b/hw/lm832x.c
index dd94310..a212866 100644
--- a/hw/lm832x.c
+++ b/hw/lm832x.c
@@ -439,8 +439,11 @@ static void lm_kbd_save(QEMUFile *f, void *opaque)
     qemu_put_byte(f, s->kbd.len);
     qemu_put_buffer(f, s->kbd.fifo, sizeof(s->kbd.fifo));
 
-    for (i = 0; i < sizeof(s->pwm.file); i ++)
+    for (i = 0; i < ARRAY_SIZE(s->pwm.file); i ++)
         qemu_put_be16s(f, &s->pwm.file[i]);
+    /* Padding for compatibility with older records. */
+    for ( ; i < sizeof(s->pwm.file); i++)
+        qemu_put_be16s(f, 0);
     qemu_put_8s(f, &s->pwm.faddr);
     qemu_put_buffer(f, s->pwm.addr, sizeof(s->pwm.addr));
     qemu_put_timer(f, s->pwm.tm[0]);
@@ -451,6 +454,7 @@ static void lm_kbd_save(QEMUFile *f, void *opaque)
 static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
 {
     struct lm_kbd_s *s = (struct lm_kbd_s *) opaque;
+    uint16_t pad;
     int i;
 
     i2c_slave_load(f, &s->i2c);
@@ -475,8 +479,11 @@ static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
     s->kbd.len = qemu_get_byte(f);
     qemu_get_buffer(f, s->kbd.fifo, sizeof(s->kbd.fifo));
 
-    for (i = 0; i < sizeof(s->pwm.file); i ++)
+    for (i = 0; i < ARRAY_SIZE(s->pwm.file); i ++)
         qemu_get_be16s(f, &s->pwm.file[i]);
+    /* Skip padding. */
+    for ( ; i < sizeof(s->pwm.file); i++)
+        qemu_get_be16(f);
     qemu_get_8s(f, &s->pwm.faddr);
     qemu_get_buffer(f, s->pwm.addr, sizeof(s->pwm.addr));
     qemu_get_timer(f, s->pwm.tm[0]);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYK5-0004lZ-Bl; Tue, 20 Oct 2015 14:55: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 1ZoYK3-0004lP-R3
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:32 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	51/7A-15765-2E556265; Tue, 20 Oct 2015 14:55:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445352929!23949776!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9296 invoked from network); 20 Oct 2015 14:55:30 -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;
	20 Oct 2015 14:55:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYK1-0001jG-44
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYK1-0001st-0c
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:29 +0000
Date: Tue, 20 Oct 2015 14:55:29 +0000
Message-Id: <E1ZoYK1-0001st-0c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] lm832x: don't overrun file
	buffer on save/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 fb9ee2e1049f7ca8f597a00360745ead64fd974b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:46:46 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    lm832x: don't overrun file buffer on save/restore
    
    Saving and restoring an lm832x record would overrun the pwm.file array
    since pwm.file is uint16_t elements and sizeof(pwm.file) twice as many
    elements.
    
    To ensure compatibility, padding bytes are added to the record.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-IDs: 1055728 1055729
---
 hw/lm832x.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/lm832x.c b/hw/lm832x.c
index dd94310..a212866 100644
--- a/hw/lm832x.c
+++ b/hw/lm832x.c
@@ -439,8 +439,11 @@ static void lm_kbd_save(QEMUFile *f, void *opaque)
     qemu_put_byte(f, s->kbd.len);
     qemu_put_buffer(f, s->kbd.fifo, sizeof(s->kbd.fifo));
 
-    for (i = 0; i < sizeof(s->pwm.file); i ++)
+    for (i = 0; i < ARRAY_SIZE(s->pwm.file); i ++)
         qemu_put_be16s(f, &s->pwm.file[i]);
+    /* Padding for compatibility with older records. */
+    for ( ; i < sizeof(s->pwm.file); i++)
+        qemu_put_be16s(f, 0);
     qemu_put_8s(f, &s->pwm.faddr);
     qemu_put_buffer(f, s->pwm.addr, sizeof(s->pwm.addr));
     qemu_put_timer(f, s->pwm.tm[0]);
@@ -451,6 +454,7 @@ static void lm_kbd_save(QEMUFile *f, void *opaque)
 static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
 {
     struct lm_kbd_s *s = (struct lm_kbd_s *) opaque;
+    uint16_t pad;
     int i;
 
     i2c_slave_load(f, &s->i2c);
@@ -475,8 +479,11 @@ static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
     s->kbd.len = qemu_get_byte(f);
     qemu_get_buffer(f, s->kbd.fifo, sizeof(s->kbd.fifo));
 
-    for (i = 0; i < sizeof(s->pwm.file); i ++)
+    for (i = 0; i < ARRAY_SIZE(s->pwm.file); i ++)
         qemu_get_be16s(f, &s->pwm.file[i]);
+    /* Skip padding. */
+    for ( ; i < sizeof(s->pwm.file); i++)
+        qemu_get_be16(f);
     qemu_get_8s(f, &s->pwm.faddr);
     qemu_get_buffer(f, s->pwm.addr, sizeof(s->pwm.addr));
     qemu_get_timer(f, s->pwm.tm[0]);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55: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 1ZoYKF-0004nB-EF; Tue, 20 Oct 2015 14:55: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 1ZoYKE-0004mu-4i
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:42 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	0C/1C-01753-DE556265; Tue, 20 Oct 2015 14:55:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445352939!54986331!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15337 invoked from network); 20 Oct 2015 14:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:55:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKB-0001jO-HY
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKB-0001tl-Eo
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:39 +0000
Date: Tue, 20 Oct 2015 14:55:39 +0000
Message-Id: <E1ZoYKB-0001tl-Eo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vvfat: fix fat_chksum()
	buffer overrun warning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af9e620745434868b0aeebc00c6ca1cadd9a01c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:54:11 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-vvfat: fix fat_chksum() buffer overrun warning
    
    Newer GCC versions raise an undefined behaviour warning in
    fat_chksum() because it overruns the name buffer.  However, this is
    intentional behaviour because the extension array immediately follows.
    
    Refactor this function to avoid the warning and make it clear it's
    checksumming both parts.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-ID: 1055738
---
 block-vvfat.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 9eb676b..345d7be 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -504,14 +504,21 @@ static void set_begin_of_direntry(direntry_t* direntry, uint32_t begin)
 
 /* fat functions */
 
+static inline void fat_chksum_part(const char *name, size_t len, uint8_t *chksum)
+{
+    size_t i;
+
+    for(i = 0; i < len; i++)
+	*chksum = (((*chksum&0xfe) >> 1) | ((*chksum & 0x01) ? 0x80 : 0))
+	    + (unsigned char)name[i];
+}
+
 static inline uint8_t fat_chksum(const direntry_t* entry)
 {
     uint8_t chksum=0;
-    int i;
 
-    for(i=0;i<11;i++)
-	chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0))
-	    +(unsigned char)entry->name[i];
+    fat_chksum_part(entry->name, ARRAY_SIZE(entry->name), &chksum);
+    fat_chksum_part(entry->extension, ARRAY_SIZE(entry->extension), &chksum);
 
     return chksum;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55: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 1ZoYKF-0004nB-EF; Tue, 20 Oct 2015 14:55: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 1ZoYKE-0004mu-4i
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:42 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	0C/1C-01753-DE556265; Tue, 20 Oct 2015 14:55:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445352939!54986331!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15337 invoked from network); 20 Oct 2015 14:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:55:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKB-0001jO-HY
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKB-0001tl-Eo
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:39 +0000
Date: Tue, 20 Oct 2015 14:55:39 +0000
Message-Id: <E1ZoYKB-0001tl-Eo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vvfat: fix fat_chksum()
	buffer overrun warning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af9e620745434868b0aeebc00c6ca1cadd9a01c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:54:11 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-vvfat: fix fat_chksum() buffer overrun warning
    
    Newer GCC versions raise an undefined behaviour warning in
    fat_chksum() because it overruns the name buffer.  However, this is
    intentional behaviour because the extension array immediately follows.
    
    Refactor this function to avoid the warning and make it clear it's
    checksumming both parts.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-ID: 1055738
---
 block-vvfat.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 9eb676b..345d7be 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -504,14 +504,21 @@ static void set_begin_of_direntry(direntry_t* direntry, uint32_t begin)
 
 /* fat functions */
 
+static inline void fat_chksum_part(const char *name, size_t len, uint8_t *chksum)
+{
+    size_t i;
+
+    for(i = 0; i < len; i++)
+	*chksum = (((*chksum&0xfe) >> 1) | ((*chksum & 0x01) ? 0x80 : 0))
+	    + (unsigned char)name[i];
+}
+
 static inline uint8_t fat_chksum(const direntry_t* entry)
 {
     uint8_t chksum=0;
-    int i;
 
-    for(i=0;i<11;i++)
-	chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0))
-	    +(unsigned char)entry->name[i];
+    fat_chksum_part(entry->name, ARRAY_SIZE(entry->name), &chksum);
+    fat_chksum_part(entry->extension, ARRAY_SIZE(entry->extension), &chksum);
 
     return chksum;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYKR-0004ot-Gw; Tue, 20 Oct 2015 14:55:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKQ-0004of-2h
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:54 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	42/44-01748-9F556265; Tue, 20 Oct 2015 14:55:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445352950!50598397!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30152 invoked from network); 20 Oct 2015 14:55:51 -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;
	20 Oct 2015 14:55:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKL-0001jZ-TI
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKL-0001u7-RF
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:49 +0000
Date: Tue, 20 Oct 2015 14:55:49 +0000
Message-Id: <E1ZoYKL-0001u7-RF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] usb-linux.c: fix buffer overflow
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c1e883f6c41b15690f6f466aeaa87362723bcb4
Author:     Jim Paris <jim@jtan.com>
AuthorDate: Wed Apr 22 12:29:21 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    usb-linux.c: fix buffer overflow
    
    In usb-linux.c:usb_host_handle_control, we pass a 1024-byte buffer and
    length to the kernel.  However, the length was provided by the caller
    of dev->handle_packet, and is not checked, so the kernel might provide
    too much data and overflow our buffer.
    
    For example, hw/usb-uhci.c could set the length to 2047.
    hw/usb-ohci.c looks like it might go up to 4096 or 8192.
    
    This causes a qemu crash, as reported here:
      http://www.mail-archive.com/kvm@vger.kernel.org/msg18447.html
    
    This patch increases the usb-linux.c buffer size to 2048 to fix the
    specific device reported, and adds a check to avoid the overflow in
    any case.
    
    Signed-off-by: Jim Paris <jim@jtan.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 usb-linux.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/usb-linux.c b/usb-linux.c
index 5dfed8c..51bac8a 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -117,7 +117,7 @@ struct ctrl_struct {
     uint16_t offset;
     uint8_t  state;
     struct   usb_ctrlrequest req;
-    uint8_t  buffer[1024];
+    uint8_t  buffer[2048];
 };
 
 typedef struct USBHostDevice {
@@ -554,6 +554,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
     struct usbdevfs_urb *urb;
     AsyncURB *aurb;
     int ret, value, index;
+    int buffer_len;
 
     /* 
      * Process certain standard device requests.
@@ -582,6 +583,13 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
 
     /* The rest are asynchronous */
 
+    buffer_len = 8 + s->ctrl.len;
+    if (buffer_len > sizeof(s->ctrl.buffer)) {
+	    fprintf(stderr, "husb: ctrl buffer too small (%d > %zu)\n",
+		    buffer_len, sizeof(s->ctrl.buffer));
+	    return USB_RET_STALL;
+    }
+
     aurb = async_alloc();
     aurb->hdev   = s;
     aurb->packet = p;
@@ -598,7 +606,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
     urb->endpoint = p->devep;
 
     urb->buffer        = &s->ctrl.req;
-    urb->buffer_length = 8 + s->ctrl.len;
+    urb->buffer_length = buffer_len;
 
     urb->usercontext = s;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:55:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:55:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYKR-0004ot-Gw; Tue, 20 Oct 2015 14:55:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKQ-0004of-2h
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:54 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	42/44-01748-9F556265; Tue, 20 Oct 2015 14:55:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445352950!50598397!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30152 invoked from network); 20 Oct 2015 14:55:51 -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;
	20 Oct 2015 14:55:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKL-0001jZ-TI
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKL-0001u7-RF
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:55:49 +0000
Date: Tue, 20 Oct 2015 14:55:49 +0000
Message-Id: <E1ZoYKL-0001u7-RF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] usb-linux.c: fix buffer overflow
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c1e883f6c41b15690f6f466aeaa87362723bcb4
Author:     Jim Paris <jim@jtan.com>
AuthorDate: Wed Apr 22 12:29:21 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    usb-linux.c: fix buffer overflow
    
    In usb-linux.c:usb_host_handle_control, we pass a 1024-byte buffer and
    length to the kernel.  However, the length was provided by the caller
    of dev->handle_packet, and is not checked, so the kernel might provide
    too much data and overflow our buffer.
    
    For example, hw/usb-uhci.c could set the length to 2047.
    hw/usb-ohci.c looks like it might go up to 4096 or 8192.
    
    This causes a qemu crash, as reported here:
      http://www.mail-archive.com/kvm@vger.kernel.org/msg18447.html
    
    This patch increases the usb-linux.c buffer size to 2048 to fix the
    specific device reported, and adds a check to avoid the overflow in
    any case.
    
    Signed-off-by: Jim Paris <jim@jtan.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 usb-linux.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/usb-linux.c b/usb-linux.c
index 5dfed8c..51bac8a 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -117,7 +117,7 @@ struct ctrl_struct {
     uint16_t offset;
     uint8_t  state;
     struct   usb_ctrlrequest req;
-    uint8_t  buffer[1024];
+    uint8_t  buffer[2048];
 };
 
 typedef struct USBHostDevice {
@@ -554,6 +554,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
     struct usbdevfs_urb *urb;
     AsyncURB *aurb;
     int ret, value, index;
+    int buffer_len;
 
     /* 
      * Process certain standard device requests.
@@ -582,6 +583,13 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
 
     /* The rest are asynchronous */
 
+    buffer_len = 8 + s->ctrl.len;
+    if (buffer_len > sizeof(s->ctrl.buffer)) {
+	    fprintf(stderr, "husb: ctrl buffer too small (%d > %zu)\n",
+		    buffer_len, sizeof(s->ctrl.buffer));
+	    return USB_RET_STALL;
+    }
+
     aurb = async_alloc();
     aurb->hdev   = s;
     aurb->packet = p;
@@ -598,7 +606,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
     urb->endpoint = p->devep;
 
     urb->buffer        = &s->ctrl.req;
-    urb->buffer_length = 8 + s->ctrl.len;
+    urb->buffer_length = buffer_len;
 
     urb->usercontext = s;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYKa-0004qR-Ja; Tue, 20 Oct 2015 14:56:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKY-0004q5-Ng
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:02 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	D2/2A-04752-20656265; Tue, 20 Oct 2015 14:56:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1445352960!41191841!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23498 invoked from network); 20 Oct 2015 14:56:01 -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;
	20 Oct 2015 14:56:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKW-0001jk-8B
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKW-0001us-5e
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:00 +0000
Date: Tue, 20 Oct 2015 14:56:00 +0000
Message-Id: <E1ZoYKW-0001us-5e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] CVE-2014-8106: cirrus: fix blit
	region check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5e4ed9cded14f2d8445150c8a6d225b283bed3fa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 21 17:16:42 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-8106: cirrus: fix blit region check
    
    Backport of qemu-upstream:
     * bf25983345ca44aec3dd92c57142be45452bd38a
     * d3532a0db02296e687711b8cdc7791924efccea0
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/cirrus_vga.c |   66 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 11ce212..d3bf4cf 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -34,6 +34,8 @@
 #include "qemu-xen.h"
 #include "qemu-log.h"
 
+#include <assert.h>
+
 /*
  * TODO:
  *    - destination write mask support not complete (bits 5..7)
@@ -223,20 +225,6 @@
 
 #define ABS(a) ((signed)(a) > 0 ? a : -a)
 
-#define BLTUNSAFE(s) \
-    ( \
-        ( /* check dst is within bounds */ \
-            (s)->cirrus_blt_height * ABS((s)->cirrus_blt_dstpitch) \
-                + ((s)->cirrus_blt_dstaddr & (s)->cirrus_addr_mask) > \
-                    (s)->vram_size \
-        ) || \
-        ( /* check src is within bounds */ \
-            (s)->cirrus_blt_height * ABS((s)->cirrus_blt_srcpitch) \
-                + ((s)->cirrus_blt_srcaddr & (s)->cirrus_addr_mask) > \
-                    (s)->vram_size \
-        ) \
-    )
-
 struct CirrusVGAState;
 typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
                                      uint8_t * dst, const uint8_t * src,
@@ -315,6 +303,50 @@ static void cirrus_vga_mem_writew(void *opaque, target_phys_addr_t addr, uint32_
  *
  ***************************************/
 
+static bool blit_region_is_unsafe(struct CirrusVGAState *s,
+                                  int32_t pitch, int32_t addr)
+{
+    if (pitch < 0) {
+        int64_t min = addr
+            + ((int64_t)s->cirrus_blt_height-1) * pitch;
+        int32_t max = addr
+            + s->cirrus_blt_width;
+        if (min < 0 || max >= s->vram_size) {
+            return true;
+        }
+    } else {
+        int64_t max = addr
+            + ((int64_t)s->cirrus_blt_height-1) * pitch
+            + s->cirrus_blt_width;
+        if (max >= s->vram_size) {
+            return true;
+        }
+    }
+    return false;
+}
+
+static bool blit_is_unsafe(struct CirrusVGAState *s)
+{
+    /* should be the case, see cirrus_bitblt_start */
+    assert(s->cirrus_blt_width > 0);
+    assert(s->cirrus_blt_height > 0);
+
+    if (s->cirrus_blt_width > CIRRUS_BLTBUFSIZE) {
+        return true;
+    }
+
+    if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
+                              s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
+        return true;
+    }
+    if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch,
+                              s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) {
+        return true;
+    }
+
+    return false;
+}
+
 static void cirrus_bitblt_rop_nop(CirrusVGAState *s,
                                   uint8_t *dst,const uint8_t *src,
                                   int dstpitch,int srcpitch,
@@ -676,7 +708,7 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s,
 
     dst = s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask);
 
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
 
     (*s->cirrus_rop) (s, dst, src,
@@ -694,7 +726,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
 {
     cirrus_fill_t rop_func;
 
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
     rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
     rop_func(s, s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
@@ -790,7 +822,7 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
 
 static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s)
 {
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
 
     cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->start_addr,
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYKa-0004qR-Ja; Tue, 20 Oct 2015 14:56:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKY-0004q5-Ng
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:02 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	D2/2A-04752-20656265; Tue, 20 Oct 2015 14:56:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1445352960!41191841!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23498 invoked from network); 20 Oct 2015 14:56:01 -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;
	20 Oct 2015 14:56:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKW-0001jk-8B
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKW-0001us-5e
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:00 +0000
Date: Tue, 20 Oct 2015 14:56:00 +0000
Message-Id: <E1ZoYKW-0001us-5e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] CVE-2014-8106: cirrus: fix blit
	region check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5e4ed9cded14f2d8445150c8a6d225b283bed3fa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 21 17:16:42 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-8106: cirrus: fix blit region check
    
    Backport of qemu-upstream:
     * bf25983345ca44aec3dd92c57142be45452bd38a
     * d3532a0db02296e687711b8cdc7791924efccea0
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/cirrus_vga.c |   66 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 11ce212..d3bf4cf 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -34,6 +34,8 @@
 #include "qemu-xen.h"
 #include "qemu-log.h"
 
+#include <assert.h>
+
 /*
  * TODO:
  *    - destination write mask support not complete (bits 5..7)
@@ -223,20 +225,6 @@
 
 #define ABS(a) ((signed)(a) > 0 ? a : -a)
 
-#define BLTUNSAFE(s) \
-    ( \
-        ( /* check dst is within bounds */ \
-            (s)->cirrus_blt_height * ABS((s)->cirrus_blt_dstpitch) \
-                + ((s)->cirrus_blt_dstaddr & (s)->cirrus_addr_mask) > \
-                    (s)->vram_size \
-        ) || \
-        ( /* check src is within bounds */ \
-            (s)->cirrus_blt_height * ABS((s)->cirrus_blt_srcpitch) \
-                + ((s)->cirrus_blt_srcaddr & (s)->cirrus_addr_mask) > \
-                    (s)->vram_size \
-        ) \
-    )
-
 struct CirrusVGAState;
 typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
                                      uint8_t * dst, const uint8_t * src,
@@ -315,6 +303,50 @@ static void cirrus_vga_mem_writew(void *opaque, target_phys_addr_t addr, uint32_
  *
  ***************************************/
 
+static bool blit_region_is_unsafe(struct CirrusVGAState *s,
+                                  int32_t pitch, int32_t addr)
+{
+    if (pitch < 0) {
+        int64_t min = addr
+            + ((int64_t)s->cirrus_blt_height-1) * pitch;
+        int32_t max = addr
+            + s->cirrus_blt_width;
+        if (min < 0 || max >= s->vram_size) {
+            return true;
+        }
+    } else {
+        int64_t max = addr
+            + ((int64_t)s->cirrus_blt_height-1) * pitch
+            + s->cirrus_blt_width;
+        if (max >= s->vram_size) {
+            return true;
+        }
+    }
+    return false;
+}
+
+static bool blit_is_unsafe(struct CirrusVGAState *s)
+{
+    /* should be the case, see cirrus_bitblt_start */
+    assert(s->cirrus_blt_width > 0);
+    assert(s->cirrus_blt_height > 0);
+
+    if (s->cirrus_blt_width > CIRRUS_BLTBUFSIZE) {
+        return true;
+    }
+
+    if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
+                              s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
+        return true;
+    }
+    if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch,
+                              s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) {
+        return true;
+    }
+
+    return false;
+}
+
 static void cirrus_bitblt_rop_nop(CirrusVGAState *s,
                                   uint8_t *dst,const uint8_t *src,
                                   int dstpitch,int srcpitch,
@@ -676,7 +708,7 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s,
 
     dst = s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask);
 
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
 
     (*s->cirrus_rop) (s, dst, src,
@@ -694,7 +726,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
 {
     cirrus_fill_t rop_func;
 
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
     rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
     rop_func(s, s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
@@ -790,7 +822,7 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
 
 static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s)
 {
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
 
     cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->start_addr,
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYKk-0004sI-MI; Tue, 20 Oct 2015 14:56: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 1ZoYKj-0004rv-5Z
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:13 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	CA/97-03763-C0656265; Tue, 20 Oct 2015 14:56:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445352970!22205111!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23628 invoked from network); 20 Oct 2015 14:56:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:56:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKg-0001kL-Mc
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKg-0001vT-Ik
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:10 +0000
Date: Tue, 20 Oct 2015 14:56:10 +0000
Message-Id: <E1ZoYKg-0001vT-Ik@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] CVE-2014-7815: vnc: sanitize
	bits_per_pixel from the client
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b050c69ee3171997d33bb8b2c111a4ebea169fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 21 19:21:11 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-7815: vnc: sanitize bits_per_pixel from the client
    
    Backport of qemu-upstream:
     * e6908bfe8e07f2b452e78e677da1b45b1c0f6829
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vnc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/vnc.c b/vnc.c
index 48e5c46..573af3b 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1616,6 +1616,16 @@ static void set_pixel_format(VncState *vs,
         return;
     }
 
+    switch (bits_per_pixel) {
+    case 8:
+    case 16:
+    case 32:
+        break;
+    default:
+        vnc_client_error(vs);
+        return;
+    }
+
     vs->clientds = vs->serverds;
     vs->clientds.pf.rmax = red_max;
     count_bits(vs->clientds.pf.rbits, red_max);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYKk-0004sI-MI; Tue, 20 Oct 2015 14:56: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 1ZoYKj-0004rv-5Z
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:13 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	CA/97-03763-C0656265; Tue, 20 Oct 2015 14:56:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445352970!22205111!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23628 invoked from network); 20 Oct 2015 14:56:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:56:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKg-0001kL-Mc
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKg-0001vT-Ik
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:10 +0000
Date: Tue, 20 Oct 2015 14:56:10 +0000
Message-Id: <E1ZoYKg-0001vT-Ik@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] CVE-2014-7815: vnc: sanitize
	bits_per_pixel from the client
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b050c69ee3171997d33bb8b2c111a4ebea169fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 21 19:21:11 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-7815: vnc: sanitize bits_per_pixel from the client
    
    Backport of qemu-upstream:
     * e6908bfe8e07f2b452e78e677da1b45b1c0f6829
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vnc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/vnc.c b/vnc.c
index 48e5c46..573af3b 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1616,6 +1616,16 @@ static void set_pixel_format(VncState *vs,
         return;
     }
 
+    switch (bits_per_pixel) {
+    case 8:
+    case 16:
+    case 32:
+        break;
+    default:
+        vnc_client_error(vs);
+        return;
+    }
+
     vs->clientds = vs->serverds;
     vs->clientds.pf.rmax = red_max;
     count_bits(vs->clientds.pf.rbits, red_max);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYKw-0004uF-P0; Tue, 20 Oct 2015 14:56: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 1ZoYKu-0004to-QW
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:25 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	DC/0A-06179-81656265; Tue, 20 Oct 2015 14:56:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1445352981!13808916!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 19544 invoked from network); 20 Oct 2015 14:56:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:56:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKr-0001kT-4m
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKq-0001vp-W6
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:21 +0000
Date: Tue, 20 Oct 2015 14:56:20 +0000
Message-Id: <E1ZoYKq-0001vp-W6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] CVE-2014-3615: vbe: rework
	sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a1e383df25477e21b48c67c93c3a4dde19f9e4f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Feb 22 19:21:08 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-3615: vbe: rework sanity checks
    
    Backport of qemu-upstream:
     * c1b886c45dc70f247300f549dce9833f3fa2def5
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/vga.c |  154 ++++++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 95 insertions(+), 59 deletions(-)

diff --git a/hw/vga.c b/hw/vga.c
index d0c12aa..e8b1ce0 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -521,6 +521,93 @@ static void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
 }
 
 #ifdef CONFIG_BOCHS_VBE
+/*
+ * Sanity check vbe register writes.
+ *
+ * As we don't have a way to signal errors to the guest in the bochs
+ * dispi interface we'll go adjust the registers to the closest valid
+ * value.
+ */
+static void vbe_fixup_regs(VGAState *s)
+{
+    uint16_t *r = s->vbe_regs;
+    uint32_t bits, linelength, maxy, offset;
+
+    if (!(r[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED)) {
+        /* vbe is turned off -- nothing to do */
+        return;
+    }
+
+    /* check depth */
+    switch (r[VBE_DISPI_INDEX_BPP]) {
+    case 4:
+    case 8:
+    case 16:
+    case 24:
+    case 32:
+        bits = r[VBE_DISPI_INDEX_BPP];
+        break;
+    case 15:
+        bits = 16;
+        break;
+    default:
+        bits = r[VBE_DISPI_INDEX_BPP] = 8;
+        break;
+    }
+
+    /* check width */
+    r[VBE_DISPI_INDEX_XRES] &= ~7u;
+    if (r[VBE_DISPI_INDEX_XRES] == 0) {
+        r[VBE_DISPI_INDEX_XRES] = 8;
+    }
+    if (r[VBE_DISPI_INDEX_XRES] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_XRES] = VBE_DISPI_MAX_XRES;
+    }
+    r[VBE_DISPI_INDEX_VIRT_WIDTH] &= ~7u;
+    if (r[VBE_DISPI_INDEX_VIRT_WIDTH] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_VIRT_WIDTH] = VBE_DISPI_MAX_XRES;
+    }
+    if (r[VBE_DISPI_INDEX_VIRT_WIDTH] < r[VBE_DISPI_INDEX_XRES]) {
+        r[VBE_DISPI_INDEX_VIRT_WIDTH] = r[VBE_DISPI_INDEX_XRES];
+    }
+
+    /* check height */
+    linelength = r[VBE_DISPI_INDEX_VIRT_WIDTH] * bits / 8;
+    maxy = s->vram_size / linelength;
+    if (r[VBE_DISPI_INDEX_YRES] == 0) {
+        r[VBE_DISPI_INDEX_YRES] = 1;
+    }
+    if (r[VBE_DISPI_INDEX_YRES] > VBE_DISPI_MAX_YRES) {
+        r[VBE_DISPI_INDEX_YRES] = VBE_DISPI_MAX_YRES;
+    }
+    if (r[VBE_DISPI_INDEX_YRES] > maxy) {
+        r[VBE_DISPI_INDEX_YRES] = maxy;
+    }
+
+    /* check offset */
+    if (r[VBE_DISPI_INDEX_X_OFFSET] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_X_OFFSET] = VBE_DISPI_MAX_XRES;
+    }
+    if (r[VBE_DISPI_INDEX_Y_OFFSET] > VBE_DISPI_MAX_YRES) {
+        r[VBE_DISPI_INDEX_Y_OFFSET] = VBE_DISPI_MAX_YRES;
+    }
+    offset = r[VBE_DISPI_INDEX_X_OFFSET] * bits / 8;
+    offset += r[VBE_DISPI_INDEX_Y_OFFSET] * linelength;
+    if (offset + r[VBE_DISPI_INDEX_YRES] * linelength > s->vram_size) {
+        r[VBE_DISPI_INDEX_Y_OFFSET] = 0;
+        offset = r[VBE_DISPI_INDEX_X_OFFSET] * bits / 8;
+        if (offset + r[VBE_DISPI_INDEX_YRES] * linelength > s->vram_size) {
+            r[VBE_DISPI_INDEX_X_OFFSET] = 0;
+            offset = 0;
+        }
+    }
+
+    /* update vga state */
+    r[VBE_DISPI_INDEX_VIRT_HEIGHT] = maxy;
+    s->vbe_line_offset = linelength;
+    s->vbe_start_addr  = offset / 4;
+}
+
 static uint32_t vbe_ioport_read_index(void *opaque, uint32_t addr)
 {
     VGAState *s = opaque;
@@ -588,22 +675,13 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
             }
             break;
         case VBE_DISPI_INDEX_XRES:
-            if ((val <= VBE_DISPI_MAX_XRES) && ((val & 7) == 0)) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
-            break;
         case VBE_DISPI_INDEX_YRES:
-            if (val <= VBE_DISPI_MAX_YRES) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
-            break;
         case VBE_DISPI_INDEX_BPP:
-            if (val == 0)
-                val = 8;
-            if (val == 4 || val == 8 || val == 15 ||
-                val == 16 || val == 24 || val == 32) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
+        case VBE_DISPI_INDEX_VIRT_WIDTH:
+        case VBE_DISPI_INDEX_X_OFFSET:
+        case VBE_DISPI_INDEX_Y_OFFSET:
+            s->vbe_regs[s->vbe_index] = val;
+            vbe_fixup_regs(s);
             break;
         case VBE_DISPI_INDEX_BANK:
             if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4) {
@@ -623,19 +701,11 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
                      set_vram_mapping(s, s->lfb_addr, s->lfb_end);
                 }
 
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] =
-                    s->vbe_regs[VBE_DISPI_INDEX_XRES];
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] =
-                    s->vbe_regs[VBE_DISPI_INDEX_YRES];
+                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = 0;
                 s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET] = 0;
                 s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET] = 0;
-
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    s->vbe_line_offset = s->vbe_regs[VBE_DISPI_INDEX_XRES] >> 1;
-                else
-                    s->vbe_line_offset = s->vbe_regs[VBE_DISPI_INDEX_XRES] *
-                        ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                s->vbe_start_addr = 0;
+                s->vbe_regs[VBE_DISPI_INDEX_ENABLE] |= VBE_DISPI_ENABLED;
+                vbe_fixup_regs(s);
 
                 /* clear the screen (should be done in BIOS) */
                 if (!(val & VBE_DISPI_NOCLEARMEM)) {
@@ -677,40 +747,6 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
             s->dac_8bit = (val & VBE_DISPI_8BIT_DAC) > 0;
             s->vbe_regs[s->vbe_index] = val;
             break;
-        case VBE_DISPI_INDEX_VIRT_WIDTH:
-            {
-                int w, h, line_offset;
-
-                if (val < s->vbe_regs[VBE_DISPI_INDEX_XRES])
-                    return;
-                w = val;
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    line_offset = w >> 1;
-                else
-                    line_offset = w * ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                h = s->vram_size / line_offset;
-                /* XXX: support weird bochs semantics ? */
-                if (h < s->vbe_regs[VBE_DISPI_INDEX_YRES])
-                    return;
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = w;
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] = h;
-                s->vbe_line_offset = line_offset;
-            }
-            break;
-        case VBE_DISPI_INDEX_X_OFFSET:
-        case VBE_DISPI_INDEX_Y_OFFSET:
-            {
-                int x;
-                s->vbe_regs[s->vbe_index] = val;
-                s->vbe_start_addr = s->vbe_line_offset * s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET];
-                x = s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET];
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    s->vbe_start_addr += x >> 1;
-                else
-                    s->vbe_start_addr += x * ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                s->vbe_start_addr >>= 2;
-            }
-            break;
         default:
             break;
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYKw-0004uF-P0; Tue, 20 Oct 2015 14:56: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 1ZoYKu-0004to-QW
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:25 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	DC/0A-06179-81656265; Tue, 20 Oct 2015 14:56:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1445352981!13808916!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 19544 invoked from network); 20 Oct 2015 14:56:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:56:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKr-0001kT-4m
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYKq-0001vp-W6
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:21 +0000
Date: Tue, 20 Oct 2015 14:56:20 +0000
Message-Id: <E1ZoYKq-0001vp-W6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] CVE-2014-3615: vbe: rework
	sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a1e383df25477e21b48c67c93c3a4dde19f9e4f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Feb 22 19:21:08 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-3615: vbe: rework sanity checks
    
    Backport of qemu-upstream:
     * c1b886c45dc70f247300f549dce9833f3fa2def5
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/vga.c |  154 ++++++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 95 insertions(+), 59 deletions(-)

diff --git a/hw/vga.c b/hw/vga.c
index d0c12aa..e8b1ce0 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -521,6 +521,93 @@ static void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
 }
 
 #ifdef CONFIG_BOCHS_VBE
+/*
+ * Sanity check vbe register writes.
+ *
+ * As we don't have a way to signal errors to the guest in the bochs
+ * dispi interface we'll go adjust the registers to the closest valid
+ * value.
+ */
+static void vbe_fixup_regs(VGAState *s)
+{
+    uint16_t *r = s->vbe_regs;
+    uint32_t bits, linelength, maxy, offset;
+
+    if (!(r[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED)) {
+        /* vbe is turned off -- nothing to do */
+        return;
+    }
+
+    /* check depth */
+    switch (r[VBE_DISPI_INDEX_BPP]) {
+    case 4:
+    case 8:
+    case 16:
+    case 24:
+    case 32:
+        bits = r[VBE_DISPI_INDEX_BPP];
+        break;
+    case 15:
+        bits = 16;
+        break;
+    default:
+        bits = r[VBE_DISPI_INDEX_BPP] = 8;
+        break;
+    }
+
+    /* check width */
+    r[VBE_DISPI_INDEX_XRES] &= ~7u;
+    if (r[VBE_DISPI_INDEX_XRES] == 0) {
+        r[VBE_DISPI_INDEX_XRES] = 8;
+    }
+    if (r[VBE_DISPI_INDEX_XRES] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_XRES] = VBE_DISPI_MAX_XRES;
+    }
+    r[VBE_DISPI_INDEX_VIRT_WIDTH] &= ~7u;
+    if (r[VBE_DISPI_INDEX_VIRT_WIDTH] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_VIRT_WIDTH] = VBE_DISPI_MAX_XRES;
+    }
+    if (r[VBE_DISPI_INDEX_VIRT_WIDTH] < r[VBE_DISPI_INDEX_XRES]) {
+        r[VBE_DISPI_INDEX_VIRT_WIDTH] = r[VBE_DISPI_INDEX_XRES];
+    }
+
+    /* check height */
+    linelength = r[VBE_DISPI_INDEX_VIRT_WIDTH] * bits / 8;
+    maxy = s->vram_size / linelength;
+    if (r[VBE_DISPI_INDEX_YRES] == 0) {
+        r[VBE_DISPI_INDEX_YRES] = 1;
+    }
+    if (r[VBE_DISPI_INDEX_YRES] > VBE_DISPI_MAX_YRES) {
+        r[VBE_DISPI_INDEX_YRES] = VBE_DISPI_MAX_YRES;
+    }
+    if (r[VBE_DISPI_INDEX_YRES] > maxy) {
+        r[VBE_DISPI_INDEX_YRES] = maxy;
+    }
+
+    /* check offset */
+    if (r[VBE_DISPI_INDEX_X_OFFSET] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_X_OFFSET] = VBE_DISPI_MAX_XRES;
+    }
+    if (r[VBE_DISPI_INDEX_Y_OFFSET] > VBE_DISPI_MAX_YRES) {
+        r[VBE_DISPI_INDEX_Y_OFFSET] = VBE_DISPI_MAX_YRES;
+    }
+    offset = r[VBE_DISPI_INDEX_X_OFFSET] * bits / 8;
+    offset += r[VBE_DISPI_INDEX_Y_OFFSET] * linelength;
+    if (offset + r[VBE_DISPI_INDEX_YRES] * linelength > s->vram_size) {
+        r[VBE_DISPI_INDEX_Y_OFFSET] = 0;
+        offset = r[VBE_DISPI_INDEX_X_OFFSET] * bits / 8;
+        if (offset + r[VBE_DISPI_INDEX_YRES] * linelength > s->vram_size) {
+            r[VBE_DISPI_INDEX_X_OFFSET] = 0;
+            offset = 0;
+        }
+    }
+
+    /* update vga state */
+    r[VBE_DISPI_INDEX_VIRT_HEIGHT] = maxy;
+    s->vbe_line_offset = linelength;
+    s->vbe_start_addr  = offset / 4;
+}
+
 static uint32_t vbe_ioport_read_index(void *opaque, uint32_t addr)
 {
     VGAState *s = opaque;
@@ -588,22 +675,13 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
             }
             break;
         case VBE_DISPI_INDEX_XRES:
-            if ((val <= VBE_DISPI_MAX_XRES) && ((val & 7) == 0)) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
-            break;
         case VBE_DISPI_INDEX_YRES:
-            if (val <= VBE_DISPI_MAX_YRES) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
-            break;
         case VBE_DISPI_INDEX_BPP:
-            if (val == 0)
-                val = 8;
-            if (val == 4 || val == 8 || val == 15 ||
-                val == 16 || val == 24 || val == 32) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
+        case VBE_DISPI_INDEX_VIRT_WIDTH:
+        case VBE_DISPI_INDEX_X_OFFSET:
+        case VBE_DISPI_INDEX_Y_OFFSET:
+            s->vbe_regs[s->vbe_index] = val;
+            vbe_fixup_regs(s);
             break;
         case VBE_DISPI_INDEX_BANK:
             if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4) {
@@ -623,19 +701,11 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
                      set_vram_mapping(s, s->lfb_addr, s->lfb_end);
                 }
 
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] =
-                    s->vbe_regs[VBE_DISPI_INDEX_XRES];
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] =
-                    s->vbe_regs[VBE_DISPI_INDEX_YRES];
+                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = 0;
                 s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET] = 0;
                 s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET] = 0;
-
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    s->vbe_line_offset = s->vbe_regs[VBE_DISPI_INDEX_XRES] >> 1;
-                else
-                    s->vbe_line_offset = s->vbe_regs[VBE_DISPI_INDEX_XRES] *
-                        ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                s->vbe_start_addr = 0;
+                s->vbe_regs[VBE_DISPI_INDEX_ENABLE] |= VBE_DISPI_ENABLED;
+                vbe_fixup_regs(s);
 
                 /* clear the screen (should be done in BIOS) */
                 if (!(val & VBE_DISPI_NOCLEARMEM)) {
@@ -677,40 +747,6 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
             s->dac_8bit = (val & VBE_DISPI_8BIT_DAC) > 0;
             s->vbe_regs[s->vbe_index] = val;
             break;
-        case VBE_DISPI_INDEX_VIRT_WIDTH:
-            {
-                int w, h, line_offset;
-
-                if (val < s->vbe_regs[VBE_DISPI_INDEX_XRES])
-                    return;
-                w = val;
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    line_offset = w >> 1;
-                else
-                    line_offset = w * ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                h = s->vram_size / line_offset;
-                /* XXX: support weird bochs semantics ? */
-                if (h < s->vbe_regs[VBE_DISPI_INDEX_YRES])
-                    return;
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = w;
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] = h;
-                s->vbe_line_offset = line_offset;
-            }
-            break;
-        case VBE_DISPI_INDEX_X_OFFSET:
-        case VBE_DISPI_INDEX_Y_OFFSET:
-            {
-                int x;
-                s->vbe_regs[s->vbe_index] = val;
-                s->vbe_start_addr = s->vbe_line_offset * s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET];
-                x = s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET];
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    s->vbe_start_addr += x >> 1;
-                else
-                    s->vbe_start_addr += x * ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                s->vbe_start_addr >>= 2;
-            }
-            break;
         default:
             break;
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYL4-0004vt-U2; Tue, 20 Oct 2015 14:56:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYL4-0004vf-7z
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:34 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	9A/1F-18886-12656265; Tue, 20 Oct 2015 14:56:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445352991!59955581!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10056 invoked from network); 20 Oct 2015 14:56:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:56:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYL1-0001kg-Hi
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYL1-0001wB-F5
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:31 +0000
Date: Tue, 20 Oct 2015 14:56:31 +0000
Message-Id: <E1ZoYL1-0001wB-F5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] cirrus_vga: fix division by 0
	for color expansion rop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd7c9bfa4955fa8c32bbaaa2b515ed2414ef9bc5
Author:     Aurelien Jarno <aurelien@aurel32.net>
AuthorDate: Tue Jan 4 21:58:24 2011 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    cirrus_vga: fix division by 0 for color expansion rop
    
    Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regression
    with Windows ME that leads to a division by 0 and a crash.
    
    It uses the color expansion rop with the source pitch set to 0. This is
    something allowed, as the manual explicitely says "When the source of
    color-expand data is display memory, the source pitch is ignored.".
    
    This patch fixes this regression by computing sx, sy and others
    variables only if they are going to be used later, that is for a plain
    copy ROP. It basically consists in moving code.
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 hw/cirrus_vga.c |   70 +++++++++++++++++++++++++++---------------------------
 1 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index d3bf4cf..e6c3893 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -754,46 +754,46 @@ static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
 
 static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
 {
-    int sx, sy;
-    int dx, dy;
-    int width, height;
-    int depth;
+    int sx = 0, sy = 0;
+    int dx = 0, dy = 0;
+    int depth = 0;
     int notify = 0;
 
-    depth = s->get_bpp((VGAState *)s) / 8;
-    s->get_resolution((VGAState *)s, &width, &height);
-
-    /* extra x, y */
-    sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
-    sy = (src / ABS(s->cirrus_blt_srcpitch));
-    dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
-    dy = (dst / ABS(s->cirrus_blt_dstpitch));
-
-    /* normalize width */
-    w /= depth;
-
-    /* if we're doing a backward copy, we have to adjust
-       our x/y to be the upper left corner (instead of the lower
-       right corner) */
-    if (s->cirrus_blt_dstpitch < 0) {
-	sx -= (s->cirrus_blt_width / depth) - 1;
-	dx -= (s->cirrus_blt_width / depth) - 1;
-	sy -= s->cirrus_blt_height - 1;
-	dy -= s->cirrus_blt_height - 1;
-    }
+    /* make sure to only copy if it's a plain copy ROP */
+    if (*s->cirrus_rop == cirrus_bitblt_rop_fwd_src ||
+        *s->cirrus_rop == cirrus_bitblt_rop_bkwd_src) {
+        int width, height;
+
+        depth = s->get_bpp((VGAState *)s) / 8;
+        s->get_resolution((VGAState *)s, &width, &height);
+
+        /* extra x, y */
+        sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
+        sy = (src / ABS(s->cirrus_blt_srcpitch));
+        dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
+        dy = (dst / ABS(s->cirrus_blt_dstpitch));
+
+        /* normalize width */
+        w /= depth;
+
+        /* if we're doing a backward copy, we have to adjust
+           our x/y to be the upper left corner (instead of the lower
+           right corner) */
+        if (s->cirrus_blt_dstpitch < 0) {
+            sx -= (s->cirrus_blt_width / depth) - 1;
+            dx -= (s->cirrus_blt_width / depth) - 1;
+            sy -= s->cirrus_blt_height - 1;
+            dy -= s->cirrus_blt_height - 1;
+        }
 
-    /* are we in the visible portion of memory? */
-    if (sx >= 0 && sy >= 0 && dx >= 0 && dy >= 0 &&
-	(sx + w) <= width && (sy + h) <= height &&
-	(dx + w) <= width && (dy + h) <= height) {
-	notify = 1;
+        /* are we in the visible portion of memory? */
+        if (sx >= 0 && sy >= 0 && dx >= 0 && dy >= 0 &&
+            (sx + w) <= width && (sy + h) <= height &&
+            (dx + w) <= width && (dy + h) <= height) {
+            notify = 1;
+        }
     }
 
-    /* make to sure only copy if it's a plain copy ROP */
-    if (*s->cirrus_rop != cirrus_bitblt_rop_fwd_src &&
-	*s->cirrus_rop != cirrus_bitblt_rop_bkwd_src)
-	notify = 0;
-
     /* we have to flush all pending changes so that the copy
        is generated at the appropriate moment in time */
     if (notify)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYL4-0004vt-U2; Tue, 20 Oct 2015 14:56:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYL4-0004vf-7z
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:34 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	9A/1F-18886-12656265; Tue, 20 Oct 2015 14:56:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445352991!59955581!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10056 invoked from network); 20 Oct 2015 14:56:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:56:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYL1-0001kg-Hi
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYL1-0001wB-F5
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:31 +0000
Date: Tue, 20 Oct 2015 14:56:31 +0000
Message-Id: <E1ZoYL1-0001wB-F5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] cirrus_vga: fix division by 0
	for color expansion rop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd7c9bfa4955fa8c32bbaaa2b515ed2414ef9bc5
Author:     Aurelien Jarno <aurelien@aurel32.net>
AuthorDate: Tue Jan 4 21:58:24 2011 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    cirrus_vga: fix division by 0 for color expansion rop
    
    Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regression
    with Windows ME that leads to a division by 0 and a crash.
    
    It uses the color expansion rop with the source pitch set to 0. This is
    something allowed, as the manual explicitely says "When the source of
    color-expand data is display memory, the source pitch is ignored.".
    
    This patch fixes this regression by computing sx, sy and others
    variables only if they are going to be used later, that is for a plain
    copy ROP. It basically consists in moving code.
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 hw/cirrus_vga.c |   70 +++++++++++++++++++++++++++---------------------------
 1 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index d3bf4cf..e6c3893 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -754,46 +754,46 @@ static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
 
 static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
 {
-    int sx, sy;
-    int dx, dy;
-    int width, height;
-    int depth;
+    int sx = 0, sy = 0;
+    int dx = 0, dy = 0;
+    int depth = 0;
     int notify = 0;
 
-    depth = s->get_bpp((VGAState *)s) / 8;
-    s->get_resolution((VGAState *)s, &width, &height);
-
-    /* extra x, y */
-    sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
-    sy = (src / ABS(s->cirrus_blt_srcpitch));
-    dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
-    dy = (dst / ABS(s->cirrus_blt_dstpitch));
-
-    /* normalize width */
-    w /= depth;
-
-    /* if we're doing a backward copy, we have to adjust
-       our x/y to be the upper left corner (instead of the lower
-       right corner) */
-    if (s->cirrus_blt_dstpitch < 0) {
-	sx -= (s->cirrus_blt_width / depth) - 1;
-	dx -= (s->cirrus_blt_width / depth) - 1;
-	sy -= s->cirrus_blt_height - 1;
-	dy -= s->cirrus_blt_height - 1;
-    }
+    /* make sure to only copy if it's a plain copy ROP */
+    if (*s->cirrus_rop == cirrus_bitblt_rop_fwd_src ||
+        *s->cirrus_rop == cirrus_bitblt_rop_bkwd_src) {
+        int width, height;
+
+        depth = s->get_bpp((VGAState *)s) / 8;
+        s->get_resolution((VGAState *)s, &width, &height);
+
+        /* extra x, y */
+        sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
+        sy = (src / ABS(s->cirrus_blt_srcpitch));
+        dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
+        dy = (dst / ABS(s->cirrus_blt_dstpitch));
+
+        /* normalize width */
+        w /= depth;
+
+        /* if we're doing a backward copy, we have to adjust
+           our x/y to be the upper left corner (instead of the lower
+           right corner) */
+        if (s->cirrus_blt_dstpitch < 0) {
+            sx -= (s->cirrus_blt_width / depth) - 1;
+            dx -= (s->cirrus_blt_width / depth) - 1;
+            sy -= s->cirrus_blt_height - 1;
+            dy -= s->cirrus_blt_height - 1;
+        }
 
-    /* are we in the visible portion of memory? */
-    if (sx >= 0 && sy >= 0 && dx >= 0 && dy >= 0 &&
-	(sx + w) <= width && (sy + h) <= height &&
-	(dx + w) <= width && (dy + h) <= height) {
-	notify = 1;
+        /* are we in the visible portion of memory? */
+        if (sx >= 0 && sy >= 0 && dx >= 0 && dy >= 0 &&
+            (sx + w) <= width && (sy + h) <= height &&
+            (dx + w) <= width && (dy + h) <= height) {
+            notify = 1;
+        }
     }
 
-    /* make to sure only copy if it's a plain copy ROP */
-    if (*s->cirrus_rop != cirrus_bitblt_rop_fwd_src &&
-	*s->cirrus_rop != cirrus_bitblt_rop_bkwd_src)
-	notify = 0;
-
     /* we have to flush all pending changes so that the copy
        is generated at the appropriate moment in time */
     if (notify)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYLF-0004z3-0i; Tue, 20 Oct 2015 14:56:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLE-0004yn-KR
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:44 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	4C/70-10715-C2656265; Tue, 20 Oct 2015 14:56:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445353002!23950174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20263 invoked from network); 20 Oct 2015 14:56:43 -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;
	20 Oct 2015 14:56:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLC-0001ko-1E
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLB-0001xI-T5
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:41 +0000
Date: Tue, 20 Oct 2015 14:56:41 +0000
Message-Id: <E1ZoYLB-0001xI-T5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] ide: cancel dma operations on
	command abort or error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 56464b49335de2a452b8bff44effe72c2d00a8df
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Wed Dec 10 02:36:23 2014 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    ide: cancel dma operations on command abort or error
    
    Otherwise, a guest can cause Qemu to reuse an active aio structure.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 7b84d1b..3636611 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -919,8 +919,10 @@ static void ide_set_signature(IDEState *s)
     }
 }
 
+static void ide_dma_cancel(BMDMAState *bm);
 static inline void ide_abort_command(IDEState *s)
 {
+    if (s->bmdma) ide_dma_cancel(s->bmdma);
     s->status = READY_STAT | ERR_STAT;
     s->error = ABRT_ERR;
 }
@@ -1098,6 +1100,7 @@ static void dma_buf_commit(IDEState *s, int is_write)
 
 static void ide_dma_error(IDEState *s)
 {
+    if (s->bmdma) ide_dma_cancel(s->bmdma);
     ide_transfer_stop(s);
     s->error = ABRT_ERR;
     s->status = READY_STAT | ERR_STAT;
@@ -1230,7 +1233,7 @@ static void ide_read_dma_cb(void *opaque, int ret)
 	return;
     }
 
-    if (!s->bs) return; /* ouch! (see ide_flush_cb) */
+    if (!s || !s->bs) return; /* ouch! (see ide_dma_error & ide_flush_cb) */
 
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
@@ -1371,7 +1374,7 @@ static void ide_write_dma_cb(void *opaque, int ret)
             return;
     }
 
-    if (!s->bs) return; /* ouch! (see ide_flush_cb) */
+    if (!s || !s->bs) return; /* ouch! (see ide_dma_error & ide_flush_cb) */
 
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYLF-0004z3-0i; Tue, 20 Oct 2015 14:56:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLE-0004yn-KR
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:44 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	4C/70-10715-C2656265; Tue, 20 Oct 2015 14:56:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445353002!23950174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20263 invoked from network); 20 Oct 2015 14:56:43 -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;
	20 Oct 2015 14:56:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLC-0001ko-1E
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLB-0001xI-T5
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:41 +0000
Date: Tue, 20 Oct 2015 14:56:41 +0000
Message-Id: <E1ZoYLB-0001xI-T5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] ide: cancel dma operations on
	command abort or error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 56464b49335de2a452b8bff44effe72c2d00a8df
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Wed Dec 10 02:36:23 2014 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    ide: cancel dma operations on command abort or error
    
    Otherwise, a guest can cause Qemu to reuse an active aio structure.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 7b84d1b..3636611 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -919,8 +919,10 @@ static void ide_set_signature(IDEState *s)
     }
 }
 
+static void ide_dma_cancel(BMDMAState *bm);
 static inline void ide_abort_command(IDEState *s)
 {
+    if (s->bmdma) ide_dma_cancel(s->bmdma);
     s->status = READY_STAT | ERR_STAT;
     s->error = ABRT_ERR;
 }
@@ -1098,6 +1100,7 @@ static void dma_buf_commit(IDEState *s, int is_write)
 
 static void ide_dma_error(IDEState *s)
 {
+    if (s->bmdma) ide_dma_cancel(s->bmdma);
     ide_transfer_stop(s);
     s->error = ABRT_ERR;
     s->status = READY_STAT | ERR_STAT;
@@ -1230,7 +1233,7 @@ static void ide_read_dma_cb(void *opaque, int ret)
 	return;
     }
 
-    if (!s->bs) return; /* ouch! (see ide_flush_cb) */
+    if (!s || !s->bs) return; /* ouch! (see ide_dma_error & ide_flush_cb) */
 
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
@@ -1371,7 +1374,7 @@ static void ide_write_dma_cb(void *opaque, int ret)
             return;
     }
 
-    if (!s->bs) return; /* ouch! (see ide_flush_cb) */
+    if (!s || !s->bs) return; /* ouch! (see ide_dma_error & ide_flush_cb) */
 
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYLQ-00051F-3D; Tue, 20 Oct 2015 14:56: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 1ZoYLP-00050u-17
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:55 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	8E/FF-01753-63656265; Tue, 20 Oct 2015 14:56:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445353012!23799898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4955 invoked from network); 20 Oct 2015 14:56:53 -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;
	20 Oct 2015 14:56:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLM-0001kw-Ax
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLM-0001xf-93
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:52 +0000
Date: Tue, 20 Oct 2015 14:56:52 +0000
Message-Id: <E1ZoYLM-0001xf-93@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] dma: fix incorrect bh scheduling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9589b7b60719de9a8df7887a0c08f9813cd8c58d
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Thu Dec 11 04:18:02 2014 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    dma: fix incorrect bh scheduling
    
    The following 2 cases should be avoided:
    
      1. DMAAIOCB has been released but continue_after_map_failure
         schedules a bh for it.
      2. Multiple bh calls are schduled on the same DMAAIOCB.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 dma-helpers.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/dma-helpers.c b/dma-helpers.c
index 2a1621b..c9fbbd9 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -50,8 +50,14 @@ typedef struct {
     target_phys_addr_t sg_cur_byte;
     QEMUIOVector iov;
     QEMUBH *bh;
+    int in_use;
 } DMAAIOCB;
 
+static void dma_aio_cb_reset(DMAAIOCB *p)
+{
+    p->in_use = 0;
+}
+
 static void dma_bdrv_cb(void *opaque, int ret);
 
 static void reschedule_dma(void *opaque)
@@ -60,6 +66,10 @@ static void reschedule_dma(void *opaque)
 
     qemu_bh_delete(dbs->bh);
     dbs->bh = NULL;
+
+    if (!dbs->in_use)
+        return;
+
     dma_bdrv_cb(opaque, 0);
 }
 
@@ -67,7 +77,8 @@ static void continue_after_map_failure(void *opaque)
 {
     DMAAIOCB *dbs = (DMAAIOCB *)opaque;
 
-    dbs->bh = qemu_bh_new(reschedule_dma, dbs);
+    if (!dbs->bh)
+        dbs->bh = qemu_bh_new(reschedule_dma, dbs);
     qemu_bh_schedule(dbs->bh);
 }
 
@@ -97,6 +108,7 @@ void dma_bdrv_cb(void *opaque, int ret)
         dbs->common.cb(dbs->common.opaque, ret);
         qemu_iovec_destroy(&dbs->iov);
         qemu_aio_release(dbs);
+        dma_aio_cb_reset(dbs);
         return;
     }
 
@@ -129,6 +141,7 @@ void dma_bdrv_cb(void *opaque, int ret)
     if (!dbs->acb) {
         dma_bdrv_unmap(dbs);
         qemu_iovec_destroy(&dbs->iov);
+        dma_aio_cb_reset(dbs);
         return;
     }
 }
@@ -148,6 +161,7 @@ static BlockDriverAIOCB *dma_bdrv_io(
     dbs->sg_cur_byte = 0;
     dbs->is_write = is_write;
     dbs->bh = NULL;
+    dbs->in_use = 1;
     qemu_iovec_init(&dbs->iov, sg->nsg);
     dma_bdrv_cb(dbs, 0);
     if (!dbs->acb) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:56:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:56:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYLQ-00051F-3D; Tue, 20 Oct 2015 14:56: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 1ZoYLP-00050u-17
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:55 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	8E/FF-01753-63656265; Tue, 20 Oct 2015 14:56:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445353012!23799898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4955 invoked from network); 20 Oct 2015 14:56:53 -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;
	20 Oct 2015 14:56:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLM-0001kw-Ax
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLM-0001xf-93
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:56:52 +0000
Date: Tue, 20 Oct 2015 14:56:52 +0000
Message-Id: <E1ZoYLM-0001xf-93@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] dma: fix incorrect bh scheduling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9589b7b60719de9a8df7887a0c08f9813cd8c58d
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Thu Dec 11 04:18:02 2014 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    dma: fix incorrect bh scheduling
    
    The following 2 cases should be avoided:
    
      1. DMAAIOCB has been released but continue_after_map_failure
         schedules a bh for it.
      2. Multiple bh calls are schduled on the same DMAAIOCB.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 dma-helpers.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/dma-helpers.c b/dma-helpers.c
index 2a1621b..c9fbbd9 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -50,8 +50,14 @@ typedef struct {
     target_phys_addr_t sg_cur_byte;
     QEMUIOVector iov;
     QEMUBH *bh;
+    int in_use;
 } DMAAIOCB;
 
+static void dma_aio_cb_reset(DMAAIOCB *p)
+{
+    p->in_use = 0;
+}
+
 static void dma_bdrv_cb(void *opaque, int ret);
 
 static void reschedule_dma(void *opaque)
@@ -60,6 +66,10 @@ static void reschedule_dma(void *opaque)
 
     qemu_bh_delete(dbs->bh);
     dbs->bh = NULL;
+
+    if (!dbs->in_use)
+        return;
+
     dma_bdrv_cb(opaque, 0);
 }
 
@@ -67,7 +77,8 @@ static void continue_after_map_failure(void *opaque)
 {
     DMAAIOCB *dbs = (DMAAIOCB *)opaque;
 
-    dbs->bh = qemu_bh_new(reschedule_dma, dbs);
+    if (!dbs->bh)
+        dbs->bh = qemu_bh_new(reschedule_dma, dbs);
     qemu_bh_schedule(dbs->bh);
 }
 
@@ -97,6 +108,7 @@ void dma_bdrv_cb(void *opaque, int ret)
         dbs->common.cb(dbs->common.opaque, ret);
         qemu_iovec_destroy(&dbs->iov);
         qemu_aio_release(dbs);
+        dma_aio_cb_reset(dbs);
         return;
     }
 
@@ -129,6 +141,7 @@ void dma_bdrv_cb(void *opaque, int ret)
     if (!dbs->acb) {
         dma_bdrv_unmap(dbs);
         qemu_iovec_destroy(&dbs->iov);
+        dma_aio_cb_reset(dbs);
         return;
     }
 }
@@ -148,6 +161,7 @@ static BlockDriverAIOCB *dma_bdrv_io(
     dbs->sg_cur_byte = 0;
     dbs->is_write = is_write;
     dbs->bh = NULL;
+    dbs->in_use = 1;
     qemu_iovec_init(&dbs->iov, sg->nsg);
     dma_bdrv_cb(dbs, 0);
     if (!dbs->acb) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57: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 1ZoYLd-000535-61; Tue, 20 Oct 2015 14:57:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLc-00052x-3l
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:08 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	28/A9-25435-34656265; Tue, 20 Oct 2015 14:57:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445353025!59955762!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14987 invoked from network); 20 Oct 2015 14:57:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:57:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLW-0001lX-VY
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLW-0001yA-Jf
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:02 +0000
Date: Tue, 20 Oct 2015 14:57:02 +0000
Message-Id: <E1ZoYLW-0001yA-Jf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] cmdline: Parse -pciemulation
	before trying to use it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79398a2710be3e2cf228a23eb15cf9573ff9fe9b
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Thu Jan 8 06:14:37 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    cmdline: Parse -pciemulation before trying to use it
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vl.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/vl.c b/vl.c
index d21c3aa..67d9d86 100644
--- a/vl.c
+++ b/vl.c
@@ -5952,6 +5952,15 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
+#ifdef CONFIG_PASSTHROUGH
+    for (i = 0; i < nb_pci_emulation; i++) {
+        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
+            fprintf(stderr, "Warning: could not add PCI device %s\n",
+                    pci_emulation_config_text[i]);
+        }
+    }
+#endif
+
     machine->init(ram_size, vga_ram_size, boot_devices,
                   kernel_filename, kernel_cmdline, initrd_filename, cpu_model,
 		  direct_pci);
@@ -6068,15 +6077,6 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
-#ifdef CONFIG_PASSTHROUGH
-    for (i = 0; i < nb_pci_emulation; i++) {
-        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
-            fprintf(stderr, "Warning: could not add PCI device %s\n",
-                    pci_emulation_config_text[i]);
-        }
-    }
-#endif
-
     for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
         const char *devname = virtio_consoles[i];
         if (virtcon_hds[i] && devname) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57: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 1ZoYLd-000535-61; Tue, 20 Oct 2015 14:57:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLc-00052x-3l
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:08 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	28/A9-25435-34656265; Tue, 20 Oct 2015 14:57:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445353025!59955762!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14987 invoked from network); 20 Oct 2015 14:57:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:57:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLW-0001lX-VY
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLW-0001yA-Jf
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:02 +0000
Date: Tue, 20 Oct 2015 14:57:02 +0000
Message-Id: <E1ZoYLW-0001yA-Jf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] cmdline: Parse -pciemulation
	before trying to use it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79398a2710be3e2cf228a23eb15cf9573ff9fe9b
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Thu Jan 8 06:14:37 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    cmdline: Parse -pciemulation before trying to use it
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vl.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/vl.c b/vl.c
index d21c3aa..67d9d86 100644
--- a/vl.c
+++ b/vl.c
@@ -5952,6 +5952,15 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
+#ifdef CONFIG_PASSTHROUGH
+    for (i = 0; i < nb_pci_emulation; i++) {
+        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
+            fprintf(stderr, "Warning: could not add PCI device %s\n",
+                    pci_emulation_config_text[i]);
+        }
+    }
+#endif
+
     machine->init(ram_size, vga_ram_size, boot_devices,
                   kernel_filename, kernel_cmdline, initrd_filename, cpu_model,
 		  direct_pci);
@@ -6068,15 +6077,6 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
-#ifdef CONFIG_PASSTHROUGH
-    for (i = 0; i < nb_pci_emulation; i++) {
-        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
-            fprintf(stderr, "Warning: could not add PCI device %s\n",
-                    pci_emulation_config_text[i]);
-        }
-    }
-#endif
-
     for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
         const char *devname = virtio_consoles[i];
         if (virtcon_hds[i] && devname) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57: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 1ZoYLn-00055G-8U; Tue, 20 Oct 2015 14:57: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 1ZoYLm-00054v-8Q
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:18 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	88/22-29649-D4656265; Tue, 20 Oct 2015 14:57:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445353036!23800024!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8738 invoked from network); 20 Oct 2015 14:57:16 -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;
	20 Oct 2015 14:57:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLj-0001lf-RS
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLj-0001yW-PO
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:15 +0000
Date: Tue, 20 Oct 2015 14:57:15 +0000
Message-Id: <E1ZoYLj-0001yW-PO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] smbios: Don't allocate smbus
	eeprom buffer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1f89c26126df966894b1e0746bfa56267ae1478
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:32:08 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    smbios: Don't allocate smbus eeprom buffer
    
    smbus_eeprom_device_init() has been disabled since 2007.  The #define turns
    the actual function call into a comma expression with no effect.
    
    Removing the leaked allocation also makes Valgrind happier.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-ID: 1090387
---
 hw/pc.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 3e33694..7359338 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -79,7 +79,6 @@ static void xen_relocator_hook(target_phys_addr_t *prot_addr_upd,
                                uint16_t protocol,
 			       const uint8_t header[], int kernel_size,
 			       target_phys_addr_t real_addr, int real_size);
-#define smbus_eeprom_device_init (void)
 
 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
 {
@@ -1135,17 +1134,8 @@ vga_bios_error:
     }
 
     if (pci_enabled && acpi_enabled) {
-        uint8_t *eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */
-        i2c_bus *smbus;
-
         /* TODO: Populate SPD eeprom data.  */
-        smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
-
-	if (smbus) {
-	    for (i = 0; i < 8; i++) {
-		smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256));
-	    }
-        }
+        piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
     }
 
     if (i440fx_state) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57: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 1ZoYLn-00055G-8U; Tue, 20 Oct 2015 14:57: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 1ZoYLm-00054v-8Q
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:18 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	88/22-29649-D4656265; Tue, 20 Oct 2015 14:57:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445353036!23800024!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8738 invoked from network); 20 Oct 2015 14:57:16 -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;
	20 Oct 2015 14:57:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLj-0001lf-RS
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLj-0001yW-PO
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:15 +0000
Date: Tue, 20 Oct 2015 14:57:15 +0000
Message-Id: <E1ZoYLj-0001yW-PO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] smbios: Don't allocate smbus
	eeprom buffer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1f89c26126df966894b1e0746bfa56267ae1478
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:32:08 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    smbios: Don't allocate smbus eeprom buffer
    
    smbus_eeprom_device_init() has been disabled since 2007.  The #define turns
    the actual function call into a comma expression with no effect.
    
    Removing the leaked allocation also makes Valgrind happier.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-ID: 1090387
---
 hw/pc.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 3e33694..7359338 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -79,7 +79,6 @@ static void xen_relocator_hook(target_phys_addr_t *prot_addr_upd,
                                uint16_t protocol,
 			       const uint8_t header[], int kernel_size,
 			       target_phys_addr_t real_addr, int real_size);
-#define smbus_eeprom_device_init (void)
 
 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
 {
@@ -1135,17 +1134,8 @@ vga_bios_error:
     }
 
     if (pci_enabled && acpi_enabled) {
-        uint8_t *eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */
-        i2c_bus *smbus;
-
         /* TODO: Populate SPD eeprom data.  */
-        smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
-
-	if (smbus) {
-	    for (i = 0; i < 8; i++) {
-		smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256));
-	    }
-        }
+        piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
     }
 
     if (i440fx_state) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57: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 1ZoYLy-00057N-B1; Tue, 20 Oct 2015 14:57: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 1ZoYLw-00057E-Tk
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:29 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	2C/3B-03763-85656265; Tue, 20 Oct 2015 14:57:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1445353046!55053272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15475 invoked from network); 20 Oct 2015 14:57:27 -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;
	20 Oct 2015 14:57:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLu-0001lk-7X
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLu-0001yz-3n
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:26 +0000
Date: Tue, 20 Oct 2015 14:57:26 +0000
Message-Id: <E1ZoYLu-0001yz-3n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] pic: Don't allocate irq buffers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c36a4e522bfa615f38fbf71d7da483fefc8900f2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:36:08 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    pic: Don't allocate irq buffers
    
    i8259_init() doesn't inspect its argument at all, causing the allocation to
    be leaked and never used.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/pc.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 7359338..09b4af4 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -801,7 +801,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
     PCIBus *pci_bus;
     int piix3_devfn = -1;
     CPUState *env;
-    qemu_irq *cpu_irq;
     qemu_irq *i8259;
     int index;
     BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
@@ -970,8 +969,7 @@ vga_bios_error:
 
     bochs_bios_init();
 
-    cpu_irq = qemu_allocate_irqs(pic_irq_request, NULL, 1);
-    i8259 = i8259_init(cpu_irq[0]);
+    i8259 = i8259_init(NULL);
     ferr_irq = i8259[13];
 
     if (pci_enabled) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57: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 1ZoYLy-00057N-B1; Tue, 20 Oct 2015 14:57: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 1ZoYLw-00057E-Tk
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:29 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	2C/3B-03763-85656265; Tue, 20 Oct 2015 14:57:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1445353046!55053272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15475 invoked from network); 20 Oct 2015 14:57:27 -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;
	20 Oct 2015 14:57:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLu-0001lk-7X
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYLu-0001yz-3n
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:26 +0000
Date: Tue, 20 Oct 2015 14:57:26 +0000
Message-Id: <E1ZoYLu-0001yz-3n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] pic: Don't allocate irq buffers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c36a4e522bfa615f38fbf71d7da483fefc8900f2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:36:08 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    pic: Don't allocate irq buffers
    
    i8259_init() doesn't inspect its argument at all, causing the allocation to
    be leaked and never used.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/pc.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 7359338..09b4af4 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -801,7 +801,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
     PCIBus *pci_bus;
     int piix3_devfn = -1;
     CPUState *env;
-    qemu_irq *cpu_irq;
     qemu_irq *i8259;
     int index;
     BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
@@ -970,8 +969,7 @@ vga_bios_error:
 
     bochs_bios_init();
 
-    cpu_irq = qemu_allocate_irqs(pic_irq_request, NULL, 1);
-    i8259 = i8259_init(cpu_irq[0]);
+    i8259 = i8259_init(NULL);
     ferr_irq = i8259[13];
 
     if (pci_enabled) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57: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 1ZoYM8-00058q-DT; Tue, 20 Oct 2015 14:57: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 1ZoYM6-00058d-VE
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:39 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	62/B8-03819-26656265; Tue, 20 Oct 2015 14:57:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1445353056!43715060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8783 invoked from network); 20 Oct 2015 14:57:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:57:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYM4-0001lv-JG
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYM4-0001zN-Fa
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:36 +0000
Date: Tue, 20 Oct 2015 14:57:36 +0000
Message-Id: <E1ZoYM4-0001zN-Fa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] signal: Don't use uninitalised
	sival_ptr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b81761be03ac017bdb1a212e4b59de545853d2f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:35:45 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    signal: Don't use uninitalised sival_ptr
    
    In 64bit builds, setting sival_int to 0 doesn't clear the upper half of the
    sival_ptr pointer.  Valgrind does not like this.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vl.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 67d9d86..c864e7d 100644
--- a/vl.c
+++ b/vl.c
@@ -1568,7 +1568,7 @@ static void rtc_stop_timer(struct qemu_alarm_timer *t)
 
 static int dynticks_start_timer(struct qemu_alarm_timer *t)
 {
-    struct sigevent ev;
+    struct sigevent ev = { { 0 } };
     timer_t host_timer;
     struct sigaction act;
 
@@ -1578,7 +1578,6 @@ static int dynticks_start_timer(struct qemu_alarm_timer *t)
 
     sigaction(SIGALRM, &act, NULL);
 
-    ev.sigev_value.sival_int = 0;
     ev.sigev_notify = SIGEV_SIGNAL;
     ev.sigev_signo = SIGALRM;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57: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 1ZoYM8-00058q-DT; Tue, 20 Oct 2015 14:57: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 1ZoYM6-00058d-VE
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:39 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	62/B8-03819-26656265; Tue, 20 Oct 2015 14:57:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1445353056!43715060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8783 invoked from network); 20 Oct 2015 14:57:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:57:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYM4-0001lv-JG
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYM4-0001zN-Fa
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:36 +0000
Date: Tue, 20 Oct 2015 14:57:36 +0000
Message-Id: <E1ZoYM4-0001zN-Fa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] signal: Don't use uninitalised
	sival_ptr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b81761be03ac017bdb1a212e4b59de545853d2f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:35:45 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    signal: Don't use uninitalised sival_ptr
    
    In 64bit builds, setting sival_int to 0 doesn't clear the upper half of the
    sival_ptr pointer.  Valgrind does not like this.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vl.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 67d9d86..c864e7d 100644
--- a/vl.c
+++ b/vl.c
@@ -1568,7 +1568,7 @@ static void rtc_stop_timer(struct qemu_alarm_timer *t)
 
 static int dynticks_start_timer(struct qemu_alarm_timer *t)
 {
-    struct sigevent ev;
+    struct sigevent ev = { { 0 } };
     timer_t host_timer;
     struct sigaction act;
 
@@ -1578,7 +1578,6 @@ static int dynticks_start_timer(struct qemu_alarm_timer *t)
 
     sigaction(SIGALRM, &act, NULL);
 
-    ev.sigev_value.sival_int = 0;
     ev.sigev_notify = SIGEV_SIGNAL;
     ev.sigev_signo = SIGALRM;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYMJ-0005B5-G2; Tue, 20 Oct 2015 14:57:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMI-0005Av-3Y
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:50 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	BC/56-32615-C6656265; Tue, 20 Oct 2015 14:57:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1445353067!43687815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1951 invoked from network); 20 Oct 2015 14:57:48 -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;
	20 Oct 2015 14:57:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMF-0001m3-3O
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYME-00020f-UV
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:46 +0000
Date: Tue, 20 Oct 2015 14:57:46 +0000
Message-Id: <E1ZoYME-00020f-UV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] hw/msmouse.c: Fix
	deref_after_free and double free
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4d48935c97839337f6aa8b2bb944e92bb9909df
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Mon Mar 17 05:37:49 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/msmouse.c: Fix deref_after_free and double free
    
    msmouse_chr_close is only pointed by chr->chr_close in qemu_chr_close
    function. After calling chr->chr_close, chr will be freed. So we don't
    need to free it again here.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    (defect not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/msmouse.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/msmouse.c b/hw/msmouse.c
index 69356a5..2d2703b 100644
--- a/hw/msmouse.c
+++ b/hw/msmouse.c
@@ -61,7 +61,6 @@ static int msmouse_chr_write (struct CharDriverState *s, const uint8_t *buf, int
 
 static void msmouse_chr_close (struct CharDriverState *chr)
 {
-    qemu_free (chr);
 }
 
 CharDriverState *qemu_chr_open_msmouse(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:57:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:57:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYMJ-0005B5-G2; Tue, 20 Oct 2015 14:57:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMI-0005Av-3Y
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:50 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	BC/56-32615-C6656265; Tue, 20 Oct 2015 14:57:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1445353067!43687815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1951 invoked from network); 20 Oct 2015 14:57:48 -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;
	20 Oct 2015 14:57:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMF-0001m3-3O
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYME-00020f-UV
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:46 +0000
Date: Tue, 20 Oct 2015 14:57:46 +0000
Message-Id: <E1ZoYME-00020f-UV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] hw/msmouse.c: Fix
	deref_after_free and double free
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4d48935c97839337f6aa8b2bb944e92bb9909df
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Mon Mar 17 05:37:49 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/msmouse.c: Fix deref_after_free and double free
    
    msmouse_chr_close is only pointed by chr->chr_close in qemu_chr_close
    function. After calling chr->chr_close, chr will be freed. So we don't
    need to free it again here.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    (defect not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/msmouse.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/msmouse.c b/hw/msmouse.c
index 69356a5..2d2703b 100644
--- a/hw/msmouse.c
+++ b/hw/msmouse.c
@@ -61,7 +61,6 @@ static int msmouse_chr_write (struct CharDriverState *s, const uint8_t *buf, int
 
 static void msmouse_chr_close (struct CharDriverState *chr)
 {
-    qemu_free (chr);
 }
 
 CharDriverState *qemu_chr_open_msmouse(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58: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 1ZoYMS-0005Cf-KU; Tue, 20 Oct 2015 14:58: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 1ZoYMR-0005CT-PV
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:59 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	51/8B-25435-77656265; Tue, 20 Oct 2015 14:57:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1445353077!59981049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25324 invoked from network); 20 Oct 2015 14:57:58 -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;
	20 Oct 2015 14:57:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMP-0001mB-Eo
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMP-000213-Bz
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:57 +0000
Date: Tue, 20 Oct 2015 14:57:57 +0000
Message-Id: <E1ZoYMP-000213-Bz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] readline: fix memory corruption
	when adding history
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b10783fe24c7c5f22320032e0d4da5aab9da572
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 09:50:41 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    readline: fix memory corruption when adding history
    
    idx can be down to 0, so TERM_MAX_CMDS-idx+1 could be TERM_MAX_CMDS+1, which
    exceeds the size of term_history.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055739
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 readline.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/readline.c b/readline.c
index 8572841..4b68726 100644
--- a/readline.c
+++ b/readline.c
@@ -267,7 +267,7 @@ static void term_hist_add(const char *cmdline)
 	    new_entry = hist_entry;
 	    /* Put this entry at the end of history */
 	    memmove(&term_history[idx], &term_history[idx + 1],
-		    (TERM_MAX_CMDS - idx + 1) * sizeof(char *));
+		    (TERM_MAX_CMDS - (idx + 1)) * sizeof(char *));
 	    term_history[TERM_MAX_CMDS - 1] = NULL;
 	    for (; idx < TERM_MAX_CMDS; idx++) {
 		if (term_history[idx] == NULL)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58: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 1ZoYMS-0005Cf-KU; Tue, 20 Oct 2015 14:58: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 1ZoYMR-0005CT-PV
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:59 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	51/8B-25435-77656265; Tue, 20 Oct 2015 14:57:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1445353077!59981049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25324 invoked from network); 20 Oct 2015 14:57:58 -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;
	20 Oct 2015 14:57:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMP-0001mB-Eo
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMP-000213-Bz
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:57:57 +0000
Date: Tue, 20 Oct 2015 14:57:57 +0000
Message-Id: <E1ZoYMP-000213-Bz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] readline: fix memory corruption
	when adding history
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b10783fe24c7c5f22320032e0d4da5aab9da572
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 09:50:41 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    readline: fix memory corruption when adding history
    
    idx can be down to 0, so TERM_MAX_CMDS-idx+1 could be TERM_MAX_CMDS+1, which
    exceeds the size of term_history.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055739
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 readline.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/readline.c b/readline.c
index 8572841..4b68726 100644
--- a/readline.c
+++ b/readline.c
@@ -267,7 +267,7 @@ static void term_hist_add(const char *cmdline)
 	    new_entry = hist_entry;
 	    /* Put this entry at the end of history */
 	    memmove(&term_history[idx], &term_history[idx + 1],
-		    (TERM_MAX_CMDS - idx + 1) * sizeof(char *));
+		    (TERM_MAX_CMDS - (idx + 1)) * sizeof(char *));
 	    term_history[TERM_MAX_CMDS - 1] = NULL;
 	    for (; idx < TERM_MAX_CMDS; idx++) {
 		if (term_history[idx] == NULL)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYMd-0005EC-N9; Tue, 20 Oct 2015 14:58:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMc-0005E1-LT
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:10 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	62/B4-29649-18656265; Tue, 20 Oct 2015 14:58:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445353088!50599291!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13116 invoked from network); 20 Oct 2015 14:58:09 -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;
	20 Oct 2015 14:58:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMa-0001mm-Bw
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMZ-00021b-Oa
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:08 +0000
Date: Tue, 20 Oct 2015 14:58:07 +0000
Message-Id: <E1ZoYMZ-00021b-Oa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-cow: don't close cow_fd
	twice on error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04ffc2f665cc0dd85f24274c696708dc3bc93156
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:03:40 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-cow: don't close cow_fd twice on error
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1056200
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-cow.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/block-cow.c b/block-cow.c
index 777d8a5..9ad0a32 100644
--- a/block-cow.c
+++ b/block-cow.c
@@ -224,7 +224,6 @@ static int cow_create(const char *filename, int64_t image_sectors,
 
         fd = open(image_filename, O_RDONLY | O_BINARY);
         if (fd < 0) {
-            close(cow_fd);
             goto mtime_fail;
         }
         if (fstat(fd, &st) != 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYMd-0005EC-N9; Tue, 20 Oct 2015 14:58:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMc-0005E1-LT
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:10 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	62/B4-29649-18656265; Tue, 20 Oct 2015 14:58:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445353088!50599291!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13116 invoked from network); 20 Oct 2015 14:58:09 -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;
	20 Oct 2015 14:58:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMa-0001mm-Bw
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMZ-00021b-Oa
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:08 +0000
Date: Tue, 20 Oct 2015 14:58:07 +0000
Message-Id: <E1ZoYMZ-00021b-Oa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-cow: don't close cow_fd
	twice on error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04ffc2f665cc0dd85f24274c696708dc3bc93156
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:03:40 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-cow: don't close cow_fd twice on error
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1056200
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-cow.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/block-cow.c b/block-cow.c
index 777d8a5..9ad0a32 100644
--- a/block-cow.c
+++ b/block-cow.c
@@ -224,7 +224,6 @@ static int cow_create(const char *filename, int64_t image_sectors,
 
         fd = open(image_filename, O_RDONLY | O_BINARY);
         if (fd < 0) {
-            close(cow_fd);
             goto mtime_fail;
         }
         if (fstat(fd, &st) != 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58: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 1ZoYMo-0005Fn-Pf; Tue, 20 Oct 2015 14:58:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMn-0005FV-3z
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:21 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	34/45-29649-C8656265; Tue, 20 Oct 2015 14:58:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445353098!22205942!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13557 invoked from network); 20 Oct 2015 14:58:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:58:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMk-0001mu-Nq
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMk-00021y-Jj
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:18 +0000
Date: Tue, 20 Oct 2015 14:58:18 +0000
Message-Id: <E1ZoYMk-00021y-Jj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] console: Avoid overrunning the
	dmask arrays
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec5080d57c87e1ace8d76e12261ce660594516f8
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:11:21 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    console: Avoid overrunning the dmask arrays
    
    The valide range of font_data should be [0, 0xFF].
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 console.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/console.c b/console.c
index 9984d6f..d4f1ad0 100644
--- a/console.c
+++ b/console.c
@@ -421,7 +421,8 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
 {
     uint8_t *d;
     const uint8_t *font_ptr;
-    unsigned int font_data, linesize, xorcol, bpp;
+    uint8_t font_data;
+    unsigned int linesize, xorcol, bpp;
     int i;
     unsigned int fgcol, bgcol;
 
@@ -450,7 +451,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
             font_data = *font_ptr++;
             if (t_attrib->uline
                 && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (dmask16[(font_data >> 4)] & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (dmask16[(font_data >> 0) & 0xf] & xorcol) ^ bgcol;
@@ -463,7 +464,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
             font_data = *font_ptr++;
             if (t_attrib->uline
                 && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (dmask4[(font_data >> 6)] & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (dmask4[(font_data >> 4) & 3] & xorcol) ^ bgcol;
@@ -476,7 +477,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
         for(i = 0; i < FONT_HEIGHT; i++) {
             font_data = *font_ptr++;
             if (t_attrib->uline && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (-((font_data >> 7)) & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (-((font_data >> 6) & 1) & xorcol) ^ bgcol;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58: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 1ZoYMo-0005Fn-Pf; Tue, 20 Oct 2015 14:58:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMn-0005FV-3z
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:21 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	34/45-29649-C8656265; Tue, 20 Oct 2015 14:58:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445353098!22205942!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13557 invoked from network); 20 Oct 2015 14:58:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:58:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMk-0001mu-Nq
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMk-00021y-Jj
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:18 +0000
Date: Tue, 20 Oct 2015 14:58:18 +0000
Message-Id: <E1ZoYMk-00021y-Jj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] console: Avoid overrunning the
	dmask arrays
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec5080d57c87e1ace8d76e12261ce660594516f8
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:11:21 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    console: Avoid overrunning the dmask arrays
    
    The valide range of font_data should be [0, 0xFF].
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 console.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/console.c b/console.c
index 9984d6f..d4f1ad0 100644
--- a/console.c
+++ b/console.c
@@ -421,7 +421,8 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
 {
     uint8_t *d;
     const uint8_t *font_ptr;
-    unsigned int font_data, linesize, xorcol, bpp;
+    uint8_t font_data;
+    unsigned int linesize, xorcol, bpp;
     int i;
     unsigned int fgcol, bgcol;
 
@@ -450,7 +451,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
             font_data = *font_ptr++;
             if (t_attrib->uline
                 && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (dmask16[(font_data >> 4)] & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (dmask16[(font_data >> 0) & 0xf] & xorcol) ^ bgcol;
@@ -463,7 +464,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
             font_data = *font_ptr++;
             if (t_attrib->uline
                 && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (dmask4[(font_data >> 6)] & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (dmask4[(font_data >> 4) & 3] & xorcol) ^ bgcol;
@@ -476,7 +477,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
         for(i = 0; i < FONT_HEIGHT; i++) {
             font_data = *font_ptr++;
             if (t_attrib->uline && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (-((font_data >> 7)) & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (-((font_data >> 6) & 1) & xorcol) ^ bgcol;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYMy-0005MW-SS; Tue, 20 Oct 2015 14:58: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 1ZoYMx-0005Kf-GR
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:31 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	B1/5A-05269-69656265; Tue, 20 Oct 2015 14:58:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445353109!54987492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13493 invoked from network); 20 Oct 2015 14:58:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:58:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMv-0001n5-5h
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMv-00022K-1v
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:29 +0000
Date: Tue, 20 Oct 2015 14:58:29 +0000
Message-Id: <E1ZoYMv-00022K-1v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] hw/device-hotplug: fix test of
	drive_add() return
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c69a0bb9e3b96bb041abf221323599976a4760c
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:16:42 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/device-hotplug: fix test of drive_add() return
    
    drive_opt_idx could be -1 in case error occurs inside drive_add, so the error
    check should be "if (drive_opt_idx < 0)" instead of original
    "if (!drive_opt_idx)".
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055574
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/device-hotplug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c
index 3bdc048..97d3529 100644
--- a/hw/device-hotplug.c
+++ b/hw/device-hotplug.c
@@ -34,7 +34,7 @@ int add_init_drive(const char *opts)
     int ret = -1;
 
     drive_opt_idx = drive_add(NULL, "%s", opts);
-    if (!drive_opt_idx)
+    if (drive_opt_idx < 0)
         return ret;
 
     drive_idx = drive_init(&drives_opt[drive_opt_idx], 0, current_machine);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYMy-0005MW-SS; Tue, 20 Oct 2015 14:58: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 1ZoYMx-0005Kf-GR
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:31 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	B1/5A-05269-69656265; Tue, 20 Oct 2015 14:58:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1445353109!54987492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13493 invoked from network); 20 Oct 2015 14:58:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:58:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMv-0001n5-5h
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYMv-00022K-1v
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:29 +0000
Date: Tue, 20 Oct 2015 14:58:29 +0000
Message-Id: <E1ZoYMv-00022K-1v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] hw/device-hotplug: fix test of
	drive_add() return
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c69a0bb9e3b96bb041abf221323599976a4760c
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:16:42 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/device-hotplug: fix test of drive_add() return
    
    drive_opt_idx could be -1 in case error occurs inside drive_add, so the error
    check should be "if (drive_opt_idx < 0)" instead of original
    "if (!drive_opt_idx)".
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055574
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/device-hotplug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c
index 3bdc048..97d3529 100644
--- a/hw/device-hotplug.c
+++ b/hw/device-hotplug.c
@@ -34,7 +34,7 @@ int add_init_drive(const char *opts)
     int ret = -1;
 
     drive_opt_idx = drive_add(NULL, "%s", opts);
-    if (!drive_opt_idx)
+    if (drive_opt_idx < 0)
         return ret;
 
     drive_idx = drive_init(&drives_opt[drive_opt_idx], 0, current_machine);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58: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 1ZoYN9-0005RS-V5; Tue, 20 Oct 2015 14:58:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYN8-0005RD-KV
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:42 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	90/B0-18744-1A656265; Tue, 20 Oct 2015 14:58:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1445353119!33388427!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13186 invoked from network); 20 Oct 2015 14:58:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:58:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYN5-0001nD-Jy
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYN5-00023V-EW
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:39 +0000
Date: Tue, 20 Oct 2015 14:58:39 +0000
Message-Id: <E1ZoYN5-00023V-EW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-char: fix memory leak in
	qemu_char_open_pty()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6af340b9e32e78fd980d46d939aa0939f51ebd4
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:27:36 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    qemu-char: fix memory leak in qemu_char_open_pty()
    
    The momery pointed by s and chr could be leaked if openpty return a value
    less then 0.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055926 1055927
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 qemu-char.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 324ed16..f62a6af 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -932,6 +932,8 @@ static CharDriverState *qemu_chr_open_pty(void)
     s = qemu_mallocz(sizeof(PtyCharDriver));
 
     if (openpty(&s->fd, &slave_fd, pty_name, NULL, NULL) < 0) {
+        qemu_free(s);
+        qemu_free(chr);
         return NULL;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58: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 1ZoYN9-0005RS-V5; Tue, 20 Oct 2015 14:58:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYN8-0005RD-KV
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:42 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	90/B0-18744-1A656265; Tue, 20 Oct 2015 14:58:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1445353119!33388427!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13186 invoked from network); 20 Oct 2015 14:58:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:58:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYN5-0001nD-Jy
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYN5-00023V-EW
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:39 +0000
Date: Tue, 20 Oct 2015 14:58:39 +0000
Message-Id: <E1ZoYN5-00023V-EW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-char: fix memory leak in
	qemu_char_open_pty()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6af340b9e32e78fd980d46d939aa0939f51ebd4
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:27:36 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    qemu-char: fix memory leak in qemu_char_open_pty()
    
    The momery pointed by s and chr could be leaked if openpty return a value
    less then 0.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055926 1055927
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 qemu-char.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 324ed16..f62a6af 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -932,6 +932,8 @@ static CharDriverState *qemu_chr_open_pty(void)
     s = qemu_mallocz(sizeof(PtyCharDriver));
 
     if (openpty(&s->fd, &slave_fd, pty_name, NULL, NULL) < 0) {
+        qemu_free(s);
+        qemu_free(chr);
         return NULL;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58: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 1ZoYNK-0005TM-1L; Tue, 20 Oct 2015 14:58:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNI-0005Sg-FU
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:52 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	5E/16-24494-BA656265; Tue, 20 Oct 2015 14:58:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1445353130!20225748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19569 invoked from network); 20 Oct 2015 14:58:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:58:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNG-0001nL-3j
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNF-00023t-Sh
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:49 +0000
Date: Tue, 20 Oct 2015 14:58:49 +0000
Message-Id: <E1ZoYNF-00023t-Sh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] hw/ide: fix memory leak from
	qemu_allocate_irqs()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18cb4bf3298c1ef21de1f320dda00152a3fa2453
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:10:14 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/ide: fix memory leak from qemu_allocate_irqs()
    
    qemu_allocate_irqs would return an array of irqs, not store the allocated
    array pointer, and subsequently leak it.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    2 +-
 hw/irq.c |   18 +++++++++++++++++-
 hw/irq.h |    4 ++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 3636611..4c30edd 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -4793,7 +4793,7 @@ struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv)
     md->card.cis = dscm1xxxx_cis;
     md->card.cis_len = sizeof(dscm1xxxx_cis);
 
-    ide_init2(md->ide, bdrv, 0, qemu_allocate_irqs(md_set_irq, md, 1)[0]);
+    ide_init2(md->ide, bdrv, 0, qemu_allocate_irq(md_set_irq, md));
     md->ide->is_cf = 1;
     md->ide->mdata_size = METADATA_SIZE;
     md->ide->mdata_storage = (uint8_t *) qemu_mallocz(METADATA_SIZE);
diff --git a/hw/irq.c b/hw/irq.c
index 7703f62..c7c4864 100644
--- a/hw/irq.c
+++ b/hw/irq.c
@@ -38,6 +38,22 @@ void qemu_set_irq(qemu_irq irq, int level)
     irq->handler(irq->opaque, irq->n, level);
 }
 
+qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque)
+{
+    struct IRQState *irq;
+
+    irq = (struct IRQState *)qemu_mallocz(sizeof(struct IRQState));
+    irq->handler = handler;
+    irq->opaque = opaque;
+    irq->n = 0;
+    return irq;
+}
+
+void qemu_free_irq(qemu_irq irq)
+{
+    qemu_free(irq);
+}
+
 qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n)
 {
     qemu_irq *s;
@@ -73,5 +89,5 @@ qemu_irq qemu_irq_invert(qemu_irq irq)
 {
     /* The default state for IRQs is low, so raise the output now.  */
     qemu_irq_raise(irq);
-    return qemu_allocate_irqs(qemu_notirq, irq, 1)[0];
+    return qemu_allocate_irq(qemu_notirq, irq);
 }
diff --git a/hw/irq.h b/hw/irq.h
index 5daae44..da34ae3 100644
--- a/hw/irq.h
+++ b/hw/irq.h
@@ -25,6 +25,10 @@ static inline void qemu_irq_pulse(qemu_irq irq)
     qemu_set_irq(irq, 0);
 }
 
+/* Returns one IRQ.  */
+qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque);
+void qemu_free_irq(qemu_irq irq);
+
 /* Returns an array of N IRQs.  */
 qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n);
 void qemu_free_irqs(qemu_irq *s);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:58:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:58: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 1ZoYNK-0005TM-1L; Tue, 20 Oct 2015 14:58:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNI-0005Sg-FU
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:52 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	5E/16-24494-BA656265; Tue, 20 Oct 2015 14:58:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1445353130!20225748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19569 invoked from network); 20 Oct 2015 14:58:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:58:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNG-0001nL-3j
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNF-00023t-Sh
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:58:49 +0000
Date: Tue, 20 Oct 2015 14:58:49 +0000
Message-Id: <E1ZoYNF-00023t-Sh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] hw/ide: fix memory leak from
	qemu_allocate_irqs()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18cb4bf3298c1ef21de1f320dda00152a3fa2453
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:10:14 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/ide: fix memory leak from qemu_allocate_irqs()
    
    qemu_allocate_irqs would return an array of irqs, not store the allocated
    array pointer, and subsequently leak it.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    2 +-
 hw/irq.c |   18 +++++++++++++++++-
 hw/irq.h |    4 ++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 3636611..4c30edd 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -4793,7 +4793,7 @@ struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv)
     md->card.cis = dscm1xxxx_cis;
     md->card.cis_len = sizeof(dscm1xxxx_cis);
 
-    ide_init2(md->ide, bdrv, 0, qemu_allocate_irqs(md_set_irq, md, 1)[0]);
+    ide_init2(md->ide, bdrv, 0, qemu_allocate_irq(md_set_irq, md));
     md->ide->is_cf = 1;
     md->ide->mdata_size = METADATA_SIZE;
     md->ide->mdata_storage = (uint8_t *) qemu_mallocz(METADATA_SIZE);
diff --git a/hw/irq.c b/hw/irq.c
index 7703f62..c7c4864 100644
--- a/hw/irq.c
+++ b/hw/irq.c
@@ -38,6 +38,22 @@ void qemu_set_irq(qemu_irq irq, int level)
     irq->handler(irq->opaque, irq->n, level);
 }
 
+qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque)
+{
+    struct IRQState *irq;
+
+    irq = (struct IRQState *)qemu_mallocz(sizeof(struct IRQState));
+    irq->handler = handler;
+    irq->opaque = opaque;
+    irq->n = 0;
+    return irq;
+}
+
+void qemu_free_irq(qemu_irq irq)
+{
+    qemu_free(irq);
+}
+
 qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n)
 {
     qemu_irq *s;
@@ -73,5 +89,5 @@ qemu_irq qemu_irq_invert(qemu_irq irq)
 {
     /* The default state for IRQs is low, so raise the output now.  */
     qemu_irq_raise(irq);
-    return qemu_allocate_irqs(qemu_notirq, irq, 1)[0];
+    return qemu_allocate_irq(qemu_notirq, irq);
 }
diff --git a/hw/irq.h b/hw/irq.h
index 5daae44..da34ae3 100644
--- a/hw/irq.h
+++ b/hw/irq.h
@@ -25,6 +25,10 @@ static inline void qemu_irq_pulse(qemu_irq irq)
     qemu_set_irq(irq, 0);
 }
 
+/* Returns one IRQ.  */
+qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque);
+void qemu_free_irq(qemu_irq irq);
+
 /* Returns an array of N IRQs.  */
 qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n);
 void qemu_free_irqs(qemu_irq *s);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYNU-0005W0-45; Tue, 20 Oct 2015 14:59: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 1ZoYNS-0005Vn-N9
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:02 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	1D/F2-31069-5B656265; Tue, 20 Oct 2015 14:59:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1445353140!54979619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15628 invoked from network); 20 Oct 2015 14:59:01 -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;
	20 Oct 2015 14:59:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNQ-0001nT-F5
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNQ-00024F-Cr
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:00 +0000
Date: Tue, 20 Oct 2015 14:59:00 +0000
Message-Id: <E1ZoYNQ-00024F-Cr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] net: don't leak an fd after an
	error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1b6594ba444ce418fd183bedeed179ace42dab1
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:31:06 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    net: don't leak an fd after an error
    
    fd will be leaked if launch_script failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055925
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index 720027c..f3887a7 100644
--- a/net.c
+++ b/net.c
@@ -1049,8 +1049,10 @@ static int net_tap_init(VLANState *vlan, const char *model,
     if (!setup_script || !strcmp(setup_script, "no"))
         setup_script = "";
     if (setup_script[0] != '\0') {
-	if (launch_script(setup_script, ifname, script_arg, fd))
+	if (launch_script(setup_script, ifname, script_arg, fd)) {
+	    close(fd);
 	    return -1;
+	}
     }
     s = net_tap_fd_init(vlan, model, name, fd);
     if (!s)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYNU-0005W0-45; Tue, 20 Oct 2015 14:59: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 1ZoYNS-0005Vn-N9
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:02 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	1D/F2-31069-5B656265; Tue, 20 Oct 2015 14:59:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1445353140!54979619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15628 invoked from network); 20 Oct 2015 14:59:01 -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;
	20 Oct 2015 14:59:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNQ-0001nT-F5
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNQ-00024F-Cr
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:00 +0000
Date: Tue, 20 Oct 2015 14:59:00 +0000
Message-Id: <E1ZoYNQ-00024F-Cr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] net: don't leak an fd after an
	error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1b6594ba444ce418fd183bedeed179ace42dab1
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:31:06 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    net: don't leak an fd after an error
    
    fd will be leaked if launch_script failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055925
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index 720027c..f3887a7 100644
--- a/net.c
+++ b/net.c
@@ -1049,8 +1049,10 @@ static int net_tap_init(VLANState *vlan, const char *model,
     if (!setup_script || !strcmp(setup_script, "no"))
         setup_script = "";
     if (setup_script[0] != '\0') {
-	if (launch_script(setup_script, ifname, script_arg, fd))
+	if (launch_script(setup_script, ifname, script_arg, fd)) {
+	    close(fd);
 	    return -1;
+	}
     }
     s = net_tap_fd_init(vlan, model, name, fd);
     if (!s)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYNf-0005ZN-6i; Tue, 20 Oct 2015 14:59:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNd-0005Yh-Af
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:13 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	71/27-24494-0C656265; Tue, 20 Oct 2015 14:59:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1445353151!27972184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21313 invoked from network); 20 Oct 2015 14:59:12 -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;
	20 Oct 2015 14:59:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNb-0001o4-78
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNa-00024o-ND
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:11 +0000
Date: Tue, 20 Oct 2015 14:59:10 +0000
Message-Id: <E1ZoYNa-00024o-ND@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] net: Fix memory/handle leaks in
	net_socket_listen_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b2a35d239b2462ac1bea07b74f4c88ec20e233a
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Tue Apr 22 07:38:24 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    net: Fix memory/handle leaks in net_socket_listen_init()
    
    fd and s could be leaked in case bind/listen failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055923 1055924
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/net.c b/net.c
index f3887a7..33460d8 100644
--- a/net.c
+++ b/net.c
@@ -1460,6 +1460,7 @@ static int net_socket_listen_init(VLANState *vlan,
     fd = socket(PF_INET, SOCK_STREAM, 0);
     if (fd < 0) {
         perror("socket");
+        qemu_free(s);
         return -1;
     }
     socket_set_nonblock(fd);
@@ -1471,11 +1472,15 @@ static int net_socket_listen_init(VLANState *vlan,
     ret = bind(fd, (struct sockaddr *)&saddr, sizeof(saddr));
     if (ret < 0) {
         perror("bind");
+        closesocket(fd);
+        qemu_free(s);
         return -1;
     }
     ret = listen(fd, 0);
     if (ret < 0) {
         perror("listen");
+        closesocket(fd);
+        qemu_free(s);
         return -1;
     }
     s->vlan = vlan;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYNf-0005ZN-6i; Tue, 20 Oct 2015 14:59:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNd-0005Yh-Af
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:13 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	71/27-24494-0C656265; Tue, 20 Oct 2015 14:59:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1445353151!27972184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21313 invoked from network); 20 Oct 2015 14:59:12 -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;
	20 Oct 2015 14:59:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNb-0001o4-78
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNa-00024o-ND
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:11 +0000
Date: Tue, 20 Oct 2015 14:59:10 +0000
Message-Id: <E1ZoYNa-00024o-ND@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] net: Fix memory/handle leaks in
	net_socket_listen_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b2a35d239b2462ac1bea07b74f4c88ec20e233a
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Tue Apr 22 07:38:24 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    net: Fix memory/handle leaks in net_socket_listen_init()
    
    fd and s could be leaked in case bind/listen failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055923 1055924
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/net.c b/net.c
index f3887a7..33460d8 100644
--- a/net.c
+++ b/net.c
@@ -1460,6 +1460,7 @@ static int net_socket_listen_init(VLANState *vlan,
     fd = socket(PF_INET, SOCK_STREAM, 0);
     if (fd < 0) {
         perror("socket");
+        qemu_free(s);
         return -1;
     }
     socket_set_nonblock(fd);
@@ -1471,11 +1472,15 @@ static int net_socket_listen_init(VLANState *vlan,
     ret = bind(fd, (struct sockaddr *)&saddr, sizeof(saddr));
     if (ret < 0) {
         perror("bind");
+        closesocket(fd);
+        qemu_free(s);
         return -1;
     }
     ret = listen(fd, 0);
     if (ret < 0) {
         perror("listen");
+        closesocket(fd);
+        qemu_free(s);
         return -1;
     }
     s->vlan = vlan;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYNp-0005eD-9i; Tue, 20 Oct 2015 14:59:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNn-0005dm-Sm
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:23 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	12/91-15765-BC656265; Tue, 20 Oct 2015 14:59:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445353161!23951035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12081 invoked from network); 20 Oct 2015 14:59:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:59:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNl-0001oC-Iw
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNl-00025A-G7
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:21 +0000
Date: Tue, 20 Oct 2015 14:59:21 +0000
Message-Id: <E1ZoYNl-00025A-G7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vvfat: fix memory/handle
	leaks in commit_one_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 b8b1c0d888c16ca2130c543122c69e9de5ef53c6
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:44:33 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-vvfat: fix memory/handle leaks in commit_one_file()
    
    Some handles and memory in commit_one_file are going to be leaked if
    certain function calls failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055918 1055919
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 345d7be..ec3363c 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -2229,11 +2229,15 @@ static int commit_one_file(BDRVVVFATState* s,
     if (fd < 0) {
 	fprintf(stderr, "Could not open %s... (%s, %d)\n", mapping->path,
 		strerror(errno), errno);
+	qemu_free(cluster);
 	return fd;
     }
     if (offset > 0)
-	if (lseek(fd, offset, SEEK_SET) != offset)
+	if (lseek(fd, offset, SEEK_SET) != offset) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return -3;
+	}
 
     while (offset < size) {
 	uint32_t c1;
@@ -2249,11 +2253,17 @@ static int commit_one_file(BDRVVVFATState* s,
 	ret = vvfat_read(s->bs, cluster2sector(s, c),
 	    (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200);
 
-	if (ret < 0)
+	if (ret < 0) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return ret;
+	}
 
-	if (qemu_write_ok(fd, cluster, rest_size) < 0)
+	if (qemu_write_ok(fd, cluster, rest_size) < 0) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return -2;
+	}
 
 	offset += rest_size;
 	c = c1;
@@ -2261,6 +2271,7 @@ static int commit_one_file(BDRVVVFATState* s,
 
     ftruncate(fd, size);
     close(fd);
+    qemu_free(cluster);
 
     return commit_mappings(s, first_cluster, dir_index);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYNp-0005eD-9i; Tue, 20 Oct 2015 14:59:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNn-0005dm-Sm
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:23 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	12/91-15765-BC656265; Tue, 20 Oct 2015 14:59:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445353161!23951035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12081 invoked from network); 20 Oct 2015 14:59:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Oct 2015 14:59:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNl-0001oC-Iw
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNl-00025A-G7
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:21 +0000
Date: Tue, 20 Oct 2015 14:59:21 +0000
Message-Id: <E1ZoYNl-00025A-G7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vvfat: fix memory/handle
	leaks in commit_one_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 b8b1c0d888c16ca2130c543122c69e9de5ef53c6
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:44:33 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-vvfat: fix memory/handle leaks in commit_one_file()
    
    Some handles and memory in commit_one_file are going to be leaked if
    certain function calls failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055918 1055919
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 345d7be..ec3363c 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -2229,11 +2229,15 @@ static int commit_one_file(BDRVVVFATState* s,
     if (fd < 0) {
 	fprintf(stderr, "Could not open %s... (%s, %d)\n", mapping->path,
 		strerror(errno), errno);
+	qemu_free(cluster);
 	return fd;
     }
     if (offset > 0)
-	if (lseek(fd, offset, SEEK_SET) != offset)
+	if (lseek(fd, offset, SEEK_SET) != offset) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return -3;
+	}
 
     while (offset < size) {
 	uint32_t c1;
@@ -2249,11 +2253,17 @@ static int commit_one_file(BDRVVVFATState* s,
 	ret = vvfat_read(s->bs, cluster2sector(s, c),
 	    (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200);
 
-	if (ret < 0)
+	if (ret < 0) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return ret;
+	}
 
-	if (qemu_write_ok(fd, cluster, rest_size) < 0)
+	if (qemu_write_ok(fd, cluster, rest_size) < 0) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return -2;
+	}
 
 	offset += rest_size;
 	c = c1;
@@ -2261,6 +2271,7 @@ static int commit_one_file(BDRVVVFATState* s,
 
     ftruncate(fd, size);
     close(fd);
+    qemu_free(cluster);
 
     return commit_mappings(s, first_cluster, dir_index);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYNz-0005hq-EE; Tue, 20 Oct 2015 14:59: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 1ZoYNy-0005ha-Bg
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:34 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	BA/80-03763-5D656265; Tue, 20 Oct 2015 14:59:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445353172!50599815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27023 invoked from network); 20 Oct 2015 14:59:33 -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;
	20 Oct 2015 14:59:33 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNv-0001oK-Sx
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNv-00025X-R3
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:31 +0000
Date: Tue, 20 Oct 2015 14:59:31 +0000
Message-Id: <E1ZoYNv-00025X-R3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vvfat: fix memory leak in
	check_directory_consistency()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f9e474fca9b15b27f8f97220d165cd9f83a1fb0
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:52:47 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix memory leak in check_directory_consistency()
    
    Memory pointed by cluster leaks in error handling code.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055917
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index ec3363c..6cd57a2 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -1769,7 +1769,7 @@ static int check_directory_consistency(BDRVVVFATState *s,
 
 	if (s->used_clusters[cluster_num] & USED_ANY) {
 	    fprintf(stderr, "cluster %d used more than once\n", (int)cluster_num);
-	    return 0;
+	    goto fail;
 	}
 	s->used_clusters[cluster_num] = USED_DIRECTORY;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYNz-0005hq-EE; Tue, 20 Oct 2015 14:59: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 1ZoYNy-0005ha-Bg
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:34 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	BA/80-03763-5D656265; Tue, 20 Oct 2015 14:59:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445353172!50599815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27023 invoked from network); 20 Oct 2015 14:59:33 -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;
	20 Oct 2015 14:59:33 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNv-0001oK-Sx
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYNv-00025X-R3
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:31 +0000
Date: Tue, 20 Oct 2015 14:59:31 +0000
Message-Id: <E1ZoYNv-00025X-R3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vvfat: fix memory leak in
	check_directory_consistency()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f9e474fca9b15b27f8f97220d165cd9f83a1fb0
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:52:47 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix memory leak in check_directory_consistency()
    
    Memory pointed by cluster leaks in error handling code.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055917
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index ec3363c..6cd57a2 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -1769,7 +1769,7 @@ static int check_directory_consistency(BDRVVVFATState *s,
 
 	if (s->used_clusters[cluster_num] & USED_ANY) {
 	    fprintf(stderr, "cluster %d used more than once\n", (int)cluster_num);
-	    return 0;
+	    goto fail;
 	}
 	s->used_clusters[cluster_num] = USED_DIRECTORY;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYO9-0005mz-Gh; Tue, 20 Oct 2015 14:59:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYO8-0005lH-Ln
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:44 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	3B/BF-25435-FD656265; Tue, 20 Oct 2015 14:59:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445353182!59899876!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3296 invoked from network); 20 Oct 2015 14:59:43 -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;
	20 Oct 2015 14:59:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYO6-0001oS-8M
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYO6-00026R-4C
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:42 +0000
Date: Tue, 20 Oct 2015 14:59:42 +0000
Message-Id: <E1ZoYO6-00026R-4C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] virtio-blk: correctly link new
	request in virtio_blk_load()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fd8feea11eca12e370d9ada03c8d1bf81541a9a
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 09:49:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    virtio-blk: correctly link new request in virtio_blk_load()
    
    s->rq should be set with req instead of req-next.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055910
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/virtio-blk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index fcf893a..f3a81e3 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -288,7 +288,7 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)
         VirtIOBlockReq *req = virtio_blk_alloc_request(s);
         qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));
         req->next = s->rq;
-        s->rq = req->next;
+        s->rq = req;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59: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 1ZoYO9-0005mz-Gh; Tue, 20 Oct 2015 14:59:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYO8-0005lH-Ln
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:44 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	3B/BF-25435-FD656265; Tue, 20 Oct 2015 14:59:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445353182!59899876!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3296 invoked from network); 20 Oct 2015 14:59:43 -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;
	20 Oct 2015 14:59:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYO6-0001oS-8M
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYO6-00026R-4C
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:42 +0000
Date: Tue, 20 Oct 2015 14:59:42 +0000
Message-Id: <E1ZoYO6-00026R-4C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] virtio-blk: correctly link new
	request in virtio_blk_load()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fd8feea11eca12e370d9ada03c8d1bf81541a9a
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 09:49:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    virtio-blk: correctly link new request in virtio_blk_load()
    
    s->rq should be set with req instead of req-next.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055910
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/virtio-blk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index fcf893a..f3a81e3 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -288,7 +288,7 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)
         VirtIOBlockReq *req = virtio_blk_alloc_request(s);
         qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));
         req->next = s->rq;
-        s->rq = req->next;
+        s->rq = req;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYOK-0005qm-JA; Tue, 20 Oct 2015 14:59: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 1ZoYOJ-0005qN-Ly
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:55 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	A5/FB-16965-AE656265; Tue, 20 Oct 2015 14:59:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445353192!54854812!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31063 invoked from network); 20 Oct 2015 14:59:54 -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;
	20 Oct 2015 14:59:54 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOG-0001oa-LL
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOG-00026n-Jz
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:52 +0000
Date: Tue, 20 Oct 2015 14:59:52 +0000
Message-Id: <E1ZoYOG-00026n-Jz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] net: initialize parameters
	before use in net_socket_fd_init_dgram()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9da9f80538c8ff891886cfe3d987ca17bd240d19
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 09:55:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    net: initialize parameters before use in net_socket_fd_init_dgram()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1005339 1005340
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index 33460d8..8aba3c2 100644
--- a/net.c
+++ b/net.c
@@ -1316,9 +1316,11 @@ static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan,
 {
     struct sockaddr_in saddr;
     int newfd;
-    socklen_t saddr_len;
+    socklen_t saddr_len = sizeof(saddr);
     NetSocketState *s;
 
+    memset(&saddr, 0, sizeof(saddr));
+
     /* fd passed: multicast: "learn" dgram_dst address from bound address and save it
      * Because this may be "shared" socket from a "master" process, datagrams would be recv()
      * by ONLY ONE process: we must "clone" this dgram socket --jjo
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 14:59:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 14:59:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYOK-0005qm-JA; Tue, 20 Oct 2015 14:59: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 1ZoYOJ-0005qN-Ly
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:55 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	A5/FB-16965-AE656265; Tue, 20 Oct 2015 14:59:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1445353192!54854812!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31063 invoked from network); 20 Oct 2015 14:59:54 -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;
	20 Oct 2015 14:59:54 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOG-0001oa-LL
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOG-00026n-Jz
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 14:59:52 +0000
Date: Tue, 20 Oct 2015 14:59:52 +0000
Message-Id: <E1ZoYOG-00026n-Jz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] net: initialize parameters
	before use in net_socket_fd_init_dgram()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9da9f80538c8ff891886cfe3d987ca17bd240d19
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 09:55:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    net: initialize parameters before use in net_socket_fd_init_dgram()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1005339 1005340
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index 33460d8..8aba3c2 100644
--- a/net.c
+++ b/net.c
@@ -1316,9 +1316,11 @@ static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan,
 {
     struct sockaddr_in saddr;
     int newfd;
-    socklen_t saddr_len;
+    socklen_t saddr_len = sizeof(saddr);
     NetSocketState *s;
 
+    memset(&saddr, 0, sizeof(saddr));
+
     /* fd passed: multicast: "learn" dgram_dst address from bound address and save it
      * Because this may be "shared" socket from a "master" process, datagrams would be recv()
      * by ONLY ONE process: we must "clone" this dgram socket --jjo
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 15:00:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 15:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYOU-0005xn-Lp; Tue, 20 Oct 2015 15:00: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 1ZoYOU-0005xe-75
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:06 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	31/2F-03819-5F656265; Tue, 20 Oct 2015 15:00:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1445353203!43681758!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15664 invoked from network); 20 Oct 2015 15:00:04 -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;
	20 Oct 2015 15:00:04 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOR-0001rX-JN
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOQ-00027k-Tn
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:03 +0000
Date: Tue, 20 Oct 2015 15:00:02 +0000
Message-Id: <E1ZoYOQ-00027k-Tn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] ide: don't leak irq array in
	pci_cmd646_ide_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a979f2dcfab505ca77e5fd5f644bb0a705bae724
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:11:30 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    ide: don't leak irq array in pci_cmd646_ide_init()
    
    Call qemu_allocate_irq() twice instead of qemu_allocate_irqs to
    allocate memory.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 4c30edd..e4ad360 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3676,7 +3676,6 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
     PCIIDEState *d;
     uint8_t *pci_conf;
     int i;
-    qemu_irq *irq;
 
     d = (PCIIDEState *)pci_register_device(bus, "CMD646 IDE",
                                            sizeof(PCIIDEState),
@@ -3718,9 +3717,8 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
     for(i = 0; i < 4; i++)
         d->ide_if[i].pci_dev = (PCIDevice *)d;
 
-    irq = qemu_allocate_irqs(cmd646_set_irq, d, 2);
-    ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], irq[0]);
-    ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], irq[1]);
+    ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], qemu_allocate_irq(cmd646_set_irq, d));
+    ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], qemu_allocate_irq(cmd646_set_irq, d));
 
     register_savevm("ide", 0, 3, pci_ide_save, pci_ide_load, d);
     qemu_register_reset(cmd646_reset, d);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 15:00:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 15:00:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYOU-0005xn-Lp; Tue, 20 Oct 2015 15:00: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 1ZoYOU-0005xe-75
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:06 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	31/2F-03819-5F656265; Tue, 20 Oct 2015 15:00:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1445353203!43681758!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15664 invoked from network); 20 Oct 2015 15:00:04 -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;
	20 Oct 2015 15:00:04 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOR-0001rX-JN
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOQ-00027k-Tn
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:03 +0000
Date: Tue, 20 Oct 2015 15:00:02 +0000
Message-Id: <E1ZoYOQ-00027k-Tn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] ide: don't leak irq array in
	pci_cmd646_ide_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a979f2dcfab505ca77e5fd5f644bb0a705bae724
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:11:30 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    ide: don't leak irq array in pci_cmd646_ide_init()
    
    Call qemu_allocate_irq() twice instead of qemu_allocate_irqs to
    allocate memory.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 4c30edd..e4ad360 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3676,7 +3676,6 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
     PCIIDEState *d;
     uint8_t *pci_conf;
     int i;
-    qemu_irq *irq;
 
     d = (PCIIDEState *)pci_register_device(bus, "CMD646 IDE",
                                            sizeof(PCIIDEState),
@@ -3718,9 +3717,8 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
     for(i = 0; i < 4; i++)
         d->ide_if[i].pci_dev = (PCIDevice *)d;
 
-    irq = qemu_allocate_irqs(cmd646_set_irq, d, 2);
-    ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], irq[0]);
-    ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], irq[1]);
+    ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], qemu_allocate_irq(cmd646_set_irq, d));
+    ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], qemu_allocate_irq(cmd646_set_irq, d));
 
     register_savevm("ide", 0, 3, pci_ide_save, pci_ide_load, d);
     qemu_register_reset(cmd646_reset, d);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 15:00:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 15: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 1ZoYOf-00061I-Ob; Tue, 20 Oct 2015 15:00: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 1ZoYOe-00060p-Iq
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:16 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	3D/4E-01748-FF656265; Tue, 20 Oct 2015 15:00:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1445353214!18097584!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9351 invoked from network); 20 Oct 2015 15:00:15 -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;
	20 Oct 2015 15:00:15 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOc-0001rf-2B
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOb-00028v-VF
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:13 +0000
Date: Tue, 20 Oct 2015 15:00:13 +0000
Message-Id: <E1ZoYOb-00028v-VF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-nbd: close sock in
	nbd_open() error 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 50c84619ea9aa6c24dd1c1215b25dfb73fbcc3c4
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:12:01 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-nbd: close sock in nbd_open() error path
    
    Close sock handle before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055914
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-nbd.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-nbd.c b/block-nbd.c
index dc63183..e2c90eb 100644
--- a/block-nbd.c
+++ b/block-nbd.c
@@ -88,7 +88,10 @@ static int nbd_open(BlockDriverState *bs, const char* filename, int flags)
 
     ret = nbd_receive_negotiate(sock, &size, &blocksize);
     if (ret == -1)
+    {
+        close(sock);
         return -errno;
+    }
 
     s->sock = sock;
     s->size = size;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 15:00:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 15: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 1ZoYOf-00061I-Ob; Tue, 20 Oct 2015 15:00: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 1ZoYOe-00060p-Iq
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:16 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	3D/4E-01748-FF656265; Tue, 20 Oct 2015 15:00:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1445353214!18097584!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9351 invoked from network); 20 Oct 2015 15:00:15 -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;
	20 Oct 2015 15:00:15 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOc-0001rf-2B
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOb-00028v-VF
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:13 +0000
Date: Tue, 20 Oct 2015 15:00:13 +0000
Message-Id: <E1ZoYOb-00028v-VF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-nbd: close sock in
	nbd_open() error 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 50c84619ea9aa6c24dd1c1215b25dfb73fbcc3c4
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:12:01 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-nbd: close sock in nbd_open() error path
    
    Close sock handle before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055914
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-nbd.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-nbd.c b/block-nbd.c
index dc63183..e2c90eb 100644
--- a/block-nbd.c
+++ b/block-nbd.c
@@ -88,7 +88,10 @@ static int nbd_open(BlockDriverState *bs, const char* filename, int flags)
 
     ret = nbd_receive_negotiate(sock, &size, &blocksize);
     if (ret == -1)
+    {
+        close(sock);
         return -errno;
+    }
 
     s->sock = sock;
     s->size = size;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 15:00:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 15:00: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 1ZoYOu-00064r-RF; Tue, 20 Oct 2015 15:00:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOt-00064f-Bo
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:31 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	C7/E6-18886-E0756265; Tue, 20 Oct 2015 15:00:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445353229!23951457!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24170 invoked from network); 20 Oct 2015 15:00:30 -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;
	20 Oct 2015 15:00:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOr-0001rn-0R
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOm-00029Z-9b
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:28 +0000
Date: Tue, 20 Oct 2015 15:00:24 +0000
Message-Id: <E1ZoYOm-00029Z-9b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-raw-posix: Fix memory
	leak in posix_aio_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 734b9a8f05418c6cdb21b4c3d24b9d35960595eb
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:14:56 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-raw-posix: Fix memory leak in posix_aio_init()
    
    Free allocated memory s before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055915
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-raw-posix.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/block-raw-posix.c b/block-raw-posix.c
index 795cd5b..8a1baa8 100644
--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -602,6 +602,7 @@ static int posix_aio_init(void)
     s->first_aio = NULL;
     if (pipe(fds) == -1) {
         fprintf(stderr, "failed to create pipe\n");
+        qemu_free(s);
         return -errno;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 15:00:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 15:00: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 1ZoYOu-00064r-RF; Tue, 20 Oct 2015 15:00:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOt-00064f-Bo
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:31 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	C7/E6-18886-E0756265; Tue, 20 Oct 2015 15:00:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445353229!23951457!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24170 invoked from network); 20 Oct 2015 15:00:30 -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;
	20 Oct 2015 15:00:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOr-0001rn-0R
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYOm-00029Z-9b
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:28 +0000
Date: Tue, 20 Oct 2015 15:00:24 +0000
Message-Id: <E1ZoYOm-00029Z-9b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-raw-posix: Fix memory
	leak in posix_aio_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 734b9a8f05418c6cdb21b4c3d24b9d35960595eb
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:14:56 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-raw-posix: Fix memory leak in posix_aio_init()
    
    Free allocated memory s before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055915
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-raw-posix.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/block-raw-posix.c b/block-raw-posix.c
index 795cd5b..8a1baa8 100644
--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -602,6 +602,7 @@ static int posix_aio_init(void)
     s->first_aio = NULL;
     if (pipe(fds) == -1) {
         fprintf(stderr, "failed to create pipe\n");
+        qemu_free(s);
         return -errno;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 15:00:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 15:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYP4-00066D-Tl; Tue, 20 Oct 2015 15:00: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 1ZoYP3-000663-Nx
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:41 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	49/70-10422-81756265; Tue, 20 Oct 2015 15:00:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1445353239!38412548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 584 invoked from network); 20 Oct 2015 15:00:40 -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;
	20 Oct 2015 15:00:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYP1-0001rv-Bd
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYP1-0002Aw-6j
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:39 +0000
Date: Tue, 20 Oct 2015 15:00:39 +0000
Message-Id: <E1ZoYP1-0002Aw-6j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vvfat: fix resource leaks
	in read_directory()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc00cad75d8bcc3ba696992bec219c21db8406aa
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:19:23 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix resource leaks in read_directory()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1055920 1055921
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 6cd57a2..ff5c8bf 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -760,6 +760,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
         if (st.st_size > 0x7fffffff) {
 	    fprintf(stderr, "File %s is larger than 2GB\n", buffer);
 	    free(buffer);
+            closedir(dir);
 	    return -2;
         }
 	direntry->size=cpu_to_le32(S_ISDIR(st.st_mode)?0:st.st_size);
@@ -787,6 +788,8 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
 	    s->current_mapping->read_only =
 		(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) == 0;
 	}
+        else
+            qemu_free(buffer);
     }
     closedir(dir);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 20 15:00:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2015 15:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZoYP4-00066D-Tl; Tue, 20 Oct 2015 15:00: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 1ZoYP3-000663-Nx
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:41 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	49/70-10422-81756265; Tue, 20 Oct 2015 15:00:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1445353239!38412548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 584 invoked from network); 20 Oct 2015 15:00:40 -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;
	20 Oct 2015 15:00:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYP1-0001rv-Bd
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoYP1-0002Aw-6j
	for xen-changelog@lists.xensource.com; Tue, 20 Oct 2015 15:00:39 +0000
Date: Tue, 20 Oct 2015 15:00:39 +0000
Message-Id: <E1ZoYP1-0002Aw-6j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] block-vvfat: fix resource leaks
	in read_directory()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc00cad75d8bcc3ba696992bec219c21db8406aa
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:19:23 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix resource leaks in read_directory()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1055920 1055921
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 6cd57a2..ff5c8bf 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -760,6 +760,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
         if (st.st_size > 0x7fffffff) {
 	    fprintf(stderr, "File %s is larger than 2GB\n", buffer);
 	    free(buffer);
+            closedir(dir);
 	    return -2;
         }
 	direntry->size=cpu_to_le32(S_ISDIR(st.st_mode)?0:st.st_size);
@@ -787,6 +788,8 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
 	    s->current_mapping->read_only =
 		(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) == 0;
 	}
+        else
+            qemu_free(buffer);
     }
     closedir(dir);
 
--
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 Oct 21 10:22:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 10: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 1ZoqX2-0001Mh-Bk; Wed, 21 Oct 2015 10:22:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoqX1-0001Mc-Mq
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 10:22:07 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	B2/F4-19110-F4767265; Wed, 21 Oct 2015 10:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1445422925!60153623!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29869 invoked from network); 21 Oct 2015 10:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Oct 2015 10:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoqWy-0004sk-E1
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 10:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoqWx-0002K8-Pb
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 10:22:04 +0000
Date: Wed, 21 Oct 2015 10:22:03 +0000
Message-Id: <E1ZoqWx-0002K8-Pb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] spice-display: fix
	segfault in qemu_spice_create_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 816609b2841297925a223ec377c336360e044ee5
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Tue Jun 9 21:08:47 2015 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Oct 19 10:28:14 2015 +0000

    spice-display: fix segfault in qemu_spice_create_update
    
    Although it is pretty unusual the stride for the guest image and the
    mirror image maintained by spice-display can be different.  So use
    separate variables for them.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1163047
    
    Cc: qemu-stable@nongnu.org
    Reported-by: perrier vincent <clownix@clownix.net>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-display.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index def7b52..ded5b72 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -199,7 +199,7 @@ static void qemu_spice_create_update(SimpleSpiceDisplay *ssd)
     static const int blksize = 32;
     int blocks = (surface_width(ssd->ds) + blksize - 1) / blksize;
     int dirty_top[blocks];
-    int y, yoff, x, xoff, blk, bw;
+    int y, yoff1, yoff2, x, xoff, blk, bw;
     int bpp = surface_bytes_per_pixel(ssd->ds);
     uint8_t *guest, *mirror;
 
@@ -220,13 +220,14 @@ static void qemu_spice_create_update(SimpleSpiceDisplay *ssd)
     guest = surface_data(ssd->ds);
     mirror = (void *)pixman_image_get_data(ssd->mirror);
     for (y = ssd->dirty.top; y < ssd->dirty.bottom; y++) {
-        yoff = y * surface_stride(ssd->ds);
+        yoff1 = y * surface_stride(ssd->ds);
+        yoff2 = y * pixman_image_get_stride(ssd->mirror);
         for (x = ssd->dirty.left; x < ssd->dirty.right; x += blksize) {
             xoff = x * bpp;
             blk = x / blksize;
             bw = MIN(blksize, ssd->dirty.right - x);
-            if (memcmp(guest + yoff + xoff,
-                       mirror + yoff + xoff,
+            if (memcmp(guest + yoff1 + xoff,
+                       mirror + yoff2 + xoff,
                        bw * bpp) == 0) {
                 if (dirty_top[blk] != -1) {
                     QXLRect update = {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 10:22:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 10: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 1ZoqX2-0001Mh-Bk; Wed, 21 Oct 2015 10:22:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoqX1-0001Mc-Mq
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 10:22:07 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	B2/F4-19110-F4767265; Wed, 21 Oct 2015 10:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1445422925!60153623!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29869 invoked from network); 21 Oct 2015 10:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Oct 2015 10:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoqWy-0004sk-E1
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 10:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoqWx-0002K8-Pb
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 10:22:04 +0000
Date: Wed, 21 Oct 2015 10:22:03 +0000
Message-Id: <E1ZoqWx-0002K8-Pb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] spice-display: fix
	segfault in qemu_spice_create_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 816609b2841297925a223ec377c336360e044ee5
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Tue Jun 9 21:08:47 2015 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Oct 19 10:28:14 2015 +0000

    spice-display: fix segfault in qemu_spice_create_update
    
    Although it is pretty unusual the stride for the guest image and the
    mirror image maintained by spice-display can be different.  So use
    separate variables for them.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1163047
    
    Cc: qemu-stable@nongnu.org
    Reported-by: perrier vincent <clownix@clownix.net>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-display.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index def7b52..ded5b72 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -199,7 +199,7 @@ static void qemu_spice_create_update(SimpleSpiceDisplay *ssd)
     static const int blksize = 32;
     int blocks = (surface_width(ssd->ds) + blksize - 1) / blksize;
     int dirty_top[blocks];
-    int y, yoff, x, xoff, blk, bw;
+    int y, yoff1, yoff2, x, xoff, blk, bw;
     int bpp = surface_bytes_per_pixel(ssd->ds);
     uint8_t *guest, *mirror;
 
@@ -220,13 +220,14 @@ static void qemu_spice_create_update(SimpleSpiceDisplay *ssd)
     guest = surface_data(ssd->ds);
     mirror = (void *)pixman_image_get_data(ssd->mirror);
     for (y = ssd->dirty.top; y < ssd->dirty.bottom; y++) {
-        yoff = y * surface_stride(ssd->ds);
+        yoff1 = y * surface_stride(ssd->ds);
+        yoff2 = y * pixman_image_get_stride(ssd->mirror);
         for (x = ssd->dirty.left; x < ssd->dirty.right; x += blksize) {
             xoff = x * bpp;
             blk = x / blksize;
             bw = MIN(blksize, ssd->dirty.right - x);
-            if (memcmp(guest + yoff + xoff,
-                       mirror + yoff + xoff,
+            if (memcmp(guest + yoff1 + xoff,
+                       mirror + yoff2 + xoff,
                        bw * bpp) == 0) {
                 if (dirty_top[blk] != -1) {
                     QXLRect update = {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:33:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33: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 1Zordl-0007Ph-Hs; Wed, 21 Oct 2015 11:33:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zordk-0007PU-7x
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:08 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	02/8A-17090-2F777265; Wed, 21 Oct 2015 11:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1445427185!43924406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19337 invoked from network); 21 Oct 2015 11:33:06 -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;
	21 Oct 2015 11:33:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zordh-0005c8-Gg
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zordg-0005R4-Bx
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:04 +0000
Date: Wed, 21 Oct 2015 11:33:04 +0000
Message-Id: <E1Zordg-0005R4-Bx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] spice-display: fix segfault in
	qemu_spice_create_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

*** New tip has no discernable common ancestor with previous history ***

commit 816609b2841297925a223ec377c336360e044ee5
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Tue Jun 9 21:08:47 2015 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Oct 19 10:28:14 2015 +0000

    spice-display: fix segfault in qemu_spice_create_update
    
    Although it is pretty unusual the stride for the guest image and the
    mirror image maintained by spice-display can be different.  So use
    separate variables for them.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1163047
    
    Cc: qemu-stable@nongnu.org
    Reported-by: perrier vincent <clownix@clownix.net>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:33:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33: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 1Zordl-0007Ph-Hs; Wed, 21 Oct 2015 11:33:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zordk-0007PU-7x
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:08 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	02/8A-17090-2F777265; Wed, 21 Oct 2015 11:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1445427185!43924406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19337 invoked from network); 21 Oct 2015 11:33:06 -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;
	21 Oct 2015 11:33:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zordh-0005c8-Gg
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zordg-0005R4-Bx
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:04 +0000
Date: Wed, 21 Oct 2015 11:33:04 +0000
Message-Id: <E1Zordg-0005R4-Bx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] spice-display: fix segfault in
	qemu_spice_create_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

*** New tip has no discernable common ancestor with previous history ***

commit 816609b2841297925a223ec377c336360e044ee5
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Tue Jun 9 21:08:47 2015 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Oct 19 10:28:14 2015 +0000

    spice-display: fix segfault in qemu_spice_create_update
    
    Although it is pretty unusual the stride for the guest image and the
    mirror image maintained by spice-display can be different.  So use
    separate variables for them.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1163047
    
    Cc: qemu-stable@nongnu.org
    Reported-by: perrier vincent <clownix@clownix.net>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:33:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zordx-0007R5-M7; Wed, 21 Oct 2015 11:33: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 1Zordw-0007Qx-GT
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:20 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	F6/99-28221-FF777265; Wed, 21 Oct 2015 11:33:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445427197!60155084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28845 invoked from network); 21 Oct 2015 11:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Oct 2015 11:33:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zordt-0005cG-P8
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zords-0005Rz-Nq
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:16 +0000
Date: Wed, 21 Oct 2015 11:33:16 +0000
Message-Id: <E1Zords-0005Rz-Nq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.6] spice-display: fix segfault
	in qemu_spice_create_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

*** New tip has no discernable common ancestor with previous history ***

commit 980dfcf5b8d8161871f81d1987b2f8ea5d7d4db9
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Tue Jun 9 21:08:47 2015 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Oct 19 15:02:05 2015 +0000

    spice-display: fix segfault in qemu_spice_create_update
    
    Although it is pretty unusual the stride for the guest image and the
    mirror image maintained by spice-display can be different.  So use
    separate variables for them.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1163047
    
    Cc: qemu-stable@nongnu.org
    Reported-by: perrier vincent <clownix@clownix.net>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:33:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zordx-0007R5-M7; Wed, 21 Oct 2015 11:33: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 1Zordw-0007Qx-GT
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:20 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	F6/99-28221-FF777265; Wed, 21 Oct 2015 11:33:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1445427197!60155084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28845 invoked from network); 21 Oct 2015 11:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Oct 2015 11:33:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zordt-0005cG-P8
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zords-0005Rz-Nq
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:16 +0000
Date: Wed, 21 Oct 2015 11:33:16 +0000
Message-Id: <E1Zords-0005Rz-Nq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.6] spice-display: fix segfault
	in qemu_spice_create_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

*** New tip has no discernable common ancestor with previous history ***

commit 980dfcf5b8d8161871f81d1987b2f8ea5d7d4db9
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Tue Jun 9 21:08:47 2015 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Oct 19 15:02:05 2015 +0000

    spice-display: fix segfault in qemu_spice_create_update
    
    Although it is pretty unusual the stride for the guest image and the
    mirror image maintained by spice-display can be different.  So use
    separate variables for them.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1163047
    
    Cc: qemu-stable@nongnu.org
    Reported-by: perrier vincent <clownix@clownix.net>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:33:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zore8-0007SL-Oj; Wed, 21 Oct 2015 11:33:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zore7-0007S6-FI
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:31 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	24/4A-31450-A0877265; Wed, 21 Oct 2015 11:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1445427209!11817802!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31029 invoked from network); 21 Oct 2015 11:33:30 -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;
	21 Oct 2015 11:33:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zore5-0005cO-4o
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zore5-0005Sk-10
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:29 +0000
Date: Wed, 21 Oct 2015 11:33:29 +0000
Message-Id: <E1Zore5-0005Sk-10@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.5] net: avoid infinite loop when
	receiving packets(CVE-2015-5278)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit e5a1bb22cfb307db909dbd3404c48e5bbeb9e66d
Author:     P J P <pjp@fedoraproject.org>
AuthorDate: Tue Sep 15 16:46:59 2015 +0530
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Sep 15 14:04:42 2015 +0000

    net: avoid infinite loop when receiving packets(CVE-2015-5278)
    
    Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
    bytes to process network packets. While receiving packets
    via ne2000_receive() routine, a local 'index' variable
    could exceed the ring buffer size, leading to an infinite
    loop situation.
    
    upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    Signed-off-by: P J P <pjp@fedoraproject.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-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 Oct 21 11:33:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zore8-0007SL-Oj; Wed, 21 Oct 2015 11:33:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zore7-0007S6-FI
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:31 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	24/4A-31450-A0877265; Wed, 21 Oct 2015 11:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1445427209!11817802!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31029 invoked from network); 21 Oct 2015 11:33:30 -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;
	21 Oct 2015 11:33:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zore5-0005cO-4o
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zore5-0005Sk-10
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:29 +0000
Date: Wed, 21 Oct 2015 11:33:29 +0000
Message-Id: <E1Zore5-0005Sk-10@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.5] net: avoid infinite loop when
	receiving packets(CVE-2015-5278)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit e5a1bb22cfb307db909dbd3404c48e5bbeb9e66d
Author:     P J P <pjp@fedoraproject.org>
AuthorDate: Tue Sep 15 16:46:59 2015 +0530
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Sep 15 14:04:42 2015 +0000

    net: avoid infinite loop when receiving packets(CVE-2015-5278)
    
    Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
    bytes to process network packets. While receiving packets
    via ne2000_receive() routine, a local 'index' variable
    could exceed the ring buffer size, leading to an infinite
    loop situation.
    
    upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    Signed-off-by: P J P <pjp@fedoraproject.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-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 Oct 21 11:33:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33: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 1ZoreK-0007Ty-RR; Wed, 21 Oct 2015 11:33:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreJ-0007Ti-2P
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:43 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	49/18-28791-61877265; Wed, 21 Oct 2015 11:33:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1445427220!23416128!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9161 invoked from network); 21 Oct 2015 11:33:41 -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;
	21 Oct 2015 11:33:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreG-0005cW-HR
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreG-0005TU-Cu
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:40 +0000
Date: Wed, 21 Oct 2015 11:33:40 +0000
Message-Id: <E1ZoreG-0005TU-Cu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.4] net: avoid infinite loop when
	receiving packets(CVE-2015-5278)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit 5fe74249f5ab528fe84a26fa60438a6de4c787f0
Author:     P J P <pjp@fedoraproject.org>
AuthorDate: Tue Sep 15 16:46:59 2015 +0530
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Sep 15 14:11:51 2015 +0000

    net: avoid infinite loop when receiving packets(CVE-2015-5278)
    
    Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
    bytes to process network packets. While receiving packets
    via ne2000_receive() routine, a local 'index' variable
    could exceed the ring buffer size, leading to an infinite
    loop situation.
    
    upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    Signed-off-by: P J P <pjp@fedoraproject.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-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 Oct 21 11:33:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33: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 1ZoreK-0007Ty-RR; Wed, 21 Oct 2015 11:33:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreJ-0007Ti-2P
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:43 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	49/18-28791-61877265; Wed, 21 Oct 2015 11:33:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1445427220!23416128!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9161 invoked from network); 21 Oct 2015 11:33:41 -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;
	21 Oct 2015 11:33:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreG-0005cW-HR
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreG-0005TU-Cu
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:40 +0000
Date: Wed, 21 Oct 2015 11:33:40 +0000
Message-Id: <E1ZoreG-0005TU-Cu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.4] net: avoid infinite loop when
	receiving packets(CVE-2015-5278)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit 5fe74249f5ab528fe84a26fa60438a6de4c787f0
Author:     P J P <pjp@fedoraproject.org>
AuthorDate: Tue Sep 15 16:46:59 2015 +0530
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Sep 15 14:11:51 2015 +0000

    net: avoid infinite loop when receiving packets(CVE-2015-5278)
    
    Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
    bytes to process network packets. While receiving packets
    via ne2000_receive() routine, a local 'index' variable
    could exceed the ring buffer size, leading to an infinite
    loop situation.
    
    upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    Signed-off-by: P J P <pjp@fedoraproject.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-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 Oct 21 11:33:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33: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 1ZoreW-0007Vo-Tx; Wed, 21 Oct 2015 11:33:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreU-0007Vc-Ri
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:54 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	5F/C5-16618-22877265; Wed, 21 Oct 2015 11:33:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1445427232!60237052!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18733 invoked from network); 21 Oct 2015 11:33:53 -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;
	21 Oct 2015 11:33:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreS-0005cb-5O
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreR-0005Uw-WE
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:52 +0000
Date: Wed, 21 Oct 2015 11:33:51 +0000
Message-Id: <E1ZoreR-0005Uw-WE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.3] net: avoid infinite loop when
	receiving packets(CVE-2015-5278)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit b188780861662e8cf1847ec562799b32bb44f05e
Author:     P J P <pjp@fedoraproject.org>
AuthorDate: Tue Sep 15 14:29:21 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Sep 15 14:29:21 2015 +0000

    net: avoid infinite loop when receiving packets(CVE-2015-5278)
    
    Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
    bytes to process network packets. While receiving packets
    via ne2000_receive() routine, a local 'index' variable
    could exceed the ring buffer size, leading to an infinite
    loop situation.
    
    upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    Signed-off-by: P J P <pjp@fedoraproject.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:33:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:33: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 1ZoreW-0007Vo-Tx; Wed, 21 Oct 2015 11:33:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreU-0007Vc-Ri
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:54 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	5F/C5-16618-22877265; Wed, 21 Oct 2015 11:33:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1445427232!60237052!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18733 invoked from network); 21 Oct 2015 11:33:53 -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;
	21 Oct 2015 11:33:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreS-0005cb-5O
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZoreR-0005Uw-WE
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:33:52 +0000
Date: Wed, 21 Oct 2015 11:33:51 +0000
Message-Id: <E1ZoreR-0005Uw-WE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.3] net: avoid infinite loop when
	receiving packets(CVE-2015-5278)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit b188780861662e8cf1847ec562799b32bb44f05e
Author:     P J P <pjp@fedoraproject.org>
AuthorDate: Tue Sep 15 14:29:21 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Sep 15 14:29:21 2015 +0000

    net: avoid infinite loop when receiving packets(CVE-2015-5278)
    
    Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
    bytes to process network packets. While receiving packets
    via ne2000_receive() routine, a local 'index' variable
    could exceed the ring buffer size, leading to an infinite
    loop situation.
    
    upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    Signed-off-by: P J P <pjp@fedoraproject.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:34:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:34: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 1Zorei-0007XX-0B; Wed, 21 Oct 2015 11:34: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 1Zoreg-0007XD-DC
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:06 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	87/6B-10678-D2877265; Wed, 21 Oct 2015 11:34:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445427244!24093941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31385 invoked from network); 21 Oct 2015 11:34:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Oct 2015 11:34:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zored-0005dF-UX
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zored-0005Vn-Gg
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:03 +0000
Date: Wed, 21 Oct 2015 11:34:03 +0000
Message-Id: <E1Zored-0005Vn-Gg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.2] net: avoid infinite loop when
	receiving packets(CVE-2015-5278)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit c17e602ae64fb24405ebd256679ba9a6f5819086
Author:     P J P <pjp@fedoraproject.org>
AuthorDate: Tue Sep 15 14:29:21 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Sep 15 14:37:38 2015 +0000

    net: avoid infinite loop when receiving packets(CVE-2015-5278)
    
    Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
    bytes to process network packets. While receiving packets
    via ne2000_receive() routine, a local 'index' variable
    could exceed the ring buffer size, leading to an infinite
    loop situation.
    
    upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    Signed-off-by: P J P <pjp@fedoraproject.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:34:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:34: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 1Zorei-0007XX-0B; Wed, 21 Oct 2015 11:34: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 1Zoreg-0007XD-DC
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:06 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	87/6B-10678-D2877265; Wed, 21 Oct 2015 11:34:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445427244!24093941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31385 invoked from network); 21 Oct 2015 11:34:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Oct 2015 11:34:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zored-0005dF-UX
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zored-0005Vn-Gg
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:03 +0000
Date: Wed, 21 Oct 2015 11:34:03 +0000
Message-Id: <E1Zored-0005Vn-Gg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.2] net: avoid infinite loop when
	receiving packets(CVE-2015-5278)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit c17e602ae64fb24405ebd256679ba9a6f5819086
Author:     P J P <pjp@fedoraproject.org>
AuthorDate: Tue Sep 15 14:29:21 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Sep 15 14:37:38 2015 +0000

    net: avoid infinite loop when receiving packets(CVE-2015-5278)
    
    Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
    bytes to process network packets. While receiving packets
    via ne2000_receive() routine, a local 'index' variable
    could exceed the ring buffer size, leading to an infinite
    loop situation.
    
    upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    Signed-off-by: P J P <pjp@fedoraproject.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:34:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11: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 1Zoreu-0007ZC-2q; Wed, 21 Oct 2015 11:34:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zores-0007Yx-4u
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:18 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	AE/23-18744-93877265; Wed, 21 Oct 2015 11:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1445427255!23416364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15136 invoked from network); 21 Oct 2015 11:34:16 -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;
	21 Oct 2015 11:34:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorep-0005dN-Jb
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorep-0005XC-Dw
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:15 +0000
Date: Wed, 21 Oct 2015 11:34:15 +0000
Message-Id: <E1Zorep-0005XC-Dw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] block-vvfat: fix
	resource leaks in read_directory()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit bc00cad75d8bcc3ba696992bec219c21db8406aa
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:19:23 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix resource leaks in read_directory()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1055920 1055921
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:34:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11: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 1Zoreu-0007ZC-2q; Wed, 21 Oct 2015 11:34:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zores-0007Yx-4u
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:18 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	AE/23-18744-93877265; Wed, 21 Oct 2015 11:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1445427255!23416364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15136 invoked from network); 21 Oct 2015 11:34:16 -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;
	21 Oct 2015 11:34:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorep-0005dN-Jb
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorep-0005XC-Dw
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:15 +0000
Date: Wed, 21 Oct 2015 11:34:15 +0000
Message-Id: <E1Zorep-0005XC-Dw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] block-vvfat: fix
	resource leaks in read_directory()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit bc00cad75d8bcc3ba696992bec219c21db8406aa
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:19:23 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix resource leaks in read_directory()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1055920 1055921
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:34:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:34: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 1Zorf5-0007b0-5F; Wed, 21 Oct 2015 11:34:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorf3-0007al-9F
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:29 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	57/10-31069-44877265; Wed, 21 Oct 2015 11:34:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445427267!50893489!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1372 invoked from network); 21 Oct 2015 11:34:28 -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;
	21 Oct 2015 11:34:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorf0-0005dV-Tv
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorf0-0005Y8-EY
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:26 +0000
Date: Wed, 21 Oct 2015 11:34:26 +0000
Message-Id: <E1Zorf0-0005Y8-EY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] Fix build after
	"ui/vnc: limit client_cut_text msg payload size"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit 1c8d43cbdf0fc01a8f05acfbf55b805a83da34bb
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Sep 8 15:41:20 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Sep 8 15:42:31 2015 +0100

    Fix build after "ui/vnc: limit client_cut_text msg payload size"
    
    That backport (which also erroneously refers to ui/vnc.c rather than
    vnc.c in its commit message) broke the build because we do not have
    `error_report'.  Use fprintf to stderr, like the rest of the file.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:34:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:34: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 1Zorf5-0007b0-5F; Wed, 21 Oct 2015 11:34:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorf3-0007al-9F
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:29 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	57/10-31069-44877265; Wed, 21 Oct 2015 11:34:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445427267!50893489!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1372 invoked from network); 21 Oct 2015 11:34:28 -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;
	21 Oct 2015 11:34:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorf0-0005dV-Tv
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorf0-0005Y8-EY
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:26 +0000
Date: Wed, 21 Oct 2015 11:34:26 +0000
Message-Id: <E1Zorf0-0005Y8-EY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] Fix build after
	"ui/vnc: limit client_cut_text msg payload size"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit 1c8d43cbdf0fc01a8f05acfbf55b805a83da34bb
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Sep 8 15:41:20 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Sep 8 15:42:31 2015 +0100

    Fix build after "ui/vnc: limit client_cut_text msg payload size"
    
    That backport (which also erroneously refers to ui/vnc.c rather than
    vnc.c in its commit message) broke the build because we do not have
    `error_report'.  Use fprintf to stderr, like the rest of the file.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:34:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11: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 1ZorfF-0007cb-7i; Wed, 21 Oct 2015 11:34: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 1ZorfE-0007cP-61
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:40 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	18/D3-18744-F4877265; Wed, 21 Oct 2015 11:34:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1445427277!60181918!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 22856 invoked from network); 21 Oct 2015 11:34:38 -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;
	21 Oct 2015 11:34:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfB-0005di-Op
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfB-0005Z1-M8
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:37 +0000
Date: Wed, 21 Oct 2015 11:34:37 +0000
Message-Id: <E1ZorfB-0005Z1-M8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.5] vnc: limit
	client_cut_text msg payload size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0
Author:     Peter Lieven <pl@kamp.de>
AuthorDate: Mon Jun 30 10:07:54 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:20:38 2015 +0100

    vnc: limit client_cut_text msg payload size
    
    currently a malicious client could define a payload
    size of 2^32 - 1 bytes and send up to that size of
    data to the vnc server. The server would allocated
    that amount of memory which could easily create an
    out of memory condition.
    
    This patch limits the payload size to 1MB max.
    
    Please note that client_cut_text messages are currently
    silently ignored.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    
    Above is f9a70e79391f in qemu upstream.
    
    Cherry picked onto in qemu-xen-4.6-testing and qemu-xen-unstable:
    
    Conflicts:
    	ui/vnc.c
    Dropped { } style changes.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Above is 2b5684137e81 in qemu-xen-4.6-testing and qemu-xen-unstable,
    now being cherry picked onto qemu-xen-4.5-testing.  Also need
    1c8d43cbdf0f, its fixup patch:
    
    We do not have `error_report'.  Use fprintf to stderr, like the rest
    of the file.
    
    Fix commit message to refer to vnc.c, not ui/vnc.c.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Oct 21 11:34:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11: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 1ZorfF-0007cb-7i; Wed, 21 Oct 2015 11:34: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 1ZorfE-0007cP-61
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:40 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	18/D3-18744-F4877265; Wed, 21 Oct 2015 11:34:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1445427277!60181918!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 22856 invoked from network); 21 Oct 2015 11:34:38 -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;
	21 Oct 2015 11:34:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfB-0005di-Op
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfB-0005Z1-M8
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:37 +0000
Date: Wed, 21 Oct 2015 11:34:37 +0000
Message-Id: <E1ZorfB-0005Z1-M8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.5] vnc: limit
	client_cut_text msg payload size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0
Author:     Peter Lieven <pl@kamp.de>
AuthorDate: Mon Jun 30 10:07:54 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:20:38 2015 +0100

    vnc: limit client_cut_text msg payload size
    
    currently a malicious client could define a payload
    size of 2^32 - 1 bytes and send up to that size of
    data to the vnc server. The server would allocated
    that amount of memory which could easily create an
    out of memory condition.
    
    This patch limits the payload size to 1MB max.
    
    Please note that client_cut_text messages are currently
    silently ignored.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    
    Above is f9a70e79391f in qemu upstream.
    
    Cherry picked onto in qemu-xen-4.6-testing and qemu-xen-unstable:
    
    Conflicts:
    	ui/vnc.c
    Dropped { } style changes.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Above is 2b5684137e81 in qemu-xen-4.6-testing and qemu-xen-unstable,
    now being cherry picked onto qemu-xen-4.5-testing.  Also need
    1c8d43cbdf0f, its fixup patch:
    
    We do not have `error_report'.  Use fprintf to stderr, like the rest
    of the file.
    
    Fix commit message to refer to vnc.c, not ui/vnc.c.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Oct 21 11:34:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:34: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 1ZorfX-0007ee-AU; Wed, 21 Oct 2015 11:34:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfW-0007e7-Nh
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:58 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	94/CE-01748-A5877265; Wed, 21 Oct 2015 11:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445427289!50893643!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 5093 invoked from network); 21 Oct 2015 11:34:50 -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;
	21 Oct 2015 11:34:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfN-0005dq-6J
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfM-0005aV-LF
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:49 +0000
Date: Wed, 21 Oct 2015 11:34:48 +0000
Message-Id: <E1ZorfM-0005aV-LF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.4] vnc: limit
	client_cut_text msg payload size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit 5ae0569d964ad1a6d8dc781e5566d39210a5d063
Author:     Peter Lieven <pl@kamp.de>
AuthorDate: Mon Jun 30 10:07:54 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:25:40 2015 +0100

    vnc: limit client_cut_text msg payload size
    
    currently a malicious client could define a payload
    size of 2^32 - 1 bytes and send up to that size of
    data to the vnc server. The server would allocated
    that amount of memory which could easily create an
    out of memory condition.
    
    This patch limits the payload size to 1MB max.
    
    Please note that client_cut_text messages are currently
    silently ignored.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    
    Above is f9a70e79391f in qemu upstream.
    
    Cherry picked onto in qemu-xen-4.6-testing and qemu-xen-unstable:
    
    Conflicts:
    	ui/vnc.c
    Dropped { } style changes.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Above is 2b5684137e81 in qemu-xen-4.6-testing and qemu-xen-unstable,
    now being cherry picked onto qemu-xen-4.5-testing.  Also need
    1c8d43cbdf0f, its fixup patch:
    
    We do not have `error_report'.  Use fprintf to stderr, like the rest
    of the file.
    
    Fix commit message to refer to vnc.c, not ui/vnc.c.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Oct 21 11:34:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:34: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 1ZorfX-0007ee-AU; Wed, 21 Oct 2015 11:34:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfW-0007e7-Nh
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:58 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	94/CE-01748-A5877265; Wed, 21 Oct 2015 11:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445427289!50893643!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 5093 invoked from network); 21 Oct 2015 11:34:50 -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;
	21 Oct 2015 11:34:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfN-0005dq-6J
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfM-0005aV-LF
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:34:49 +0000
Date: Wed, 21 Oct 2015 11:34:48 +0000
Message-Id: <E1ZorfM-0005aV-LF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.4] vnc: limit
	client_cut_text msg payload size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit 5ae0569d964ad1a6d8dc781e5566d39210a5d063
Author:     Peter Lieven <pl@kamp.de>
AuthorDate: Mon Jun 30 10:07:54 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:25:40 2015 +0100

    vnc: limit client_cut_text msg payload size
    
    currently a malicious client could define a payload
    size of 2^32 - 1 bytes and send up to that size of
    data to the vnc server. The server would allocated
    that amount of memory which could easily create an
    out of memory condition.
    
    This patch limits the payload size to 1MB max.
    
    Please note that client_cut_text messages are currently
    silently ignored.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    
    Above is f9a70e79391f in qemu upstream.
    
    Cherry picked onto in qemu-xen-4.6-testing and qemu-xen-unstable:
    
    Conflicts:
    	ui/vnc.c
    Dropped { } style changes.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Above is 2b5684137e81 in qemu-xen-4.6-testing and qemu-xen-unstable,
    now being cherry picked onto qemu-xen-4.5-testing.  Also need
    1c8d43cbdf0f, its fixup patch:
    
    We do not have `error_report'.  Use fprintf to stderr, like the rest
    of the file.
    
    Fix commit message to refer to vnc.c, not ui/vnc.c.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Oct 21 11:35:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11: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 1Zorfb-0007fX-Cp; Wed, 21 Oct 2015 11:35: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 1Zorfa-0007fJ-Qs
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:02 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	AF/08-16618-66877265; Wed, 21 Oct 2015 11:35:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1445427300!57568587!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 24731 invoked from network); 21 Oct 2015 11:35:01 -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;
	21 Oct 2015 11:35:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfY-0005du-4y
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfY-0005bo-18
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:00 +0000
Date: Wed, 21 Oct 2015 11:35:00 +0000
Message-Id: <E1ZorfY-0005bo-18@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.3] vnc: limit
	client_cut_text msg payload size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit 1e5099d596b6f7a977d4bc040a54edc2a6a3c6a4
Author:     Peter Lieven <pl@kamp.de>
AuthorDate: Mon Jun 30 10:07:54 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:25:47 2015 +0100

    vnc: limit client_cut_text msg payload size
    
    currently a malicious client could define a payload
    size of 2^32 - 1 bytes and send up to that size of
    data to the vnc server. The server would allocated
    that amount of memory which could easily create an
    out of memory condition.
    
    This patch limits the payload size to 1MB max.
    
    Please note that client_cut_text messages are currently
    silently ignored.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    
    Above is f9a70e79391f in qemu upstream.
    
    Cherry picked onto in qemu-xen-4.6-testing and qemu-xen-unstable:
    
    Conflicts:
    	ui/vnc.c
    Dropped { } style changes.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Above is 2b5684137e81 in qemu-xen-4.6-testing and qemu-xen-unstable,
    now being cherry picked onto qemu-xen-4.5-testing.  Also need
    1c8d43cbdf0f, its fixup patch:
    
    We do not have `error_report'.  Use fprintf to stderr, like the rest
    of the file.
    
    Fix commit message to refer to vnc.c, not ui/vnc.c.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0)
    (cherry picked from commit 5ae0569d964ad1a6d8dc781e5566d39210a5d063)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:35:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11: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 1Zorfb-0007fX-Cp; Wed, 21 Oct 2015 11:35: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 1Zorfa-0007fJ-Qs
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:02 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	AF/08-16618-66877265; Wed, 21 Oct 2015 11:35:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1445427300!57568587!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 24731 invoked from network); 21 Oct 2015 11:35:01 -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;
	21 Oct 2015 11:35:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfY-0005du-4y
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZorfY-0005bo-18
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:00 +0000
Date: Wed, 21 Oct 2015 11:35:00 +0000
Message-Id: <E1ZorfY-0005bo-18@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.3] vnc: limit
	client_cut_text msg payload size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit 1e5099d596b6f7a977d4bc040a54edc2a6a3c6a4
Author:     Peter Lieven <pl@kamp.de>
AuthorDate: Mon Jun 30 10:07:54 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:25:47 2015 +0100

    vnc: limit client_cut_text msg payload size
    
    currently a malicious client could define a payload
    size of 2^32 - 1 bytes and send up to that size of
    data to the vnc server. The server would allocated
    that amount of memory which could easily create an
    out of memory condition.
    
    This patch limits the payload size to 1MB max.
    
    Please note that client_cut_text messages are currently
    silently ignored.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    
    Above is f9a70e79391f in qemu upstream.
    
    Cherry picked onto in qemu-xen-4.6-testing and qemu-xen-unstable:
    
    Conflicts:
    	ui/vnc.c
    Dropped { } style changes.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Above is 2b5684137e81 in qemu-xen-4.6-testing and qemu-xen-unstable,
    now being cherry picked onto qemu-xen-4.5-testing.  Also need
    1c8d43cbdf0f, its fixup patch:
    
    We do not have `error_report'.  Use fprintf to stderr, like the rest
    of the file.
    
    Fix commit message to refer to vnc.c, not ui/vnc.c.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0)
    (cherry picked from commit 5ae0569d964ad1a6d8dc781e5566d39210a5d063)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:35:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:35: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 1Zorfn-0007jF-Tq; Wed, 21 Oct 2015 11:35:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorfm-0007is-8G
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:14 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	82/79-10715-17877265; Wed, 21 Oct 2015 11:35:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1445427311!41448911!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 30615 invoked from network); 21 Oct 2015 11:35:12 -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;
	21 Oct 2015 11:35:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorfj-0005ed-5q
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorfj-0005cx-0w
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:11 +0000
Date: Wed, 21 Oct 2015 11:35:11 +0000
Message-Id: <E1Zorfj-0005cx-0w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.2] vnc: limit
	client_cut_text msg payload size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit 112599882987da1afbbe4c16f6b049065a64f065
Author:     Peter Lieven <pl@kamp.de>
AuthorDate: Mon Jun 30 10:07:54 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:25:50 2015 +0100

    vnc: limit client_cut_text msg payload size
    
    currently a malicious client could define a payload
    size of 2^32 - 1 bytes and send up to that size of
    data to the vnc server. The server would allocated
    that amount of memory which could easily create an
    out of memory condition.
    
    This patch limits the payload size to 1MB max.
    
    Please note that client_cut_text messages are currently
    silently ignored.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    
    Above is f9a70e79391f in qemu upstream.
    
    Cherry picked onto in qemu-xen-4.6-testing and qemu-xen-unstable:
    
    Conflicts:
    	ui/vnc.c
    Dropped { } style changes.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Above is 2b5684137e81 in qemu-xen-4.6-testing and qemu-xen-unstable,
    now being cherry picked onto qemu-xen-4.5-testing.  Also need
    1c8d43cbdf0f, its fixup patch:
    
    We do not have `error_report'.  Use fprintf to stderr, like the rest
    of the file.
    
    Fix commit message to refer to vnc.c, not ui/vnc.c.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0)
    (cherry picked from commit 5ae0569d964ad1a6d8dc781e5566d39210a5d063)
    (cherry picked from commit 1e5099d596b6f7a977d4bc040a54edc2a6a3c6a4)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:35:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:35: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 1Zorfn-0007jF-Tq; Wed, 21 Oct 2015 11:35:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorfm-0007is-8G
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:14 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	82/79-10715-17877265; Wed, 21 Oct 2015 11:35:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1445427311!41448911!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 30615 invoked from network); 21 Oct 2015 11:35:12 -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;
	21 Oct 2015 11:35:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorfj-0005ed-5q
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorfj-0005cx-0w
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:11 +0000
Date: Wed, 21 Oct 2015 11:35:11 +0000
Message-Id: <E1Zorfj-0005cx-0w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.2] vnc: limit
	client_cut_text msg payload size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***

commit 112599882987da1afbbe4c16f6b049065a64f065
Author:     Peter Lieven <pl@kamp.de>
AuthorDate: Mon Jun 30 10:07:54 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Sep 11 11:25:50 2015 +0100

    vnc: limit client_cut_text msg payload size
    
    currently a malicious client could define a payload
    size of 2^32 - 1 bytes and send up to that size of
    data to the vnc server. The server would allocated
    that amount of memory which could easily create an
    out of memory condition.
    
    This patch limits the payload size to 1MB max.
    
    Please note that client_cut_text messages are currently
    silently ignored.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    
    Above is f9a70e79391f in qemu upstream.
    
    Cherry picked onto in qemu-xen-4.6-testing and qemu-xen-unstable:
    
    Conflicts:
    	ui/vnc.c
    Dropped { } style changes.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Above is 2b5684137e81 in qemu-xen-4.6-testing and qemu-xen-unstable,
    now being cherry picked onto qemu-xen-4.5-testing.  Also need
    1c8d43cbdf0f, its fixup patch:
    
    We do not have `error_report'.  Use fprintf to stderr, like the rest
    of the file.
    
    Fix commit message to refer to vnc.c, not ui/vnc.c.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0)
    (cherry picked from commit 5ae0569d964ad1a6d8dc781e5566d39210a5d063)
    (cherry picked from commit 1e5099d596b6f7a977d4bc040a54edc2a6a3c6a4)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:35:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:35: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 1Zorfy-0007lY-05; Wed, 21 Oct 2015 11:35:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorfw-0007lB-Ra
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:24 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	4E/71-12889-B7877265; Wed, 21 Oct 2015 11:35:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1445427322!27883524!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2316 invoked from network); 21 Oct 2015 11:35:23 -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;
	21 Oct 2015 11:35:23 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorft-0005el-WD
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorft-0005dk-SB
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:21 +0000
Date: Wed, 21 Oct 2015 11:35:21 +0000
Message-Id: <E1Zorft-0005dk-SB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.1] pcnet: force the
	buffer access to be in bounds during tx
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit 77d9bdb27c4237a007ba93a6f159791eed317abc
Author:     Petr Matousek <pmatouse@redhat.com>
AuthorDate: Sun May 24 10:53:44 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jun 23 11:44:30 2015 +0100

    pcnet: force the buffer access to be in bounds during tx
    
    4096 is the maximum length per TMD and it is also currently the size of
    the relay buffer pcnet driver uses for sending the packet data to QEMU
    for further processing. With packet spanning multiple TMDs it can
    happen that the overall packet size will be bigger than sizeof(buffer),
    which results in memory corruption.
    
    Fix this by only allowing to queue maximum sizeof(buffer) bytes.
    
    This is CVE-2015-3209.
    
    Signed-off-by: Petr Matousek <pmatouse@redhat.com>
    Reported-by: Matt Tait <matttait@google.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 11:35:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 11:35: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 1Zorfy-0007lY-05; Wed, 21 Oct 2015 11:35:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorfw-0007lB-Ra
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:24 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	4E/71-12889-B7877265; Wed, 21 Oct 2015 11:35:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1445427322!27883524!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2316 invoked from network); 21 Oct 2015 11:35:23 -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;
	21 Oct 2015 11:35:23 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorft-0005el-WD
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zorft-0005dk-SB
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 11:35:21 +0000
Date: Wed, 21 Oct 2015 11:35:21 +0000
Message-Id: <E1Zorft-0005dk-SB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.1] pcnet: force the
	buffer access to be in bounds during tx
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ***

commit 77d9bdb27c4237a007ba93a6f159791eed317abc
Author:     Petr Matousek <pmatouse@redhat.com>
AuthorDate: Sun May 24 10:53:44 2015 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jun 23 11:44:30 2015 +0100

    pcnet: force the buffer access to be in bounds during tx
    
    4096 is the maximum length per TMD and it is also currently the size of
    the relay buffer pcnet driver uses for sending the packet data to QEMU
    for further processing. With packet spanning multiple TMDs it can
    happen that the overall packet size will be bigger than sizeof(buffer),
    which results in memory corruption.
    
    Fix this by only allowing to queue maximum sizeof(buffer) bytes.
    
    This is CVE-2015-3209.
    
    Signed-off-by: Petr Matousek <pmatouse@redhat.com>
    Reported-by: Matt Tait <matttait@google.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Wed Oct 21 12:55:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 12:55: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 1ZosvA-0005Kc-0E; Wed, 21 Oct 2015 12:55:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zosv9-0005KU-4T
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:11 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	A9/D1-00536-E2B87265; Wed, 21 Oct 2015 12:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445432108!22534548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31805 invoked from network); 21 Oct 2015 12:55:09 -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;
	21 Oct 2015 12:55:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zosv4-0006QY-ON
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zosv2-0001Gq-Gn
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:05 +0000
Date: Wed, 21 Oct 2015 12:55:04 +0000
Message-Id: <E1Zosv2-0001Gq-Gn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] tools: libxl: allow permissive
	qemu-upstream pci passthrough.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5461ad29be44cdc0efb9f200a119f2a46a0ec059
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 11:32:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:04 2015 +0100

    tools: libxl: allow permissive qemu-upstream pci passthrough.
    
    Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In
    order to allow local configuration of the existing libxl_device_pci
    "permissive" flag needs to be plumbed through via the new QMP property
    added by the XSA-131 patches.
    
    Versions of QEMU prior to XSA-131 did not support this permissive
    property, so we only pass it if it is true. Older versions only
    supported permissive mode.
    
    qemu-xen-traditional already supports the permissive mode setting via
    xenstore.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 015a373351e5c3553f848324ac0f07a9d92883fa)
---
 tools/libxl/libxl_qmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index c7324e6..25b62cd 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -828,6 +828,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
         QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
                                PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
+    /*
+     * Version of QEMU prior to the XSA-131 fix did not support this
+     * property and were effectively always in permissive mode. The
+     * fix for XSA-131 switched the default to be restricted by
+     * default and added the permissive property.
+     *
+     * Therefore in order to support both old and new QEMU we only set
+     * the permissive flag if it is true. Users of older QEMU have no
+     * reason to set the flag so this is ok.
+     */
+    if (pcidev->permissive)
+        qmp_parameters_add_bool(gc, &args, "permissive", true);
 
     rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
--
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 Oct 21 12:55:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 12:55: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 1ZosvA-0005Kc-0E; Wed, 21 Oct 2015 12:55:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zosv9-0005KU-4T
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:11 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	A9/D1-00536-E2B87265; Wed, 21 Oct 2015 12:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445432108!22534548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31805 invoked from network); 21 Oct 2015 12:55:09 -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;
	21 Oct 2015 12:55:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zosv4-0006QY-ON
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zosv2-0001Gq-Gn
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:05 +0000
Date: Wed, 21 Oct 2015 12:55:04 +0000
Message-Id: <E1Zosv2-0001Gq-Gn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] tools: libxl: allow permissive
	qemu-upstream pci passthrough.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5461ad29be44cdc0efb9f200a119f2a46a0ec059
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 11:32:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:04 2015 +0100

    tools: libxl: allow permissive qemu-upstream pci passthrough.
    
    Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In
    order to allow local configuration of the existing libxl_device_pci
    "permissive" flag needs to be plumbed through via the new QMP property
    added by the XSA-131 patches.
    
    Versions of QEMU prior to XSA-131 did not support this permissive
    property, so we only pass it if it is true. Older versions only
    supported permissive mode.
    
    qemu-xen-traditional already supports the permissive mode setting via
    xenstore.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 015a373351e5c3553f848324ac0f07a9d92883fa)
---
 tools/libxl/libxl_qmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index c7324e6..25b62cd 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -828,6 +828,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
         QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
                                PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
+    /*
+     * Version of QEMU prior to the XSA-131 fix did not support this
+     * property and were effectively always in permissive mode. The
+     * fix for XSA-131 switched the default to be restricted by
+     * default and added the permissive property.
+     *
+     * Therefore in order to support both old and new QEMU we only set
+     * the permissive flag if it is true. Users of older QEMU have no
+     * reason to set the flag so this is ok.
+     */
+    if (pcidev->permissive)
+        qmp_parameters_add_bool(gc, &args, "permissive", true);
 
     rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
--
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 Oct 21 12:55:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 12:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZosvN-0005M5-2n; Wed, 21 Oct 2015 12:55: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 1ZosvL-0005Lt-Ic
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:23 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	42/5E-30270-A3B87265; Wed, 21 Oct 2015 12:55:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1445432119!39845012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19259 invoked from network); 21 Oct 2015 12:55:19 -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;
	21 Oct 2015 12:55:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZosvG-0006RQ-Uc
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZosvG-0001HL-PN
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:18 +0000
Date: Wed, 21 Oct 2015 12:55:18 +0000
Message-Id: <E1ZosvG-0001HL-PN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 80e9f5624f9d1ef2e7bbd9b9b185e96b45e1bb17
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:09 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 622ea53..620acef 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -613,14 +613,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -651,9 +654,8 @@ default.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
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 Oct 21 12:55:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2015 12:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZosvN-0005M5-2n; Wed, 21 Oct 2015 12:55: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 1ZosvL-0005Lt-Ic
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:23 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	42/5E-30270-A3B87265; Wed, 21 Oct 2015 12:55:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1445432119!39845012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19259 invoked from network); 21 Oct 2015 12:55:19 -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;
	21 Oct 2015 12:55:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZosvG-0006RQ-Uc
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZosvG-0001HL-PN
	for xen-changelog@lists.xensource.com; Wed, 21 Oct 2015 12:55:18 +0000
Date: Wed, 21 Oct 2015 12:55:18 +0000
Message-Id: <E1ZosvG-0001HL-PN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 80e9f5624f9d1ef2e7bbd9b9b185e96b45e1bb17
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:09 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 622ea53..620acef 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -613,14 +613,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -651,9 +654,8 @@ default.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
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 Oct 22 13:33:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2015 13:33: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 1ZpFzR-0003Kr-1H; Thu, 22 Oct 2015 13:33:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzP-0003Kj-Gr
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:07 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	31/B5-00475-295E8265; Thu, 22 Oct 2015 13:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1445520784!54515967!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12710 invoked from network); 22 Oct 2015 13:33:05 -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;
	22 Oct 2015 13:33:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzM-0004nG-J2
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 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 1ZpFzM-0002be-3a
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:04 +0000
Date: Thu, 22 Oct 2015 13:33:04 +0000
Message-Id: <E1ZpFzM-0002be-3a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] tools/console: xenconsole tolerate
	tty errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b161be2e51c519754ac4435d63c8fc03db606ec
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Feb 27 17:46:49 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:49:41 2015 +0100

    tools/console: xenconsole tolerate tty errors
    
    Since 28d386fc4341 (XSA-57), libxl writes an empty value for the
    console tty node, with read-only permission for the guest, when
    setting up pv console "frontends".  (The actual tty value is later set
    by xenconsoled.)   Writing an empty node is not strictly necessary to
    stop the frontend from writing dangerous values here, but it is a good
    belt-and-braces approach.
    
    Unfortunately this confuses xenconsole.  It reads the empty value, and
    tries to open it as the tty.  xenconsole then exits.
    
    Fix this by having xenconsole treat an empty value the same way as no
    value at all.
    
    Also, make the error opening the tty be nonfatal: we just print a
    warning, but do not exit.  I think this is helpful in theoretical
    situations where xenconsole is racing with libxl and/or xenconsoled.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
    
    ---
    v2: Combine two conditions and move the free
    (cherry picked from commit 39ba2989b10b6a1852e253b204eb010f8e7026f1)
---
 tools/console/client/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 3242008..dd040a7 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -115,12 +115,12 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 			/* We only watch for one thing, so no need to 
 			 * disambiguate: just read the pty path */
 			pty_path = xs_read(xs, XBT_NULL, path, &len);
-			if (pty_path != NULL) {
+			if (pty_path != NULL && pty_path[0] != '\0') {
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1)
-					err(errno, "Could not open tty `%s'", pty_path);
-				free(pty_path);
+					warn("Could not open tty `%s'", pty_path);
 			}
+			free(pty_path);
 		}
 	} while (pty_fd == -1 && (now = time(NULL)) < start + seconds);
 
--
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 Oct 22 13:33:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2015 13:33: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 1ZpFzR-0003Kr-1H; Thu, 22 Oct 2015 13:33:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzP-0003Kj-Gr
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:07 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	31/B5-00475-295E8265; Thu, 22 Oct 2015 13:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1445520784!54515967!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12710 invoked from network); 22 Oct 2015 13:33:05 -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;
	22 Oct 2015 13:33:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzM-0004nG-J2
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 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 1ZpFzM-0002be-3a
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:04 +0000
Date: Thu, 22 Oct 2015 13:33:04 +0000
Message-Id: <E1ZpFzM-0002be-3a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] tools/console: xenconsole tolerate
	tty errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b161be2e51c519754ac4435d63c8fc03db606ec
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Feb 27 17:46:49 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:49:41 2015 +0100

    tools/console: xenconsole tolerate tty errors
    
    Since 28d386fc4341 (XSA-57), libxl writes an empty value for the
    console tty node, with read-only permission for the guest, when
    setting up pv console "frontends".  (The actual tty value is later set
    by xenconsoled.)   Writing an empty node is not strictly necessary to
    stop the frontend from writing dangerous values here, but it is a good
    belt-and-braces approach.
    
    Unfortunately this confuses xenconsole.  It reads the empty value, and
    tries to open it as the tty.  xenconsole then exits.
    
    Fix this by having xenconsole treat an empty value the same way as no
    value at all.
    
    Also, make the error opening the tty be nonfatal: we just print a
    warning, but do not exit.  I think this is helpful in theoretical
    situations where xenconsole is racing with libxl and/or xenconsoled.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
    
    ---
    v2: Combine two conditions and move the free
    (cherry picked from commit 39ba2989b10b6a1852e253b204eb010f8e7026f1)
---
 tools/console/client/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 3242008..dd040a7 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -115,12 +115,12 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 			/* We only watch for one thing, so no need to 
 			 * disambiguate: just read the pty path */
 			pty_path = xs_read(xs, XBT_NULL, path, &len);
-			if (pty_path != NULL) {
+			if (pty_path != NULL && pty_path[0] != '\0') {
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1)
-					err(errno, "Could not open tty `%s'", pty_path);
-				free(pty_path);
+					warn("Could not open tty `%s'", pty_path);
 			}
+			free(pty_path);
 		}
 	} while (pty_fd == -1 && (now = time(NULL)) < start + seconds);
 
--
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 Oct 22 13:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2015 13: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 1ZpFzb-0003Lk-3h; Thu, 22 Oct 2015 13: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 1ZpFzZ-0003LZ-VI
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:18 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	22/96-12889-C95E8265; Thu, 22 Oct 2015 13:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1445520795!60634656!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8835 invoked from network); 22 Oct 2015 13:33:16 -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;
	22 Oct 2015 13:33:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzW-0004nT-Um
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzW-0002cm-RW
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:14 +0000
Date: Thu, 22 Oct 2015 13:33:14 +0000
Message-Id: <E1ZpFzW-0002cm-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] tools: libxl: allow permissive
	qemu-upstream pci passthrough.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de3e45c2ec473aebcaf24aa14ec0c2d77ae014e2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 11:32:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:23 2015 +0100

    tools: libxl: allow permissive qemu-upstream pci passthrough.
    
    Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In
    order to allow local configuration of the existing libxl_device_pci
    "permissive" flag needs to be plumbed through via the new QMP property
    added by the XSA-131 patches.
    
    Versions of QEMU prior to XSA-131 did not support this permissive
    property, so we only pass it if it is true. Older versions only
    supported permissive mode.
    
    qemu-xen-traditional already supports the permissive mode setting via
    xenstore.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 015a373351e5c3553f848324ac0f07a9d92883fa)
---
 tools/libxl/libxl_qmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index 8433e42..0b30002 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -833,6 +833,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
         QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
                                PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
+    /*
+     * Version of QEMU prior to the XSA-131 fix did not support this
+     * property and were effectively always in permissive mode. The
+     * fix for XSA-131 switched the default to be restricted by
+     * default and added the permissive property.
+     *
+     * Therefore in order to support both old and new QEMU we only set
+     * the permissive flag if it is true. Users of older QEMU have no
+     * reason to set the flag so this is ok.
+     */
+    if (pcidev->permissive)
+        qmp_parameters_add_bool(gc, &args, "permissive", true);
 
     rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
--
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 Oct 22 13:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2015 13: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 1ZpFzb-0003Lk-3h; Thu, 22 Oct 2015 13: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 1ZpFzZ-0003LZ-VI
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:18 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	22/96-12889-C95E8265; Thu, 22 Oct 2015 13:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1445520795!60634656!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8835 invoked from network); 22 Oct 2015 13:33:16 -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;
	22 Oct 2015 13:33:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzW-0004nT-Um
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzW-0002cm-RW
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:14 +0000
Date: Thu, 22 Oct 2015 13:33:14 +0000
Message-Id: <E1ZpFzW-0002cm-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] tools: libxl: allow permissive
	qemu-upstream pci passthrough.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de3e45c2ec473aebcaf24aa14ec0c2d77ae014e2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 11:32:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:23 2015 +0100

    tools: libxl: allow permissive qemu-upstream pci passthrough.
    
    Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In
    order to allow local configuration of the existing libxl_device_pci
    "permissive" flag needs to be plumbed through via the new QMP property
    added by the XSA-131 patches.
    
    Versions of QEMU prior to XSA-131 did not support this permissive
    property, so we only pass it if it is true. Older versions only
    supported permissive mode.
    
    qemu-xen-traditional already supports the permissive mode setting via
    xenstore.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 015a373351e5c3553f848324ac0f07a9d92883fa)
---
 tools/libxl/libxl_qmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index 8433e42..0b30002 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -833,6 +833,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
         QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
                                PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
+    /*
+     * Version of QEMU prior to the XSA-131 fix did not support this
+     * property and were effectively always in permissive mode. The
+     * fix for XSA-131 switched the default to be restricted by
+     * default and added the permissive property.
+     *
+     * Therefore in order to support both old and new QEMU we only set
+     * the permissive flag if it is true. Users of older QEMU have no
+     * reason to set the flag so this is ok.
+     */
+    if (pcidev->permissive)
+        qmp_parameters_add_bool(gc, &args, "permissive", true);
 
     rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
--
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 Oct 22 13:33:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2015 13:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpFzn-0003NU-6F; Thu, 22 Oct 2015 13:33:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzl-0003NI-Jb
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:29 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	11/AA-24856-8A5E8265; Thu, 22 Oct 2015 13:33:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1445520806!28574634!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13917 invoked from network); 22 Oct 2015 13:33:27 -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;
	22 Oct 2015 13:33:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzh-0004ne-6Q
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 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 1ZpFzh-0002dD-4Z
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:25 +0000
Date: Thu, 22 Oct 2015 13:33:25 +0000
Message-Id: <E1ZpFzh-0002dD-4Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e321898a39222ad1feef352d65f71cef362b4a16
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:24 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e15a49f..5f34f0b 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -492,14 +492,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -521,9 +524,8 @@ default.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
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 Oct 22 13:33:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2015 13:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpFzn-0003NU-6F; Thu, 22 Oct 2015 13:33:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzl-0003NI-Jb
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:29 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	11/AA-24856-8A5E8265; Thu, 22 Oct 2015 13:33:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1445520806!28574634!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13917 invoked from network); 22 Oct 2015 13:33:27 -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;
	22 Oct 2015 13:33:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpFzh-0004ne-6Q
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 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 1ZpFzh-0002dD-4Z
	for xen-changelog@lists.xensource.com; Thu, 22 Oct 2015 13:33:25 +0000
Date: Thu, 22 Oct 2015 13:33:25 +0000
Message-Id: <E1ZpFzh-0002dD-4Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e321898a39222ad1feef352d65f71cef362b4a16
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:24 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e15a49f..5f34f0b 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -492,14 +492,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -521,9 +524,8 @@ default.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
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 Oct 23 10:33:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 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 1ZpZem-0000ex-SS; Fri, 23 Oct 2015 10:33:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZel-0000es-No
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:07 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E0/ED-29649-3EC0A265; Fri, 23 Oct 2015 10:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445596385!21429218!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26588 invoked from network); 23 Oct 2015 10:33:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:33:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZej-0000tM-6W
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 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 1ZpZei-0006Og-RH
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:05 +0000
Date: Fri, 23 Oct 2015 10:33:04 +0000
Message-Id: <E1ZpZei-0006Og-RH@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 fcaa140b320a7f4b6d120ce79a096d5ae01a24f4
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Oct 20 15:46:26 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 15:46:26 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index 0e5b51b..b9a37d9 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 ?= 1c8d43cbdf0fc01a8f05acfbf55b805a83da34bb
-# Tue Sep 8 15:41:20 2015 +0100
-# Fix build after "ui/vnc: limit client_cut_text msg payload size"
+QEMU_TRADITIONAL_REVISION ?= bc00cad75d8bcc3ba696992bec219c21db8406aa
+# Tue Mar 11 10:19:23 2014 +0000
+# block-vvfat: fix resource leaks in read_directory()
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:33:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 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 1ZpZem-0000ex-SS; Fri, 23 Oct 2015 10:33:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZel-0000es-No
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:07 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E0/ED-29649-3EC0A265; Fri, 23 Oct 2015 10:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1445596385!21429218!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26588 invoked from network); 23 Oct 2015 10:33:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:33:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZej-0000tM-6W
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 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 1ZpZei-0006Og-RH
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:05 +0000
Date: Fri, 23 Oct 2015 10:33:04 +0000
Message-Id: <E1ZpZei-0006Og-RH@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 fcaa140b320a7f4b6d120ce79a096d5ae01a24f4
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Oct 20 15:46:26 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 15:46:26 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index 0e5b51b..b9a37d9 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 ?= 1c8d43cbdf0fc01a8f05acfbf55b805a83da34bb
-# Tue Sep 8 15:41:20 2015 +0100
-# Fix build after "ui/vnc: limit client_cut_text msg payload size"
+QEMU_TRADITIONAL_REVISION ?= bc00cad75d8bcc3ba696992bec219c21db8406aa
+# Tue Mar 11 10:19:23 2014 +0000
+# block-vvfat: fix resource leaks in read_directory()
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 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 1ZpZex-0000fd-Uz; Fri, 23 Oct 2015 10: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 1ZpZew-0000fU-E3
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:18 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	89/9E-16965-DEC0A265; Fri, 23 Oct 2015 10:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445596395!6552073!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 9429 invoked from network); 23 Oct 2015 10:33:16 -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;
	23 Oct 2015 10:33:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZet-0000tR-Ey
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 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 1ZpZet-0006P6-CH
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:15 +0000
Date: Fri, 23 Oct 2015 10:33:15 +0000
Message-Id: <E1ZpZet-0006P6-CH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: re-order definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5e6c75bb0da85b2021c80d7b27bef77a00c1da2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:47:54 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:47:54 2015 +0200

    VMX: re-order definitions
    
    ... so they end up reasonably sorted, easing lookup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/include/asm-x86/hvm/vmx/vmcs.h |   37 +++++++++++++++++------------------
 xen/include/asm-x86/hvm/vmx/vmx.h  |   15 ++++---------
 2 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index f1126d4..1a71de6 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -227,27 +227,26 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
 extern u32 vmx_secondary_exec_control;
 
-#define VMX_EPT_EXEC_ONLY_SUPPORTED             0x00000001
-#define VMX_EPT_WALK_LENGTH_4_SUPPORTED         0x00000040
-#define VMX_EPT_MEMORY_TYPE_UC                  0x00000100
-#define VMX_EPT_MEMORY_TYPE_WB                  0x00004000
-#define VMX_EPT_SUPERPAGE_2MB                   0x00010000
-#define VMX_EPT_SUPERPAGE_1GB                   0x00020000
-#define VMX_EPT_INVEPT_INSTRUCTION              0x00100000
-#define VMX_EPT_INVEPT_SINGLE_CONTEXT           0x02000000
-#define VMX_EPT_INVEPT_ALL_CONTEXT              0x04000000
-#define VMX_EPT_AD_BIT                          0x00200000
-
+#define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
+#define VMX_EPT_WALK_LENGTH_4_SUPPORTED                     0x00000040
+#define VMX_EPT_MEMORY_TYPE_UC                              0x00000100
+#define VMX_EPT_MEMORY_TYPE_WB                              0x00004000
+#define VMX_EPT_SUPERPAGE_2MB                               0x00010000
+#define VMX_EPT_SUPERPAGE_1GB                               0x00020000
+#define VMX_EPT_INVEPT_INSTRUCTION                          0x00100000
+#define VMX_EPT_AD_BIT                                      0x00200000
+#define VMX_EPT_INVEPT_SINGLE_CONTEXT                       0x02000000
+#define VMX_EPT_INVEPT_ALL_CONTEXT                          0x04000000
+#define VMX_VPID_INVVPID_INSTRUCTION                     0x00100000000ULL
+#define VMX_VPID_INVVPID_INDIVIDUAL_ADDR                 0x10000000000ULL
+#define VMX_VPID_INVVPID_SINGLE_CONTEXT                  0x20000000000ULL
+#define VMX_VPID_INVVPID_ALL_CONTEXT                     0x40000000000ULL
+#define VMX_VPID_INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 0x80000000000ULL
+extern u64 vmx_ept_vpid_cap;
+
+#define VMX_MISC_CR3_TARGET                     0x01ff0000
 #define VMX_MISC_VMWRITE_ALL                    0x20000000
 
-#define VMX_VPID_INVVPID_INSTRUCTION                        0x100000000ULL
-#define VMX_VPID_INVVPID_INDIVIDUAL_ADDR                    0x10000000000ULL
-#define VMX_VPID_INVVPID_SINGLE_CONTEXT                     0x20000000000ULL
-#define VMX_VPID_INVVPID_ALL_CONTEXT                        0x40000000000ULL
-#define VMX_VPID_INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL    0x80000000000ULL
-
-#define VMX_MISC_CR3_TARGET             0x1ff0000
-
 #define cpu_has_wbinvd_exiting \
     (vmx_secondary_exec_control & SECONDARY_EXEC_WBINVD_EXITING)
 #define cpu_has_vmx_virtualize_apic_accesses \
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 2ed62f9..e750a76 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -246,7 +246,6 @@ static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
 #define MODRM_EAX_07    ".byte 0x38\n" /* [EAX], with reg/opcode: /7 */
 #define MODRM_EAX_ECX   ".byte 0xc1\n" /* EAX, ECX */
 
-extern u64 vmx_ept_vpid_cap;
 extern uint8_t posted_intr_vector;
 
 #define cpu_has_vmx_ept_exec_only_supported        \
@@ -254,15 +253,11 @@ extern uint8_t posted_intr_vector;
 
 #define cpu_has_vmx_ept_wl4_supported           \
     (vmx_ept_vpid_cap & VMX_EPT_WALK_LENGTH_4_SUPPORTED)
-#define cpu_has_vmx_ept_mt_uc                   \
-    (vmx_ept_vpid_cap & VMX_EPT_MEMORY_TYPE_UC)
-#define cpu_has_vmx_ept_mt_wb                   \
-    (vmx_ept_vpid_cap & VMX_EPT_MEMORY_TYPE_WB)
-#define cpu_has_vmx_ept_1gb                     \
-    (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_1GB)
-#define cpu_has_vmx_ept_2mb                     \
-    (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_2MB)
-#define cpu_has_vmx_ept_ad (vmx_ept_vpid_cap & VMX_EPT_AD_BIT)
+#define cpu_has_vmx_ept_mt_uc (vmx_ept_vpid_cap & VMX_EPT_MEMORY_TYPE_UC)
+#define cpu_has_vmx_ept_mt_wb (vmx_ept_vpid_cap & VMX_EPT_MEMORY_TYPE_WB)
+#define cpu_has_vmx_ept_2mb   (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_2MB)
+#define cpu_has_vmx_ept_1gb   (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_1GB)
+#define cpu_has_vmx_ept_ad    (vmx_ept_vpid_cap & VMX_EPT_AD_BIT)
 #define cpu_has_vmx_ept_invept_single_context   \
     (vmx_ept_vpid_cap & VMX_EPT_INVEPT_SINGLE_CONTEXT)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 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 1ZpZex-0000fd-Uz; Fri, 23 Oct 2015 10: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 1ZpZew-0000fU-E3
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:18 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	89/9E-16965-DEC0A265; Fri, 23 Oct 2015 10:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445596395!6552073!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 9429 invoked from network); 23 Oct 2015 10:33:16 -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;
	23 Oct 2015 10:33:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZet-0000tR-Ey
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 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 1ZpZet-0006P6-CH
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:15 +0000
Date: Fri, 23 Oct 2015 10:33:15 +0000
Message-Id: <E1ZpZet-0006P6-CH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: re-order definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5e6c75bb0da85b2021c80d7b27bef77a00c1da2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:47:54 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:47:54 2015 +0200

    VMX: re-order definitions
    
    ... so they end up reasonably sorted, easing lookup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/include/asm-x86/hvm/vmx/vmcs.h |   37 +++++++++++++++++------------------
 xen/include/asm-x86/hvm/vmx/vmx.h  |   15 ++++---------
 2 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index f1126d4..1a71de6 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -227,27 +227,26 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
 extern u32 vmx_secondary_exec_control;
 
-#define VMX_EPT_EXEC_ONLY_SUPPORTED             0x00000001
-#define VMX_EPT_WALK_LENGTH_4_SUPPORTED         0x00000040
-#define VMX_EPT_MEMORY_TYPE_UC                  0x00000100
-#define VMX_EPT_MEMORY_TYPE_WB                  0x00004000
-#define VMX_EPT_SUPERPAGE_2MB                   0x00010000
-#define VMX_EPT_SUPERPAGE_1GB                   0x00020000
-#define VMX_EPT_INVEPT_INSTRUCTION              0x00100000
-#define VMX_EPT_INVEPT_SINGLE_CONTEXT           0x02000000
-#define VMX_EPT_INVEPT_ALL_CONTEXT              0x04000000
-#define VMX_EPT_AD_BIT                          0x00200000
-
+#define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
+#define VMX_EPT_WALK_LENGTH_4_SUPPORTED                     0x00000040
+#define VMX_EPT_MEMORY_TYPE_UC                              0x00000100
+#define VMX_EPT_MEMORY_TYPE_WB                              0x00004000
+#define VMX_EPT_SUPERPAGE_2MB                               0x00010000
+#define VMX_EPT_SUPERPAGE_1GB                               0x00020000
+#define VMX_EPT_INVEPT_INSTRUCTION                          0x00100000
+#define VMX_EPT_AD_BIT                                      0x00200000
+#define VMX_EPT_INVEPT_SINGLE_CONTEXT                       0x02000000
+#define VMX_EPT_INVEPT_ALL_CONTEXT                          0x04000000
+#define VMX_VPID_INVVPID_INSTRUCTION                     0x00100000000ULL
+#define VMX_VPID_INVVPID_INDIVIDUAL_ADDR                 0x10000000000ULL
+#define VMX_VPID_INVVPID_SINGLE_CONTEXT                  0x20000000000ULL
+#define VMX_VPID_INVVPID_ALL_CONTEXT                     0x40000000000ULL
+#define VMX_VPID_INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 0x80000000000ULL
+extern u64 vmx_ept_vpid_cap;
+
+#define VMX_MISC_CR3_TARGET                     0x01ff0000
 #define VMX_MISC_VMWRITE_ALL                    0x20000000
 
-#define VMX_VPID_INVVPID_INSTRUCTION                        0x100000000ULL
-#define VMX_VPID_INVVPID_INDIVIDUAL_ADDR                    0x10000000000ULL
-#define VMX_VPID_INVVPID_SINGLE_CONTEXT                     0x20000000000ULL
-#define VMX_VPID_INVVPID_ALL_CONTEXT                        0x40000000000ULL
-#define VMX_VPID_INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL    0x80000000000ULL
-
-#define VMX_MISC_CR3_TARGET             0x1ff0000
-
 #define cpu_has_wbinvd_exiting \
     (vmx_secondary_exec_control & SECONDARY_EXEC_WBINVD_EXITING)
 #define cpu_has_vmx_virtualize_apic_accesses \
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 2ed62f9..e750a76 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -246,7 +246,6 @@ static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
 #define MODRM_EAX_07    ".byte 0x38\n" /* [EAX], with reg/opcode: /7 */
 #define MODRM_EAX_ECX   ".byte 0xc1\n" /* EAX, ECX */
 
-extern u64 vmx_ept_vpid_cap;
 extern uint8_t posted_intr_vector;
 
 #define cpu_has_vmx_ept_exec_only_supported        \
@@ -254,15 +253,11 @@ extern uint8_t posted_intr_vector;
 
 #define cpu_has_vmx_ept_wl4_supported           \
     (vmx_ept_vpid_cap & VMX_EPT_WALK_LENGTH_4_SUPPORTED)
-#define cpu_has_vmx_ept_mt_uc                   \
-    (vmx_ept_vpid_cap & VMX_EPT_MEMORY_TYPE_UC)
-#define cpu_has_vmx_ept_mt_wb                   \
-    (vmx_ept_vpid_cap & VMX_EPT_MEMORY_TYPE_WB)
-#define cpu_has_vmx_ept_1gb                     \
-    (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_1GB)
-#define cpu_has_vmx_ept_2mb                     \
-    (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_2MB)
-#define cpu_has_vmx_ept_ad (vmx_ept_vpid_cap & VMX_EPT_AD_BIT)
+#define cpu_has_vmx_ept_mt_uc (vmx_ept_vpid_cap & VMX_EPT_MEMORY_TYPE_UC)
+#define cpu_has_vmx_ept_mt_wb (vmx_ept_vpid_cap & VMX_EPT_MEMORY_TYPE_WB)
+#define cpu_has_vmx_ept_2mb   (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_2MB)
+#define cpu_has_vmx_ept_1gb   (vmx_ept_vpid_cap & VMX_EPT_SUPERPAGE_1GB)
+#define cpu_has_vmx_ept_ad    (vmx_ept_vpid_cap & VMX_EPT_AD_BIT)
 #define cpu_has_vmx_ept_invept_single_context   \
     (vmx_ept_vpid_cap & VMX_EPT_INVEPT_SINGLE_CONTEXT)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:33:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpZf9-0000hl-1I; Fri, 23 Oct 2015 10:33: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 1ZpZf7-0000h7-H6
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:29 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	5C/63-10715-8FC0A265; Fri, 23 Oct 2015 10:33:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445596406!22018084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11116 invoked from network); 23 Oct 2015 10:33:27 -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;
	23 Oct 2015 10:33:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZf3-0000tc-Pt
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 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 1ZpZf3-0006Py-MX
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:25 +0000
Date: Fri, 23 Oct 2015 10:33:25 +0000
Message-Id: <E1ZpZf3-0006Py-MX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/ept: defer enabling of EPT A/D bit
	until PML get enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ed8b8363269554a3b91e99b3acdecac52f8b500
Author:     Kai Huang <kai.huang@linux.intel.com>
AuthorDate: Wed Oct 21 10:49:16 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:49:16 2015 +0200

    x86/ept: defer enabling of EPT A/D bit until PML get enabled
    
    Existing PML implementation turns on EPT A/D bit unconditionally if PML is
    supported by hardware. This works but enabling of EPT A/D bit can be deferred
    until PML get enabled. There's no point in enabling the extra feature for every
    domain when we're not meaning to use it (yet).
    
    Also added ASSERT of domain having been paused to ept_flush_pml_buffers to make
    it consistent with ept_enable{disable}_pml.
    
    Sanity live migration and GUI display were tested on Broadwell Machine.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   24 ++++++++++++++++++++++++
 xen/arch/x86/mm/p2m-ept.c          |   24 ++++++++++++++++++++----
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 3 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 3592a88..c11f3ec 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1553,6 +1553,30 @@ void vmx_domain_flush_pml_buffers(struct domain *d)
         vmx_vcpu_flush_pml_buffer(v);
 }
 
+static void vmx_vcpu_update_eptp(struct vcpu *v, u64 eptp)
+{
+    vmx_vmcs_enter(v);
+    __vmwrite(EPT_POINTER, eptp);
+    vmx_vmcs_exit(v);
+}
+
+/*
+ * Update EPTP data to VMCS of all vcpus of the domain. Must be called when
+ * domain is paused.
+ */
+void vmx_domain_update_eptp(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    struct vcpu *v;
+
+    ASSERT(atomic_read(&d->pause_count));
+
+    for_each_vcpu ( d, v )
+        vmx_vcpu_update_eptp(v, ept_get_eptp(&p2m->ept));
+
+    ept_sync_domain(p2m);
+}
+
 int vmx_create_vmcs(struct vcpu *v)
 {
     struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 74ce9e0..86440fc 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -1129,21 +1129,39 @@ void ept_sync_domain(struct p2m_domain *p2m)
 
 static void ept_enable_pml(struct p2m_domain *p2m)
 {
+    /* Domain must have been paused */
+    ASSERT(atomic_read(&p2m->domain->pause_count));
+
     /*
-     * No need to check if vmx_domain_enable_pml has succeeded or not, as
+     * No need to return whether vmx_domain_enable_pml has succeeded, as
      * ept_p2m_type_to_flags will do the check, and write protection will be
      * used if PML is not enabled.
      */
-    vmx_domain_enable_pml(p2m->domain);
+    if ( vmx_domain_enable_pml(p2m->domain) )
+        return;
+
+    /* Enable EPT A/D bit for PML */
+    p2m->ept.ept_ad = 1;
+    vmx_domain_update_eptp(p2m->domain);
 }
 
 static void ept_disable_pml(struct p2m_domain *p2m)
 {
+    /* Domain must have been paused */
+    ASSERT(atomic_read(&p2m->domain->pause_count));
+
     vmx_domain_disable_pml(p2m->domain);
+
+    /* Disable EPT A/D bit */
+    p2m->ept.ept_ad = 0;
+    vmx_domain_update_eptp(p2m->domain);
 }
 
 static void ept_flush_pml_buffers(struct p2m_domain *p2m)
 {
+    /* Domain must have been paused */
+    ASSERT(atomic_read(&p2m->domain->pause_count));
+
     vmx_domain_flush_pml_buffers(p2m->domain);
 }
 
@@ -1166,8 +1184,6 @@ int ept_p2m_init(struct p2m_domain *p2m)
 
     if ( cpu_has_vmx_pml )
     {
-        /* Enable EPT A/D bits if we are going to use PML. */
-        ept->ept_ad = cpu_has_vmx_pml ? 1 : 0;
         p2m->enable_hardware_log_dirty = ept_enable_pml;
         p2m->disable_hardware_log_dirty = ept_disable_pml;
         p2m->flush_hardware_cached_dirty = ept_flush_pml_buffers;
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 1a71de6..865d9fc 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -517,6 +517,8 @@ int vmx_domain_enable_pml(struct domain *d);
 void vmx_domain_disable_pml(struct domain *d);
 void vmx_domain_flush_pml_buffers(struct domain *d);
 
+void vmx_domain_update_eptp(struct domain *d);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_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 Oct 23 10:33:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpZf9-0000hl-1I; Fri, 23 Oct 2015 10:33: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 1ZpZf7-0000h7-H6
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:29 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	5C/63-10715-8FC0A265; Fri, 23 Oct 2015 10:33:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1445596406!22018084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11116 invoked from network); 23 Oct 2015 10:33:27 -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;
	23 Oct 2015 10:33:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZf3-0000tc-Pt
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 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 1ZpZf3-0006Py-MX
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:25 +0000
Date: Fri, 23 Oct 2015 10:33:25 +0000
Message-Id: <E1ZpZf3-0006Py-MX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/ept: defer enabling of EPT A/D bit
	until PML get enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ed8b8363269554a3b91e99b3acdecac52f8b500
Author:     Kai Huang <kai.huang@linux.intel.com>
AuthorDate: Wed Oct 21 10:49:16 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:49:16 2015 +0200

    x86/ept: defer enabling of EPT A/D bit until PML get enabled
    
    Existing PML implementation turns on EPT A/D bit unconditionally if PML is
    supported by hardware. This works but enabling of EPT A/D bit can be deferred
    until PML get enabled. There's no point in enabling the extra feature for every
    domain when we're not meaning to use it (yet).
    
    Also added ASSERT of domain having been paused to ept_flush_pml_buffers to make
    it consistent with ept_enable{disable}_pml.
    
    Sanity live migration and GUI display were tested on Broadwell Machine.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   24 ++++++++++++++++++++++++
 xen/arch/x86/mm/p2m-ept.c          |   24 ++++++++++++++++++++----
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 3 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 3592a88..c11f3ec 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1553,6 +1553,30 @@ void vmx_domain_flush_pml_buffers(struct domain *d)
         vmx_vcpu_flush_pml_buffer(v);
 }
 
+static void vmx_vcpu_update_eptp(struct vcpu *v, u64 eptp)
+{
+    vmx_vmcs_enter(v);
+    __vmwrite(EPT_POINTER, eptp);
+    vmx_vmcs_exit(v);
+}
+
+/*
+ * Update EPTP data to VMCS of all vcpus of the domain. Must be called when
+ * domain is paused.
+ */
+void vmx_domain_update_eptp(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    struct vcpu *v;
+
+    ASSERT(atomic_read(&d->pause_count));
+
+    for_each_vcpu ( d, v )
+        vmx_vcpu_update_eptp(v, ept_get_eptp(&p2m->ept));
+
+    ept_sync_domain(p2m);
+}
+
 int vmx_create_vmcs(struct vcpu *v)
 {
     struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 74ce9e0..86440fc 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -1129,21 +1129,39 @@ void ept_sync_domain(struct p2m_domain *p2m)
 
 static void ept_enable_pml(struct p2m_domain *p2m)
 {
+    /* Domain must have been paused */
+    ASSERT(atomic_read(&p2m->domain->pause_count));
+
     /*
-     * No need to check if vmx_domain_enable_pml has succeeded or not, as
+     * No need to return whether vmx_domain_enable_pml has succeeded, as
      * ept_p2m_type_to_flags will do the check, and write protection will be
      * used if PML is not enabled.
      */
-    vmx_domain_enable_pml(p2m->domain);
+    if ( vmx_domain_enable_pml(p2m->domain) )
+        return;
+
+    /* Enable EPT A/D bit for PML */
+    p2m->ept.ept_ad = 1;
+    vmx_domain_update_eptp(p2m->domain);
 }
 
 static void ept_disable_pml(struct p2m_domain *p2m)
 {
+    /* Domain must have been paused */
+    ASSERT(atomic_read(&p2m->domain->pause_count));
+
     vmx_domain_disable_pml(p2m->domain);
+
+    /* Disable EPT A/D bit */
+    p2m->ept.ept_ad = 0;
+    vmx_domain_update_eptp(p2m->domain);
 }
 
 static void ept_flush_pml_buffers(struct p2m_domain *p2m)
 {
+    /* Domain must have been paused */
+    ASSERT(atomic_read(&p2m->domain->pause_count));
+
     vmx_domain_flush_pml_buffers(p2m->domain);
 }
 
@@ -1166,8 +1184,6 @@ int ept_p2m_init(struct p2m_domain *p2m)
 
     if ( cpu_has_vmx_pml )
     {
-        /* Enable EPT A/D bits if we are going to use PML. */
-        ept->ept_ad = cpu_has_vmx_pml ? 1 : 0;
         p2m->enable_hardware_log_dirty = ept_enable_pml;
         p2m->disable_hardware_log_dirty = ept_disable_pml;
         p2m->flush_hardware_cached_dirty = ept_flush_pml_buffers;
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 1a71de6..865d9fc 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -517,6 +517,8 @@ int vmx_domain_enable_pml(struct domain *d);
 void vmx_domain_disable_pml(struct domain *d);
 void vmx_domain_flush_pml_buffers(struct domain *d);
 
+void vmx_domain_update_eptp(struct domain *d);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_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 Oct 23 10:33:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:33: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 1ZpZfL-0000ja-5c; Fri, 23 Oct 2015 10:33:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfJ-0000jN-VL
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:42 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	E2/00-16965-50D0A265; Fri, 23 Oct 2015 10:33:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445596417!23265861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30682 invoked from network); 23 Oct 2015 10:33:38 -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;
	23 Oct 2015 10:33:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfF-0000th-2z
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfE-0006QK-0N
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:36 +0000
Date: Fri, 23 Oct 2015 10:33:36 +0000
Message-Id: <E1ZpZfE-0006QK-0N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vmx: fix coding style of PML
	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 d0b0290a996d2378aa74fe258bff7a18f7c9c553
Author:     Kai Huang <kai.huang@linux.intel.com>
AuthorDate: Wed Oct 21 10:49:54 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:49:54 2015 +0200

    x86/vmx: fix coding style of PML functions
    
    According to Jan's comments, also fix the coding style of for_each_vcpu in
    existing PML functions.
    
    Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c11f3ec..4ea1ad1 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1500,7 +1500,7 @@ int vmx_domain_enable_pml(struct domain *d)
     if ( vmx_domain_pml_enabled(d) )
         return 0;
 
-    for_each_vcpu( d, v )
+    for_each_vcpu ( d, v )
         if ( (rc = vmx_vcpu_enable_pml(v)) != 0 )
             goto error;
 
@@ -1509,7 +1509,7 @@ int vmx_domain_enable_pml(struct domain *d)
     return 0;
 
  error:
-    for_each_vcpu( d, v )
+    for_each_vcpu ( d, v )
         if ( vmx_vcpu_pml_enabled(v) )
             vmx_vcpu_disable_pml(v);
     return rc;
@@ -1530,7 +1530,7 @@ void vmx_domain_disable_pml(struct domain *d)
     if ( !vmx_domain_pml_enabled(d) )
         return;
 
-    for_each_vcpu( d, v )
+    for_each_vcpu ( d, v )
         vmx_vcpu_disable_pml(v);
 
     d->arch.hvm_domain.vmx.status &= ~VMX_DOMAIN_PML_ENABLED;
@@ -1549,7 +1549,7 @@ void vmx_domain_flush_pml_buffers(struct domain *d)
     if ( !vmx_domain_pml_enabled(d) )
         return;
 
-    for_each_vcpu( d, v )
+    for_each_vcpu ( d, v )
         vmx_vcpu_flush_pml_buffer(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 Oct 23 10:33:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:33: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 1ZpZfL-0000ja-5c; Fri, 23 Oct 2015 10:33:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfJ-0000jN-VL
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:42 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	E2/00-16965-50D0A265; Fri, 23 Oct 2015 10:33:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445596417!23265861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30682 invoked from network); 23 Oct 2015 10:33:38 -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;
	23 Oct 2015 10:33:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfF-0000th-2z
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfE-0006QK-0N
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:36 +0000
Date: Fri, 23 Oct 2015 10:33:36 +0000
Message-Id: <E1ZpZfE-0006QK-0N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vmx: fix coding style of PML
	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 d0b0290a996d2378aa74fe258bff7a18f7c9c553
Author:     Kai Huang <kai.huang@linux.intel.com>
AuthorDate: Wed Oct 21 10:49:54 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:49:54 2015 +0200

    x86/vmx: fix coding style of PML functions
    
    According to Jan's comments, also fix the coding style of for_each_vcpu in
    existing PML functions.
    
    Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c11f3ec..4ea1ad1 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1500,7 +1500,7 @@ int vmx_domain_enable_pml(struct domain *d)
     if ( vmx_domain_pml_enabled(d) )
         return 0;
 
-    for_each_vcpu( d, v )
+    for_each_vcpu ( d, v )
         if ( (rc = vmx_vcpu_enable_pml(v)) != 0 )
             goto error;
 
@@ -1509,7 +1509,7 @@ int vmx_domain_enable_pml(struct domain *d)
     return 0;
 
  error:
-    for_each_vcpu( d, v )
+    for_each_vcpu ( d, v )
         if ( vmx_vcpu_pml_enabled(v) )
             vmx_vcpu_disable_pml(v);
     return rc;
@@ -1530,7 +1530,7 @@ void vmx_domain_disable_pml(struct domain *d)
     if ( !vmx_domain_pml_enabled(d) )
         return;
 
-    for_each_vcpu( d, v )
+    for_each_vcpu ( d, v )
         vmx_vcpu_disable_pml(v);
 
     d->arch.hvm_domain.vmx.status &= ~VMX_DOMAIN_PML_ENABLED;
@@ -1549,7 +1549,7 @@ void vmx_domain_flush_pml_buffers(struct domain *d)
     if ( !vmx_domain_pml_enabled(d) )
         return;
 
-    for_each_vcpu( d, v )
+    for_each_vcpu ( d, v )
         vmx_vcpu_flush_pml_buffer(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 Oct 23 10:33:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:33: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 1ZpZfU-0000ks-8C; Fri, 23 Oct 2015 10:33: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 1ZpZfS-0000kZ-UJ
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:51 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	BC/10-10678-E0D0A265; Fri, 23 Oct 2015 10:33:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1445596428!54802421!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 26758 invoked from network); 23 Oct 2015 10:33:49 -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 Oct 2015 10:33:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfQ-0000ts-6t
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfP-0006Qq-9F
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:47 +0000
Date: Fri, 23 Oct 2015 10:33:47 +0000
Message-Id: <E1ZpZfP-0006Qq-9F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't build platform hypercall
	helpers 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 c92e34bfae67b8ed7b47565a2a76e6797d4afe75
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:52:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:52:28 2015 +0200

    x86: don't build platform hypercall helpers multiple times
    
    ... to eliminate the resulting duplicate symbols. This includes
    dropping an odd per-CPU variable left from 32-bit days: Now that we
    only care about 64-bit builds, converting the uint64_t needing
    passing to a void pointer is no problem anymore.
    
    Since the COMPAT handling section needs to be re-organized for this
    anyway, also adjust a few other shortcomings (like declarations not
    being visible at the point of the respective definition, risking both
    to get out of sync).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/platform_hypercall.c |   50 ++++++++++++++++--------------------
 xen/arch/x86/sysctl.c             |    1 +
 xen/include/asm-x86/smp.h         |    6 ++++
 3 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 7626261..39fa808 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -34,6 +34,20 @@
 #include "cpu/mtrr/mtrr.h"
 #include <xsm/xsm.h>
 
+/* Declarations for items shared with the compat mode handler. */
+extern spinlock_t xenpf_lock;
+
+#define RESOURCE_ACCESS_MAX_ENTRIES 3
+struct resource_access {
+    unsigned int nr_done;
+    unsigned int nr_entries;
+    xenpf_resource_entry_t *entries;
+};
+
+long cpu_frequency_change_helper(void *);
+void check_resource_access(struct resource_access *);
+void resource_access(void *);
+
 #ifndef COMPAT
 typedef long ret_t;
 DEFINE_SPINLOCK(xenpf_lock);
@@ -43,32 +57,12 @@ DEFINE_SPINLOCK(xenpf_lock);
 # define copy_to_compat copy_to_guest
 # undef guest_from_compat_handle
 # define guest_from_compat_handle(x,y) ((x)=(y))
-#else
-extern spinlock_t xenpf_lock;
-#endif
 
-static DEFINE_PER_CPU(uint64_t, freq);
-
-static long cpu_frequency_change_helper(void *data)
+long cpu_frequency_change_helper(void *data)
 {
-    return cpu_frequency_change(this_cpu(freq));
+    return cpu_frequency_change((uint64_t)data);
 }
 
-/* from sysctl.c */
-long cpu_up_helper(void *data);
-long cpu_down_helper(void *data);
-
-/* from core_parking.c */
-long core_parking_helper(void *data);
-uint32_t get_cur_idle_nums(void);
-
-#define RESOURCE_ACCESS_MAX_ENTRIES 3
-struct xen_resource_access {
-    unsigned int nr_done;
-    unsigned int nr_entries;
-    xenpf_resource_entry_t *entries;
-};
-
 static bool_t allow_access_msr(unsigned int msr)
 {
     switch ( msr )
@@ -83,7 +77,7 @@ static bool_t allow_access_msr(unsigned int msr)
     return 0;
 }
 
-static void check_resource_access(struct xen_resource_access *ra)
+void check_resource_access(struct resource_access *ra)
 {
     unsigned int i;
 
@@ -122,9 +116,9 @@ static void check_resource_access(struct xen_resource_access *ra)
     ra->nr_done = i;
 }
 
-static void resource_access(void *info)
+void resource_access(void *info)
 {
-    struct xen_resource_access *ra = info;
+    struct resource_access *ra = info;
     unsigned int i;
     u64 tsc = 0;
 
@@ -185,6 +179,7 @@ static void resource_access(void *info)
 
     ra->nr_done = i;
 }
+#endif
 
 ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 {
@@ -457,10 +452,9 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         ret = -EINVAL;
         if ( op->u.change_freq.flags || !cpu_online(op->u.change_freq.cpu) )
             break;
-        per_cpu(freq, op->u.change_freq.cpu) = op->u.change_freq.freq;
         ret = continue_hypercall_on_cpu(op->u.change_freq.cpu,
                                         cpu_frequency_change_helper,
-                                        NULL);
+                                        (void *)op->u.change_freq.freq);
         break;
 
     case XENPF_getidletime:
@@ -734,7 +728,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_resource_op:
     {
-        struct xen_resource_access ra;
+        struct resource_access ra;
         unsigned int cpu;
         XEN_GUEST_HANDLE(xenpf_resource_entry_t) guest_entries;
 
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index e54ddac..34ee240 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -24,6 +24,7 @@
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
 #include <asm/processor.h>
+#include <asm/smp.h>
 #include <asm/numa.h>
 #include <xen/nodemask.h>
 #include <xen/cpu.h>
diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index ea07888..fb0f42a 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -58,6 +58,12 @@ int hard_smp_processor_id(void);
 
 void __stop_this_cpu(void);
 
+long cpu_up_helper(void *data);
+long cpu_down_helper(void *data);
+
+long core_parking_helper(void *data);
+uint32_t get_cur_idle_nums(void);
+
 /*
  * The value may be greater than the actual socket number in the system and
  * is required not to change from the initial startup.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:33:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:33: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 1ZpZfU-0000ks-8C; Fri, 23 Oct 2015 10:33: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 1ZpZfS-0000kZ-UJ
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:51 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	BC/10-10678-E0D0A265; Fri, 23 Oct 2015 10:33:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1445596428!54802421!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 26758 invoked from network); 23 Oct 2015 10:33:49 -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 Oct 2015 10:33:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfQ-0000ts-6t
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfP-0006Qq-9F
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:47 +0000
Date: Fri, 23 Oct 2015 10:33:47 +0000
Message-Id: <E1ZpZfP-0006Qq-9F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't build platform hypercall
	helpers 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 c92e34bfae67b8ed7b47565a2a76e6797d4afe75
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:52:28 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:52:28 2015 +0200

    x86: don't build platform hypercall helpers multiple times
    
    ... to eliminate the resulting duplicate symbols. This includes
    dropping an odd per-CPU variable left from 32-bit days: Now that we
    only care about 64-bit builds, converting the uint64_t needing
    passing to a void pointer is no problem anymore.
    
    Since the COMPAT handling section needs to be re-organized for this
    anyway, also adjust a few other shortcomings (like declarations not
    being visible at the point of the respective definition, risking both
    to get out of sync).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/platform_hypercall.c |   50 ++++++++++++++++--------------------
 xen/arch/x86/sysctl.c             |    1 +
 xen/include/asm-x86/smp.h         |    6 ++++
 3 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 7626261..39fa808 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -34,6 +34,20 @@
 #include "cpu/mtrr/mtrr.h"
 #include <xsm/xsm.h>
 
+/* Declarations for items shared with the compat mode handler. */
+extern spinlock_t xenpf_lock;
+
+#define RESOURCE_ACCESS_MAX_ENTRIES 3
+struct resource_access {
+    unsigned int nr_done;
+    unsigned int nr_entries;
+    xenpf_resource_entry_t *entries;
+};
+
+long cpu_frequency_change_helper(void *);
+void check_resource_access(struct resource_access *);
+void resource_access(void *);
+
 #ifndef COMPAT
 typedef long ret_t;
 DEFINE_SPINLOCK(xenpf_lock);
@@ -43,32 +57,12 @@ DEFINE_SPINLOCK(xenpf_lock);
 # define copy_to_compat copy_to_guest
 # undef guest_from_compat_handle
 # define guest_from_compat_handle(x,y) ((x)=(y))
-#else
-extern spinlock_t xenpf_lock;
-#endif
 
-static DEFINE_PER_CPU(uint64_t, freq);
-
-static long cpu_frequency_change_helper(void *data)
+long cpu_frequency_change_helper(void *data)
 {
-    return cpu_frequency_change(this_cpu(freq));
+    return cpu_frequency_change((uint64_t)data);
 }
 
-/* from sysctl.c */
-long cpu_up_helper(void *data);
-long cpu_down_helper(void *data);
-
-/* from core_parking.c */
-long core_parking_helper(void *data);
-uint32_t get_cur_idle_nums(void);
-
-#define RESOURCE_ACCESS_MAX_ENTRIES 3
-struct xen_resource_access {
-    unsigned int nr_done;
-    unsigned int nr_entries;
-    xenpf_resource_entry_t *entries;
-};
-
 static bool_t allow_access_msr(unsigned int msr)
 {
     switch ( msr )
@@ -83,7 +77,7 @@ static bool_t allow_access_msr(unsigned int msr)
     return 0;
 }
 
-static void check_resource_access(struct xen_resource_access *ra)
+void check_resource_access(struct resource_access *ra)
 {
     unsigned int i;
 
@@ -122,9 +116,9 @@ static void check_resource_access(struct xen_resource_access *ra)
     ra->nr_done = i;
 }
 
-static void resource_access(void *info)
+void resource_access(void *info)
 {
-    struct xen_resource_access *ra = info;
+    struct resource_access *ra = info;
     unsigned int i;
     u64 tsc = 0;
 
@@ -185,6 +179,7 @@ static void resource_access(void *info)
 
     ra->nr_done = i;
 }
+#endif
 
 ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 {
@@ -457,10 +452,9 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         ret = -EINVAL;
         if ( op->u.change_freq.flags || !cpu_online(op->u.change_freq.cpu) )
             break;
-        per_cpu(freq, op->u.change_freq.cpu) = op->u.change_freq.freq;
         ret = continue_hypercall_on_cpu(op->u.change_freq.cpu,
                                         cpu_frequency_change_helper,
-                                        NULL);
+                                        (void *)op->u.change_freq.freq);
         break;
 
     case XENPF_getidletime:
@@ -734,7 +728,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
     case XENPF_resource_op:
     {
-        struct xen_resource_access ra;
+        struct resource_access ra;
         unsigned int cpu;
         XEN_GUEST_HANDLE(xenpf_resource_entry_t) guest_entries;
 
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index e54ddac..34ee240 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -24,6 +24,7 @@
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
 #include <asm/processor.h>
+#include <asm/smp.h>
 #include <asm/numa.h>
 #include <xen/nodemask.h>
 #include <xen/cpu.h>
diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index ea07888..fb0f42a 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -58,6 +58,12 @@ int hard_smp_processor_id(void);
 
 void __stop_this_cpu(void);
 
+long cpu_up_helper(void *data);
+long cpu_down_helper(void *data);
+
+long core_parking_helper(void *data);
+uint32_t get_cur_idle_nums(void);
+
 /*
  * The value may be greater than the actual socket number in the system and
  * is required not to change from the initial startup.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:34:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpZfe-0000mB-Ag; Fri, 23 Oct 2015 10:34:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfd-0000lw-6V
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:01 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	A6/D4-00536-81D0A265; Fri, 23 Oct 2015 10:34:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1445596438!56112246!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31542 invoked from network); 23 Oct 2015 10:33:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:33:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfa-0000u0-FJ
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfa-0006Rf-Dh
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:58 +0000
Date: Fri, 23 Oct 2015 10:33:58 +0000
Message-Id: <E1ZpZfa-0006Rf-Dh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: prefix both instances of
	enable_intr_window()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef4974c29ffc35b7e712af19e802e335ae8d80b4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:53:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:53:35 2015 +0200

    x86/HVM: prefix both instances of enable_intr_window()
    
    ... to tell them apart by their names even without further context.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Aravind Gopalakrishnan<Aravind.Gopalakrishnan@amd.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/svm/intr.c |    6 +++---
 xen/arch/x86/hvm/vmx/intr.c |   18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 1d97c1b..bd94731 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -75,7 +75,7 @@ static void svm_inject_extint(struct vcpu *v, int vector)
     vmcb->eventinj = event;
 }
 
-static void enable_intr_window(struct vcpu *v, struct hvm_intack intack)
+static void svm_enable_intr_window(struct vcpu *v, struct hvm_intack intack)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     uint32_t general1_intercepts = vmcb_get_general1_intercepts(vmcb);
@@ -195,7 +195,7 @@ void svm_intr_assist(void)
          */
         if ( unlikely(vmcb->eventinj.fields.v) || intblk )
         {
-            enable_intr_window(v, intack);
+            svm_enable_intr_window(v, intack);
             return;
         }
 
@@ -216,7 +216,7 @@ void svm_intr_assist(void)
     /* Is there another IRQ to queue up behind this one? */
     intack = hvm_vcpu_has_pending_irq(v);
     if ( unlikely(intack.source != hvm_intsrc_none) )
-        enable_intr_window(v, intack);
+        svm_enable_intr_window(v, intack);
 }
 
 /*
diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index 4189f89..56c40b1 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -67,7 +67,7 @@
  * the STI- and MOV-SS-blocking interruptibility-state flags.
  */
 
-static void enable_intr_window(struct vcpu *v, struct hvm_intack intack)
+static void vmx_enable_intr_window(struct vcpu *v, struct hvm_intack intack)
 {
     u32 ctl = CPU_BASED_VIRTUAL_INTR_PENDING;
 
@@ -182,7 +182,7 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 
     if ( nvmx_intr_blocked(v) != hvm_intblk_none )
     {
-        enable_intr_window(v, intack);
+        vmx_enable_intr_window(v, intack);
         return 1;
     }
 
@@ -206,10 +206,10 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 
                 intack = hvm_vcpu_has_pending_irq(v);
                 if ( unlikely(intack.source != hvm_intsrc_none) )
-                    enable_intr_window(v, intack);
+                    vmx_enable_intr_window(v, intack);
             }
             else
-                enable_intr_window(v, intack);
+                vmx_enable_intr_window(v, intack);
 
             return 1;
         }
@@ -257,7 +257,7 @@ void vmx_intr_assist(void)
                   intack.source == hvm_intsrc_vector ||
                   intack.source == hvm_intsrc_nmi) )
             {
-                enable_intr_window(v, intack);
+                vmx_enable_intr_window(v, intack);
                 goto out;
             }
 
@@ -267,7 +267,7 @@ void vmx_intr_assist(void)
                 if ( (intack.source == hvm_intsrc_pic) ||
                      (intack.source == hvm_intsrc_nmi) ||
                      (intack.source == hvm_intsrc_mce) )
-                    enable_intr_window(v, intack);
+                    vmx_enable_intr_window(v, intack);
 
                 goto out;
             }
@@ -280,7 +280,7 @@ void vmx_intr_assist(void)
         }
         else if ( intblk != hvm_intblk_none )
         {
-            enable_intr_window(v, intack);
+            vmx_enable_intr_window(v, intack);
             goto out;
         }
         else
@@ -288,7 +288,7 @@ void vmx_intr_assist(void)
             __vmread(VM_ENTRY_INTR_INFO, &intr_info);
             if ( intr_info & INTR_INFO_VALID_MASK )
             {
-                enable_intr_window(v, intack);
+                vmx_enable_intr_window(v, intack);
                 goto out;
             }
         }
@@ -350,7 +350,7 @@ void vmx_intr_assist(void)
          intack.source == hvm_intsrc_vector )
     {
         if ( unlikely(intack.source != hvm_intsrc_none) )
-            enable_intr_window(v, intack);
+            vmx_enable_intr_window(v, intack);
     }
 
  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 Oct 23 10:34:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpZfe-0000mB-Ag; Fri, 23 Oct 2015 10:34:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfd-0000lw-6V
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:01 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	A6/D4-00536-81D0A265; Fri, 23 Oct 2015 10:34:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1445596438!56112246!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31542 invoked from network); 23 Oct 2015 10:33:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:33:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfa-0000u0-FJ
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfa-0006Rf-Dh
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:33:58 +0000
Date: Fri, 23 Oct 2015 10:33:58 +0000
Message-Id: <E1ZpZfa-0006Rf-Dh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: prefix both instances of
	enable_intr_window()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef4974c29ffc35b7e712af19e802e335ae8d80b4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:53:35 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:53:35 2015 +0200

    x86/HVM: prefix both instances of enable_intr_window()
    
    ... to tell them apart by their names even without further context.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Aravind Gopalakrishnan<Aravind.Gopalakrishnan@amd.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/svm/intr.c |    6 +++---
 xen/arch/x86/hvm/vmx/intr.c |   18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 1d97c1b..bd94731 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -75,7 +75,7 @@ static void svm_inject_extint(struct vcpu *v, int vector)
     vmcb->eventinj = event;
 }
 
-static void enable_intr_window(struct vcpu *v, struct hvm_intack intack)
+static void svm_enable_intr_window(struct vcpu *v, struct hvm_intack intack)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     uint32_t general1_intercepts = vmcb_get_general1_intercepts(vmcb);
@@ -195,7 +195,7 @@ void svm_intr_assist(void)
          */
         if ( unlikely(vmcb->eventinj.fields.v) || intblk )
         {
-            enable_intr_window(v, intack);
+            svm_enable_intr_window(v, intack);
             return;
         }
 
@@ -216,7 +216,7 @@ void svm_intr_assist(void)
     /* Is there another IRQ to queue up behind this one? */
     intack = hvm_vcpu_has_pending_irq(v);
     if ( unlikely(intack.source != hvm_intsrc_none) )
-        enable_intr_window(v, intack);
+        svm_enable_intr_window(v, intack);
 }
 
 /*
diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index 4189f89..56c40b1 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -67,7 +67,7 @@
  * the STI- and MOV-SS-blocking interruptibility-state flags.
  */
 
-static void enable_intr_window(struct vcpu *v, struct hvm_intack intack)
+static void vmx_enable_intr_window(struct vcpu *v, struct hvm_intack intack)
 {
     u32 ctl = CPU_BASED_VIRTUAL_INTR_PENDING;
 
@@ -182,7 +182,7 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 
     if ( nvmx_intr_blocked(v) != hvm_intblk_none )
     {
-        enable_intr_window(v, intack);
+        vmx_enable_intr_window(v, intack);
         return 1;
     }
 
@@ -206,10 +206,10 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 
                 intack = hvm_vcpu_has_pending_irq(v);
                 if ( unlikely(intack.source != hvm_intsrc_none) )
-                    enable_intr_window(v, intack);
+                    vmx_enable_intr_window(v, intack);
             }
             else
-                enable_intr_window(v, intack);
+                vmx_enable_intr_window(v, intack);
 
             return 1;
         }
@@ -257,7 +257,7 @@ void vmx_intr_assist(void)
                   intack.source == hvm_intsrc_vector ||
                   intack.source == hvm_intsrc_nmi) )
             {
-                enable_intr_window(v, intack);
+                vmx_enable_intr_window(v, intack);
                 goto out;
             }
 
@@ -267,7 +267,7 @@ void vmx_intr_assist(void)
                 if ( (intack.source == hvm_intsrc_pic) ||
                      (intack.source == hvm_intsrc_nmi) ||
                      (intack.source == hvm_intsrc_mce) )
-                    enable_intr_window(v, intack);
+                    vmx_enable_intr_window(v, intack);
 
                 goto out;
             }
@@ -280,7 +280,7 @@ void vmx_intr_assist(void)
         }
         else if ( intblk != hvm_intblk_none )
         {
-            enable_intr_window(v, intack);
+            vmx_enable_intr_window(v, intack);
             goto out;
         }
         else
@@ -288,7 +288,7 @@ void vmx_intr_assist(void)
             __vmread(VM_ENTRY_INTR_INFO, &intr_info);
             if ( intr_info & INTR_INFO_VALID_MASK )
             {
-                enable_intr_window(v, intack);
+                vmx_enable_intr_window(v, intack);
                 goto out;
             }
         }
@@ -350,7 +350,7 @@ void vmx_intr_assist(void)
          intack.source == hvm_intsrc_vector )
     {
         if ( unlikely(intack.source != hvm_intsrc_none) )
-            enable_intr_window(v, intack);
+            vmx_enable_intr_window(v, intack);
     }
 
  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 Oct 23 10:34:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34: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 1ZpZfo-0000nU-D8; Fri, 23 Oct 2015 10:34: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 1ZpZfn-0000n8-8Z
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:11 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	38/29-19110-22D0A265; Fri, 23 Oct 2015 10:34:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445596448!60885453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22969 invoked from network); 23 Oct 2015 10:34: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 Oct 2015 10:34:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfk-0000ug-Oj
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfk-0006SE-MP
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:08 +0000
Date: Fri, 23 Oct 2015 10:34:08 +0000
Message-Id: <E1ZpZfk-0006SE-MP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: only a single instance of
	fetch_type_names[] is needed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89173c1051a0fde2f04aaa2d234de8c14697f626
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:55:17 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:55:17 2015 +0200

    x86/shadow: only a single instance of fetch_type_names[] is needed
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/multi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 22081a1..da18488 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -73,8 +73,10 @@ typedef enum {
     ft_demand_write = FETCH_TYPE_DEMAND | FETCH_TYPE_WRITE,
 } fetch_type_t;
 
-#ifdef DEBUG_TRACE_DUMP
-static char *fetch_type_names[] = {
+extern const char *const fetch_type_names[];
+
+#if defined(DEBUG_TRACE_DUMP) && CONFIG_PAGING_LEVELS == GUEST_PAGING_LEVELS
+const char *const fetch_type_names[] = {
     [ft_prefetch]     "prefetch",
     [ft_demand_read]  "demand read",
     [ft_demand_write] "demand write",
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:34:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34: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 1ZpZfo-0000nU-D8; Fri, 23 Oct 2015 10:34: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 1ZpZfn-0000n8-8Z
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:11 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	38/29-19110-22D0A265; Fri, 23 Oct 2015 10:34:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445596448!60885453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22969 invoked from network); 23 Oct 2015 10:34: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 Oct 2015 10:34:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfk-0000ug-Oj
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfk-0006SE-MP
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:08 +0000
Date: Fri, 23 Oct 2015 10:34:08 +0000
Message-Id: <E1ZpZfk-0006SE-MP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: only a single instance of
	fetch_type_names[] is needed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89173c1051a0fde2f04aaa2d234de8c14697f626
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:55:17 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:55:17 2015 +0200

    x86/shadow: only a single instance of fetch_type_names[] is needed
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/multi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 22081a1..da18488 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -73,8 +73,10 @@ typedef enum {
     ft_demand_write = FETCH_TYPE_DEMAND | FETCH_TYPE_WRITE,
 } fetch_type_t;
 
-#ifdef DEBUG_TRACE_DUMP
-static char *fetch_type_names[] = {
+extern const char *const fetch_type_names[];
+
+#if defined(DEBUG_TRACE_DUMP) && CONFIG_PAGING_LEVELS == GUEST_PAGING_LEVELS
+const char *const fetch_type_names[] = {
     [ft_prefetch]     "prefetch",
     [ft_demand_read]  "demand read",
     [ft_demand_write] "demand write",
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:34:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpZfy-0000qo-FR; Fri, 23 Oct 2015 10:34:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfx-0000q5-Vf
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:22 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	E6/55-10715-C2D0A265; Fri, 23 Oct 2015 10:34:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445596459!24882322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30288 invoked from network); 23 Oct 2015 10:34:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:34:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfv-0000uo-0M
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfu-0006Sn-VF
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:18 +0000
Date: Fri, 23 Oct 2015 10:34:18 +0000
Message-Id: <E1ZpZfu-0006Sn-VF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: adjust sh_{make,
	destroy}_monitor_table() name tags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ce86773a460d4c116bdcd1b10e37bcafbfb6920
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:55:54 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:55:54 2015 +0200

    x86/shadow: adjust sh_{make,destroy}_monitor_table() name tags
    
    Instead of the misleading _guest_<level> ones use _sh_<level>,
    expressing their sole dependency on the number of shadow levels.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/multi.h   |    7 -------
 xen/arch/x86/mm/shadow/private.h |    8 +++++---
 xen/arch/x86/mm/shadow/types.h   |    7 +++++--
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index b5cc1e9..9998257 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -105,13 +105,6 @@ extern void
 SHADOW_INTERNAL_NAME(sh_guest_get_eff_l1e, GUEST_LEVELS)
     (struct vcpu *v, unsigned long va, void *eff_l1e);
 
-extern mfn_t
-SHADOW_INTERNAL_NAME(sh_make_monitor_table, GUEST_LEVELS)
-    (struct vcpu *v);
-extern void
-SHADOW_INTERNAL_NAME(sh_destroy_monitor_table, GUEST_LEVELS)
-    (struct vcpu *v, mfn_t mmfn);
-
 extern const struct paging_mode
 SHADOW_INTERNAL_NAME(sh_paging_mode, GUEST_LEVELS);
 
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 2d146cf..531c3f7 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -151,10 +151,12 @@ extern void shadow_audit_tables(struct vcpu *v);
  * Macro for dealing with the naming of the internal names of the
  * shadow code's external entry points.
  */
-#define SHADOW_INTERNAL_NAME_HIDDEN(name, guest_levels) \
-    name ## __guest_ ## guest_levels
+#define SHADOW_INTERNAL_NAME_(name, kind, value)        \
+    name ## __ ## kind ## _ ## value
 #define SHADOW_INTERNAL_NAME(name, guest_levels)        \
-    SHADOW_INTERNAL_NAME_HIDDEN(name, guest_levels)
+    SHADOW_INTERNAL_NAME_(name, guest, guest_levels)
+#define SHADOW_SH_NAME(name, shadow_levels)             \
+    SHADOW_INTERNAL_NAME_(name, sh, shadow_levels)
 
 #define GUEST_LEVELS  2
 #include "multi.h"
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 9bc369f..2474d61 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -270,9 +270,12 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 
 /* sh_make_monitor_table depends only on the number of shadow levels */
 #define sh_make_monitor_table \
-        SHADOW_INTERNAL_NAME(sh_make_monitor_table, SHADOW_PAGING_LEVELS)
+        SHADOW_SH_NAME(sh_make_monitor_table, SHADOW_PAGING_LEVELS)
 #define sh_destroy_monitor_table \
-        SHADOW_INTERNAL_NAME(sh_destroy_monitor_table, SHADOW_PAGING_LEVELS)
+        SHADOW_SH_NAME(sh_destroy_monitor_table, SHADOW_PAGING_LEVELS)
+
+mfn_t sh_make_monitor_table(struct vcpu *v);
+void sh_destroy_monitor_table(struct vcpu *v, mfn_t mmfn);
 
 #if SHADOW_PAGING_LEVELS == 3
 #define MFN_FITS_IN_HVM_CR3(_MFN) !(mfn_x(_MFN) >> 20)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:34:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpZfy-0000qo-FR; Fri, 23 Oct 2015 10:34:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfx-0000q5-Vf
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:22 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	E6/55-10715-C2D0A265; Fri, 23 Oct 2015 10:34:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1445596459!24882322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30288 invoked from network); 23 Oct 2015 10:34:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:34:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfv-0000uo-0M
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZfu-0006Sn-VF
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:18 +0000
Date: Fri, 23 Oct 2015 10:34:18 +0000
Message-Id: <E1ZpZfu-0006Sn-VF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: adjust sh_{make,
	destroy}_monitor_table() name tags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ce86773a460d4c116bdcd1b10e37bcafbfb6920
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:55:54 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:55:54 2015 +0200

    x86/shadow: adjust sh_{make,destroy}_monitor_table() name tags
    
    Instead of the misleading _guest_<level> ones use _sh_<level>,
    expressing their sole dependency on the number of shadow levels.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/multi.h   |    7 -------
 xen/arch/x86/mm/shadow/private.h |    8 +++++---
 xen/arch/x86/mm/shadow/types.h   |    7 +++++--
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index b5cc1e9..9998257 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -105,13 +105,6 @@ extern void
 SHADOW_INTERNAL_NAME(sh_guest_get_eff_l1e, GUEST_LEVELS)
     (struct vcpu *v, unsigned long va, void *eff_l1e);
 
-extern mfn_t
-SHADOW_INTERNAL_NAME(sh_make_monitor_table, GUEST_LEVELS)
-    (struct vcpu *v);
-extern void
-SHADOW_INTERNAL_NAME(sh_destroy_monitor_table, GUEST_LEVELS)
-    (struct vcpu *v, mfn_t mmfn);
-
 extern const struct paging_mode
 SHADOW_INTERNAL_NAME(sh_paging_mode, GUEST_LEVELS);
 
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 2d146cf..531c3f7 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -151,10 +151,12 @@ extern void shadow_audit_tables(struct vcpu *v);
  * Macro for dealing with the naming of the internal names of the
  * shadow code's external entry points.
  */
-#define SHADOW_INTERNAL_NAME_HIDDEN(name, guest_levels) \
-    name ## __guest_ ## guest_levels
+#define SHADOW_INTERNAL_NAME_(name, kind, value)        \
+    name ## __ ## kind ## _ ## value
 #define SHADOW_INTERNAL_NAME(name, guest_levels)        \
-    SHADOW_INTERNAL_NAME_HIDDEN(name, guest_levels)
+    SHADOW_INTERNAL_NAME_(name, guest, guest_levels)
+#define SHADOW_SH_NAME(name, shadow_levels)             \
+    SHADOW_INTERNAL_NAME_(name, sh, shadow_levels)
 
 #define GUEST_LEVELS  2
 #include "multi.h"
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 9bc369f..2474d61 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -270,9 +270,12 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 
 /* sh_make_monitor_table depends only on the number of shadow levels */
 #define sh_make_monitor_table \
-        SHADOW_INTERNAL_NAME(sh_make_monitor_table, SHADOW_PAGING_LEVELS)
+        SHADOW_SH_NAME(sh_make_monitor_table, SHADOW_PAGING_LEVELS)
 #define sh_destroy_monitor_table \
-        SHADOW_INTERNAL_NAME(sh_destroy_monitor_table, SHADOW_PAGING_LEVELS)
+        SHADOW_SH_NAME(sh_destroy_monitor_table, SHADOW_PAGING_LEVELS)
+
+mfn_t sh_make_monitor_table(struct vcpu *v);
+void sh_destroy_monitor_table(struct vcpu *v, mfn_t mmfn);
 
 #if SHADOW_PAGING_LEVELS == 3
 #define MFN_FITS_IN_HVM_CR3(_MFN) !(mfn_x(_MFN) >> 20)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:34:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpZg9-0000tz-Ik; Fri, 23 Oct 2015 10:34:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZg8-0000tZ-D4
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:32 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	7D/E9-19110-73D0A265; Fri, 23 Oct 2015 10:34:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445596469!60885554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24894 invoked from network); 23 Oct 2015 10:34:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:34:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZg5-0000v0-E3
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZg5-0006U5-6q
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:29 +0000
Date: Fri, 23 Oct 2015 10:34:29 +0000
Message-Id: <E1ZpZg5-0006U5-6q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: drop stray name tags from
	sh_{guest_get, map}_eff_l1e()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a3ce8f85e7e7bdd339d259daa19f6bc5cb4735f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:56:31 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:56:31 2015 +0200

    x86/shadow: drop stray name tags from sh_{guest_get,map}_eff_l1e()
    
    They (as a now being removed comment validly says) depend only on Xen's
    number of page table levels, and hence their tags didn't serve any
    useful purpose (there could only ever be one instance in a single
    binary, even back in the x86-32 days).
    
    Further conditionalize the inclusion of PV-specific hook pointers, at
    once making sure that PV guests can't ever get other than 4-level mode
    enabled for them.
    
    For consistency reasons shadow_{write,cmpxchg}_guest_entry() also get
    moved next to the other PV-only actors, allowing them to become static
    just like the $subject ones do.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c  |   45 +++------------------------------
 xen/arch/x86/mm/shadow/multi.c   |   52 +++++++++++++++++++++++++++++++++++---
 xen/arch/x86/mm/shadow/multi.h   |    7 -----
 xen/arch/x86/mm/shadow/private.h |    4 ---
 xen/arch/x86/mm/shadow/types.h   |    6 ----
 5 files changed, 52 insertions(+), 62 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 58f131c..fa70ad6 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -84,7 +84,9 @@ void shadow_vcpu_init(struct vcpu *v)
     }
 #endif
 
-    v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
+    v->arch.paging.mode = is_pv_vcpu(v) ?
+                          &SHADOW_INTERNAL_NAME(sh_paging_mode, 4) :
+                          &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
 }
 
 #if SHADOW_AUDIT
@@ -1128,38 +1130,6 @@ sh_validate_guest_pt_write(struct vcpu *v, mfn_t gmfn,
     }
 }
 
-int shadow_write_guest_entry(struct vcpu *v, intpte_t *p,
-                             intpte_t new, mfn_t gmfn)
-/* Write a new value into the guest pagetable, and update the shadows
- * appropriately.  Returns 0 if we page-faulted, 1 for success. */
-{
-    int failed;
-    paging_lock(v->domain);
-    failed = __copy_to_user(p, &new, sizeof(new));
-    if ( failed != sizeof(new) )
-        sh_validate_guest_entry(v, gmfn, p, sizeof(new));
-    paging_unlock(v->domain);
-    return (failed == 0);
-}
-
-int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
-                               intpte_t *old, intpte_t new, mfn_t gmfn)
-/* Cmpxchg a new value into the guest pagetable, and update the shadows
- * appropriately. Returns 0 if we page-faulted, 1 if not.
- * N.B. caller should check the value of "old" to see if the
- * cmpxchg itself was successful. */
-{
-    int failed;
-    intpte_t t = *old;
-    paging_lock(v->domain);
-    failed = cmpxchg_user(p, t, new);
-    if ( t == *old )
-        sh_validate_guest_entry(v, gmfn, p, sizeof(new));
-    *old = t;
-    paging_unlock(v->domain);
-    return (failed == 0);
-}
-
 
 /**************************************************************************/
 /* Memory management for shadow pages. */
@@ -2786,14 +2756,7 @@ static void sh_update_paging_modes(struct vcpu *v)
     if ( v->arch.paging.mode )
         v->arch.paging.mode->shadow.detach_old_tables(v);
 
-    if ( is_pv_domain(d) )
-    {
-        ///
-        /// PV guest
-        ///
-        v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
-    }
-    else
+    if ( !is_pv_domain(d) )
     {
         ///
         /// HVM guest
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index da18488..b54835d 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -368,7 +368,7 @@ static void sh_audit_gw(struct vcpu *v, walk_t *gw)
 
 
 #if (CONFIG_PAGING_LEVELS == GUEST_PAGING_LEVELS)
-void *
+static void *
 sh_guest_map_l1e(struct vcpu *v, unsigned long addr,
                   unsigned long *gl1mfn)
 {
@@ -392,7 +392,7 @@ sh_guest_map_l1e(struct vcpu *v, unsigned long addr,
     return pl1e;
 }
 
-void
+static void
 sh_guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
 {
     walk_t gw;
@@ -405,6 +405,48 @@ sh_guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
     (void) sh_walk_guest_tables(v, addr, &gw, PFEC_page_present);
     *(guest_l1e_t *)eff_l1e = gw.l1e;
 }
+
+/*
+ * Write a new value into the guest pagetable, and update the shadows
+ * appropriately.  Returns 0 if we page-faulted, 1 for success.
+ */
+static int
+sh_write_guest_entry(struct vcpu *v, guest_intpte_t *p,
+                     guest_intpte_t new, mfn_t gmfn)
+{
+    int failed;
+
+    paging_lock(v->domain);
+    failed = __copy_to_user(p, &new, sizeof(new));
+    if ( failed != sizeof(new) )
+        sh_validate_guest_entry(v, gmfn, p, sizeof(new));
+    paging_unlock(v->domain);
+
+    return !failed;
+}
+
+/*
+ * Cmpxchg a new value into the guest pagetable, and update the shadows
+ * appropriately. Returns 0 if we page-faulted, 1 if not.
+ * N.B. caller should check the value of "old" to see if the cmpxchg itself
+ * was successful.
+ */
+static int
+sh_cmpxchg_guest_entry(struct vcpu *v, guest_intpte_t *p,
+                       guest_intpte_t *old, guest_intpte_t new, mfn_t gmfn)
+{
+    int failed;
+    guest_intpte_t t = *old;
+
+    paging_lock(v->domain);
+    failed = cmpxchg_user(p, t, new);
+    if ( t == *old )
+        sh_validate_guest_entry(v, gmfn, p, sizeof(new));
+    *old = t;
+    paging_unlock(v->domain);
+
+    return !failed;
+}
 #endif /* CONFIG == GUEST (== SHADOW) */
 
 /**************************************************************************/
@@ -5181,10 +5223,12 @@ const struct paging_mode sh_paging_mode = {
     .update_cr3                    = sh_update_cr3,
     .update_paging_modes           = shadow_update_paging_modes,
     .write_p2m_entry               = shadow_write_p2m_entry,
-    .write_guest_entry             = shadow_write_guest_entry,
-    .cmpxchg_guest_entry           = shadow_cmpxchg_guest_entry,
+#if CONFIG_PAGING_LEVELS == GUEST_PAGING_LEVELS
+    .write_guest_entry             = sh_write_guest_entry,
+    .cmpxchg_guest_entry           = sh_cmpxchg_guest_entry,
     .guest_map_l1e                 = sh_guest_map_l1e,
     .guest_get_eff_l1e             = sh_guest_get_eff_l1e,
+#endif
     .guest_levels                  = GUEST_PAGING_LEVELS,
     .shadow.detach_old_tables      = sh_detach_old_tables,
     .shadow.x86_emulate_write      = sh_x86_emulate_write,
diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index 9998257..0bd6a2d 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -98,13 +98,6 @@ SHADOW_INTERNAL_NAME(sh_audit_l4_table, GUEST_LEVELS)
     (struct vcpu *v, mfn_t sl4mfn, mfn_t x);
 #endif
 
-extern void *
-SHADOW_INTERNAL_NAME(sh_guest_map_l1e, GUEST_LEVELS)
-    (struct vcpu *v, unsigned long va, unsigned long *gl1mfn);
-extern void
-SHADOW_INTERNAL_NAME(sh_guest_get_eff_l1e, GUEST_LEVELS)
-    (struct vcpu *v, unsigned long va, void *eff_l1e);
-
 extern const struct paging_mode
 SHADOW_INTERNAL_NAME(sh_paging_mode, GUEST_LEVELS);
 
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 531c3f7..a881a4e 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -383,10 +383,6 @@ extern int sh_remove_write_access(struct domain *d, mfn_t readonly_mfn,
 void shadow_write_p2m_entry(struct domain *d, unsigned long gfn,
                             l1_pgentry_t *p, l1_pgentry_t new,
                             unsigned int level);
-int shadow_write_guest_entry(struct vcpu *v, intpte_t *p,
-                             intpte_t new, mfn_t gmfn);
-int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
-                               intpte_t *old, intpte_t new, mfn_t gmfn);
 
 /* Update all the things that are derived from the guest's CR0/CR3/CR4.
  * Called to initialize paging structures if the paging mode
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 2474d61..6b9959d 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -262,12 +262,6 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 #define sh_rm_write_access_from_sl1p INTERNAL_NAME(sh_rm_write_access_from_sl1p)
 #endif
 
-/* The sh_guest_(map|get)_* functions depends on Xen's paging levels */
-#define sh_guest_map_l1e \
-        SHADOW_INTERNAL_NAME(sh_guest_map_l1e, CONFIG_PAGING_LEVELS)
-#define sh_guest_get_eff_l1e \
-        SHADOW_INTERNAL_NAME(sh_guest_get_eff_l1e, CONFIG_PAGING_LEVELS)
-
 /* sh_make_monitor_table depends only on the number of shadow levels */
 #define sh_make_monitor_table \
         SHADOW_SH_NAME(sh_make_monitor_table, SHADOW_PAGING_LEVELS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:34:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpZg9-0000tz-Ik; Fri, 23 Oct 2015 10:34:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZg8-0000tZ-D4
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:32 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	7D/E9-19110-73D0A265; Fri, 23 Oct 2015 10:34:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445596469!60885554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24894 invoked from network); 23 Oct 2015 10:34:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:34:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZg5-0000v0-E3
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZg5-0006U5-6q
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:29 +0000
Date: Fri, 23 Oct 2015 10:34:29 +0000
Message-Id: <E1ZpZg5-0006U5-6q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: drop stray name tags from
	sh_{guest_get, map}_eff_l1e()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a3ce8f85e7e7bdd339d259daa19f6bc5cb4735f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 10:56:31 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 10:56:31 2015 +0200

    x86/shadow: drop stray name tags from sh_{guest_get,map}_eff_l1e()
    
    They (as a now being removed comment validly says) depend only on Xen's
    number of page table levels, and hence their tags didn't serve any
    useful purpose (there could only ever be one instance in a single
    binary, even back in the x86-32 days).
    
    Further conditionalize the inclusion of PV-specific hook pointers, at
    once making sure that PV guests can't ever get other than 4-level mode
    enabled for them.
    
    For consistency reasons shadow_{write,cmpxchg}_guest_entry() also get
    moved next to the other PV-only actors, allowing them to become static
    just like the $subject ones do.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c  |   45 +++------------------------------
 xen/arch/x86/mm/shadow/multi.c   |   52 +++++++++++++++++++++++++++++++++++---
 xen/arch/x86/mm/shadow/multi.h   |    7 -----
 xen/arch/x86/mm/shadow/private.h |    4 ---
 xen/arch/x86/mm/shadow/types.h   |    6 ----
 5 files changed, 52 insertions(+), 62 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 58f131c..fa70ad6 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -84,7 +84,9 @@ void shadow_vcpu_init(struct vcpu *v)
     }
 #endif
 
-    v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
+    v->arch.paging.mode = is_pv_vcpu(v) ?
+                          &SHADOW_INTERNAL_NAME(sh_paging_mode, 4) :
+                          &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
 }
 
 #if SHADOW_AUDIT
@@ -1128,38 +1130,6 @@ sh_validate_guest_pt_write(struct vcpu *v, mfn_t gmfn,
     }
 }
 
-int shadow_write_guest_entry(struct vcpu *v, intpte_t *p,
-                             intpte_t new, mfn_t gmfn)
-/* Write a new value into the guest pagetable, and update the shadows
- * appropriately.  Returns 0 if we page-faulted, 1 for success. */
-{
-    int failed;
-    paging_lock(v->domain);
-    failed = __copy_to_user(p, &new, sizeof(new));
-    if ( failed != sizeof(new) )
-        sh_validate_guest_entry(v, gmfn, p, sizeof(new));
-    paging_unlock(v->domain);
-    return (failed == 0);
-}
-
-int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
-                               intpte_t *old, intpte_t new, mfn_t gmfn)
-/* Cmpxchg a new value into the guest pagetable, and update the shadows
- * appropriately. Returns 0 if we page-faulted, 1 if not.
- * N.B. caller should check the value of "old" to see if the
- * cmpxchg itself was successful. */
-{
-    int failed;
-    intpte_t t = *old;
-    paging_lock(v->domain);
-    failed = cmpxchg_user(p, t, new);
-    if ( t == *old )
-        sh_validate_guest_entry(v, gmfn, p, sizeof(new));
-    *old = t;
-    paging_unlock(v->domain);
-    return (failed == 0);
-}
-
 
 /**************************************************************************/
 /* Memory management for shadow pages. */
@@ -2786,14 +2756,7 @@ static void sh_update_paging_modes(struct vcpu *v)
     if ( v->arch.paging.mode )
         v->arch.paging.mode->shadow.detach_old_tables(v);
 
-    if ( is_pv_domain(d) )
-    {
-        ///
-        /// PV guest
-        ///
-        v->arch.paging.mode = &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
-    }
-    else
+    if ( !is_pv_domain(d) )
     {
         ///
         /// HVM guest
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index da18488..b54835d 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -368,7 +368,7 @@ static void sh_audit_gw(struct vcpu *v, walk_t *gw)
 
 
 #if (CONFIG_PAGING_LEVELS == GUEST_PAGING_LEVELS)
-void *
+static void *
 sh_guest_map_l1e(struct vcpu *v, unsigned long addr,
                   unsigned long *gl1mfn)
 {
@@ -392,7 +392,7 @@ sh_guest_map_l1e(struct vcpu *v, unsigned long addr,
     return pl1e;
 }
 
-void
+static void
 sh_guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
 {
     walk_t gw;
@@ -405,6 +405,48 @@ sh_guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
     (void) sh_walk_guest_tables(v, addr, &gw, PFEC_page_present);
     *(guest_l1e_t *)eff_l1e = gw.l1e;
 }
+
+/*
+ * Write a new value into the guest pagetable, and update the shadows
+ * appropriately.  Returns 0 if we page-faulted, 1 for success.
+ */
+static int
+sh_write_guest_entry(struct vcpu *v, guest_intpte_t *p,
+                     guest_intpte_t new, mfn_t gmfn)
+{
+    int failed;
+
+    paging_lock(v->domain);
+    failed = __copy_to_user(p, &new, sizeof(new));
+    if ( failed != sizeof(new) )
+        sh_validate_guest_entry(v, gmfn, p, sizeof(new));
+    paging_unlock(v->domain);
+
+    return !failed;
+}
+
+/*
+ * Cmpxchg a new value into the guest pagetable, and update the shadows
+ * appropriately. Returns 0 if we page-faulted, 1 if not.
+ * N.B. caller should check the value of "old" to see if the cmpxchg itself
+ * was successful.
+ */
+static int
+sh_cmpxchg_guest_entry(struct vcpu *v, guest_intpte_t *p,
+                       guest_intpte_t *old, guest_intpte_t new, mfn_t gmfn)
+{
+    int failed;
+    guest_intpte_t t = *old;
+
+    paging_lock(v->domain);
+    failed = cmpxchg_user(p, t, new);
+    if ( t == *old )
+        sh_validate_guest_entry(v, gmfn, p, sizeof(new));
+    *old = t;
+    paging_unlock(v->domain);
+
+    return !failed;
+}
 #endif /* CONFIG == GUEST (== SHADOW) */
 
 /**************************************************************************/
@@ -5181,10 +5223,12 @@ const struct paging_mode sh_paging_mode = {
     .update_cr3                    = sh_update_cr3,
     .update_paging_modes           = shadow_update_paging_modes,
     .write_p2m_entry               = shadow_write_p2m_entry,
-    .write_guest_entry             = shadow_write_guest_entry,
-    .cmpxchg_guest_entry           = shadow_cmpxchg_guest_entry,
+#if CONFIG_PAGING_LEVELS == GUEST_PAGING_LEVELS
+    .write_guest_entry             = sh_write_guest_entry,
+    .cmpxchg_guest_entry           = sh_cmpxchg_guest_entry,
     .guest_map_l1e                 = sh_guest_map_l1e,
     .guest_get_eff_l1e             = sh_guest_get_eff_l1e,
+#endif
     .guest_levels                  = GUEST_PAGING_LEVELS,
     .shadow.detach_old_tables      = sh_detach_old_tables,
     .shadow.x86_emulate_write      = sh_x86_emulate_write,
diff --git a/xen/arch/x86/mm/shadow/multi.h b/xen/arch/x86/mm/shadow/multi.h
index 9998257..0bd6a2d 100644
--- a/xen/arch/x86/mm/shadow/multi.h
+++ b/xen/arch/x86/mm/shadow/multi.h
@@ -98,13 +98,6 @@ SHADOW_INTERNAL_NAME(sh_audit_l4_table, GUEST_LEVELS)
     (struct vcpu *v, mfn_t sl4mfn, mfn_t x);
 #endif
 
-extern void *
-SHADOW_INTERNAL_NAME(sh_guest_map_l1e, GUEST_LEVELS)
-    (struct vcpu *v, unsigned long va, unsigned long *gl1mfn);
-extern void
-SHADOW_INTERNAL_NAME(sh_guest_get_eff_l1e, GUEST_LEVELS)
-    (struct vcpu *v, unsigned long va, void *eff_l1e);
-
 extern const struct paging_mode
 SHADOW_INTERNAL_NAME(sh_paging_mode, GUEST_LEVELS);
 
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 531c3f7..a881a4e 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -383,10 +383,6 @@ extern int sh_remove_write_access(struct domain *d, mfn_t readonly_mfn,
 void shadow_write_p2m_entry(struct domain *d, unsigned long gfn,
                             l1_pgentry_t *p, l1_pgentry_t new,
                             unsigned int level);
-int shadow_write_guest_entry(struct vcpu *v, intpte_t *p,
-                             intpte_t new, mfn_t gmfn);
-int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
-                               intpte_t *old, intpte_t new, mfn_t gmfn);
 
 /* Update all the things that are derived from the guest's CR0/CR3/CR4.
  * Called to initialize paging structures if the paging mode
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index 2474d61..6b9959d 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -262,12 +262,6 @@ static inline shadow_l4e_t shadow_l4e_from_mfn(mfn_t mfn, u32 flags)
 #define sh_rm_write_access_from_sl1p INTERNAL_NAME(sh_rm_write_access_from_sl1p)
 #endif
 
-/* The sh_guest_(map|get)_* functions depends on Xen's paging levels */
-#define sh_guest_map_l1e \
-        SHADOW_INTERNAL_NAME(sh_guest_map_l1e, CONFIG_PAGING_LEVELS)
-#define sh_guest_get_eff_l1e \
-        SHADOW_INTERNAL_NAME(sh_guest_get_eff_l1e, CONFIG_PAGING_LEVELS)
-
 /* sh_make_monitor_table depends only on the number of shadow levels */
 #define sh_make_monitor_table \
         SHADOW_SH_NAME(sh_make_monitor_table, SHADOW_PAGING_LEVELS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 10:34:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34: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 1ZpZgK-0000x0-2j; Fri, 23 Oct 2015 10:34:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZgI-0000wY-AY
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:42 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	78/C6-24856-14D0A265; Fri, 23 Oct 2015 10:34:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1445596479!21082102!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11097 invoked from network); 23 Oct 2015 10:34:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:34:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZgF-0000vD-N0
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZgF-0006Ut-L2
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:39 +0000
Date: Fri, 23 Oct 2015 10:34:39 +0000
Message-Id: <E1ZpZgF-0006Ut-L2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config: Switch to unified qemu trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e08f3834c2f375153f104c827dd7c2fea93b288e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 10 14:31:34 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 21 13:50:22 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index b9a37d9..114db9a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -242,14 +242,14 @@ endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
-QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-unstable.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-xen.git
+QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 MINIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/mini-os.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
-QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-unstable.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
+QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 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 Oct 23 10:34:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 10:34: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 1ZpZgK-0000x0-2j; Fri, 23 Oct 2015 10:34:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZgI-0000wY-AY
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:42 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	78/C6-24856-14D0A265; Fri, 23 Oct 2015 10:34:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1445596479!21082102!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11097 invoked from network); 23 Oct 2015 10:34:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 10:34:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZgF-0000vD-N0
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpZgF-0006Ut-L2
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 10:34:39 +0000
Date: Fri, 23 Oct 2015 10:34:39 +0000
Message-Id: <E1ZpZgF-0006Ut-L2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config: Switch to unified qemu trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e08f3834c2f375153f104c827dd7c2fea93b288e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 10 14:31:34 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 21 13:50:22 2015 +0100

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

diff --git a/Config.mk b/Config.mk
index b9a37d9..114db9a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -242,14 +242,14 @@ endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
-QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-unstable.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-xen.git
+QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 MINIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/mini-os.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
-QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-unstable.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
+QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 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 Oct 23 13:22:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 13:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpcIL-00021h-77; Fri, 23 Oct 2015 13:22: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 1ZpcIJ-00021C-Mv
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:07 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	DB/C4-06179-F743A265; Fri, 23 Oct 2015 13:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445606525!44597700!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24312 invoked from network); 23 Oct 2015 13:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 13:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIH-0002ts-DV
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIG-0005nX-GG
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:04 +0000
Date: Fri, 23 Oct 2015 13:22:04 +0000
Message-Id: <E1ZpcIG-0005nX-GG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/console: xenconsole tolerate
	tty errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ddcdd96a0996fe755c6a9ba08182925c57ea412
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Feb 27 17:46:49 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:53:54 2015 +0100

    tools/console: xenconsole tolerate tty errors
    
    Since 28d386fc4341 (XSA-57), libxl writes an empty value for the
    console tty node, with read-only permission for the guest, when
    setting up pv console "frontends".  (The actual tty value is later set
    by xenconsoled.)   Writing an empty node is not strictly necessary to
    stop the frontend from writing dangerous values here, but it is a good
    belt-and-braces approach.
    
    Unfortunately this confuses xenconsole.  It reads the empty value, and
    tries to open it as the tty.  xenconsole then exits.
    
    Fix this by having xenconsole treat an empty value the same way as no
    value at all.
    
    Also, make the error opening the tty be nonfatal: we just print a
    warning, but do not exit.  I think this is helpful in theoretical
    situations where xenconsole is racing with libxl and/or xenconsoled.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
    
    ---
    v2: Combine two conditions and move the free
    (cherry picked from commit 39ba2989b10b6a1852e253b204eb010f8e7026f1)
    (cherry picked from commit 7b161be2e51c519754ac4435d63c8fc03db606ec)
    
    Conflicts:
    	tools/console/client/main.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/console/client/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 38c856a..fcab3b9 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -115,15 +115,15 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 			/* We only watch for one thing, so no need to 
 			 * disambiguate: just read the pty path */
 			pty_path = xs_read(xs, XBT_NULL, path, &len);
-			if (pty_path != NULL) {
+			if (pty_path != NULL && pty_path[0] != '\0') {
 				if (access(pty_path, R_OK|W_OK) != 0)
 					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1) 
-					err(errno, "Could not open tty `%s'", 
+					warn(errno, "Could not open tty `%s'", 
 					    pty_path);
-				free(pty_path);
 			}
+			free(pty_path);
 		}
 	} while (pty_fd == -1 && (now = time(NULL)) < start + seconds);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 13:22:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 13:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpcIL-00021h-77; Fri, 23 Oct 2015 13:22: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 1ZpcIJ-00021C-Mv
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:07 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	DB/C4-06179-F743A265; Fri, 23 Oct 2015 13:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1445606525!44597700!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24312 invoked from network); 23 Oct 2015 13:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 13:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIH-0002ts-DV
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIG-0005nX-GG
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:04 +0000
Date: Fri, 23 Oct 2015 13:22:04 +0000
Message-Id: <E1ZpcIG-0005nX-GG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/console: xenconsole tolerate
	tty errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ddcdd96a0996fe755c6a9ba08182925c57ea412
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Feb 27 17:46:49 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:53:54 2015 +0100

    tools/console: xenconsole tolerate tty errors
    
    Since 28d386fc4341 (XSA-57), libxl writes an empty value for the
    console tty node, with read-only permission for the guest, when
    setting up pv console "frontends".  (The actual tty value is later set
    by xenconsoled.)   Writing an empty node is not strictly necessary to
    stop the frontend from writing dangerous values here, but it is a good
    belt-and-braces approach.
    
    Unfortunately this confuses xenconsole.  It reads the empty value, and
    tries to open it as the tty.  xenconsole then exits.
    
    Fix this by having xenconsole treat an empty value the same way as no
    value at all.
    
    Also, make the error opening the tty be nonfatal: we just print a
    warning, but do not exit.  I think this is helpful in theoretical
    situations where xenconsole is racing with libxl and/or xenconsoled.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
    
    ---
    v2: Combine two conditions and move the free
    (cherry picked from commit 39ba2989b10b6a1852e253b204eb010f8e7026f1)
    (cherry picked from commit 7b161be2e51c519754ac4435d63c8fc03db606ec)
    
    Conflicts:
    	tools/console/client/main.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/console/client/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 38c856a..fcab3b9 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -115,15 +115,15 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 			/* We only watch for one thing, so no need to 
 			 * disambiguate: just read the pty path */
 			pty_path = xs_read(xs, XBT_NULL, path, &len);
-			if (pty_path != NULL) {
+			if (pty_path != NULL && pty_path[0] != '\0') {
 				if (access(pty_path, R_OK|W_OK) != 0)
 					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1) 
-					err(errno, "Could not open tty `%s'", 
+					warn(errno, "Could not open tty `%s'", 
 					    pty_path);
-				free(pty_path);
 			}
+			free(pty_path);
 		}
 	} while (pty_fd == -1 && (now = time(NULL)) < start + seconds);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 13:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 13:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpcIV-00024I-9a; Fri, 23 Oct 2015 13:22: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 1ZpcIU-000242-9o
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:18 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	9D/3A-31069-9843A265; Fri, 23 Oct 2015 13:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445606535!6627970!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5890 invoked from network); 23 Oct 2015 13:22:16 -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;
	23 Oct 2015 13:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIR-0002u0-PD
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIR-0005o2-M0
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:15 +0000
Date: Fri, 23 Oct 2015 13:22:15 +0000
Message-Id: <E1ZpcIR-0005o2-M0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools: libxl: allow permissive
	qemu-upstream pci passthrough.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 634a5d52d67895f64b89f269ecf047ee96e91710
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 11:32:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:28 2015 +0100

    tools: libxl: allow permissive qemu-upstream pci passthrough.
    
    Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In
    order to allow local configuration of the existing libxl_device_pci
    "permissive" flag needs to be plumbed through via the new QMP property
    added by the XSA-131 patches.
    
    Versions of QEMU prior to XSA-131 did not support this permissive
    property, so we only pass it if it is true. Older versions only
    supported permissive mode.
    
    qemu-xen-traditional already supports the permissive mode setting via
    xenstore.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 015a373351e5c3553f848324ac0f07a9d92883fa)
---
 tools/libxl/libxl_qmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index f681f3a..ef9f66e 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -848,6 +848,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
         QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
                                PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
+    /*
+     * Version of QEMU prior to the XSA-131 fix did not support this
+     * property and were effectively always in permissive mode. The
+     * fix for XSA-131 switched the default to be restricted by
+     * default and added the permissive property.
+     *
+     * Therefore in order to support both old and new QEMU we only set
+     * the permissive flag if it is true. Users of older QEMU have no
+     * reason to set the flag so this is ok.
+     */
+    if (pcidev->permissive)
+        qmp_parameters_add_bool(gc, &args, "permissive", true);
 
     rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 13:22:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 13:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpcIV-00024I-9a; Fri, 23 Oct 2015 13:22: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 1ZpcIU-000242-9o
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:18 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	9D/3A-31069-9843A265; Fri, 23 Oct 2015 13:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445606535!6627970!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5890 invoked from network); 23 Oct 2015 13:22:16 -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;
	23 Oct 2015 13:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIR-0002u0-PD
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIR-0005o2-M0
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:15 +0000
Date: Fri, 23 Oct 2015 13:22:15 +0000
Message-Id: <E1ZpcIR-0005o2-M0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools: libxl: allow permissive
	qemu-upstream pci passthrough.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 634a5d52d67895f64b89f269ecf047ee96e91710
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 11:32:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:28 2015 +0100

    tools: libxl: allow permissive qemu-upstream pci passthrough.
    
    Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In
    order to allow local configuration of the existing libxl_device_pci
    "permissive" flag needs to be plumbed through via the new QMP property
    added by the XSA-131 patches.
    
    Versions of QEMU prior to XSA-131 did not support this permissive
    property, so we only pass it if it is true. Older versions only
    supported permissive mode.
    
    qemu-xen-traditional already supports the permissive mode setting via
    xenstore.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 015a373351e5c3553f848324ac0f07a9d92883fa)
---
 tools/libxl/libxl_qmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index f681f3a..ef9f66e 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -848,6 +848,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
         QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
                                PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
+    /*
+     * Version of QEMU prior to the XSA-131 fix did not support this
+     * property and were effectively always in permissive mode. The
+     * fix for XSA-131 switched the default to be restricted by
+     * default and added the permissive property.
+     *
+     * Therefore in order to support both old and new QEMU we only set
+     * the permissive flag if it is true. Users of older QEMU have no
+     * reason to set the flag so this is ok.
+     */
+    if (pcidev->permissive)
+        qmp_parameters_add_bool(gc, &args, "permissive", true);
 
     rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 13:22:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 13:22: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 1ZpcIf-00027W-VR; Fri, 23 Oct 2015 13:22: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 1ZpcIe-00027E-Tg
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:29 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	C3/DB-24856-4943A265; Fri, 23 Oct 2015 13:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1445606546!44608283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14860 invoked from network); 23 Oct 2015 13:22:27 -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 Oct 2015 13:22:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIc-0002uG-9M
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIc-0005oW-2Z
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:26 +0000
Date: Fri, 23 Oct 2015 13:22:26 +0000
Message-Id: <E1ZpcIc-0005oW-2Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c5d8c049dad890965124ae4e169e274a693c8fa
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:31 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 069b73f..afa828c 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -458,14 +458,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -487,9 +490,8 @@ default.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 13:22:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 13:22: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 1ZpcIf-00027W-VR; Fri, 23 Oct 2015 13:22: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 1ZpcIe-00027E-Tg
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:29 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	C3/DB-24856-4943A265; Fri, 23 Oct 2015 13:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1445606546!44608283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14860 invoked from network); 23 Oct 2015 13:22:27 -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 Oct 2015 13:22:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIc-0002uG-9M
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIc-0005oW-2Z
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:26 +0000
Date: Fri, 23 Oct 2015 13:22:26 +0000
Message-Id: <E1ZpcIc-0005oW-2Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c5d8c049dad890965124ae4e169e274a693c8fa
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:31 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 069b73f..afa828c 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -458,14 +458,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -487,9 +490,8 @@ default.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 13:22:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 13:22: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 1ZpcIr-00029g-1v; Fri, 23 Oct 2015 13:22:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIp-00029B-NM
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:39 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	FD/EC-15765-E943A265; Fri, 23 Oct 2015 13:22:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445606556!60951227!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 8530 invoked from network); 23 Oct 2015 13:22:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 13:22:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIm-0002uO-KY
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIm-0005p6-Gd
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:36 +0000
Date: Fri, 23 Oct 2015 13:22:36 +0000
Message-Id: <E1ZpcIm-0005p6-Gd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/console: Fix build after
	"xenconsole tolerate tty errors"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85ca813ec23c5a60680e4a13777dad530065902b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 15:10:22 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 21 15:10:22 2015 +0100

    tools/console: Fix build after "xenconsole tolerate tty errors"
    
    2ddcdd96 "tools/console: xenconsole tolerate tty errors" contains a
    compile error introduced during conflict resolution of the backport
    from 4.4 to 4.3:
    
     client/main.c: In function 'get_pty_fd':
     client/main.c:124:10: error: passing argument 1 of 'warn' makes pointer from integer without a cast [-Werror]
     In file included from client/main.c:35:0:
     /usr/include/err.h:35:13: note: expected 'const char *' but argument is of type 'int'
    
    Fix this.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/console/client/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index fcab3b9..8ef309f 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -120,7 +120,7 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1) 
-					warn(errno, "Could not open tty `%s'", 
+					warn("Could not open tty `%s'",
 					    pty_path);
 			}
 			free(pty_path);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 23 13:22:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2015 13:22: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 1ZpcIr-00029g-1v; Fri, 23 Oct 2015 13:22:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIp-00029B-NM
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:39 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	FD/EC-15765-E943A265; Fri, 23 Oct 2015 13:22:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445606556!60951227!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 8530 invoked from network); 23 Oct 2015 13:22:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2015 13:22:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIm-0002uO-KY
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpcIm-0005p6-Gd
	for xen-changelog@lists.xensource.com; Fri, 23 Oct 2015 13:22:36 +0000
Date: Fri, 23 Oct 2015 13:22:36 +0000
Message-Id: <E1ZpcIm-0005p6-Gd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/console: Fix build after
	"xenconsole tolerate tty errors"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85ca813ec23c5a60680e4a13777dad530065902b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 15:10:22 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 21 15:10:22 2015 +0100

    tools/console: Fix build after "xenconsole tolerate tty errors"
    
    2ddcdd96 "tools/console: xenconsole tolerate tty errors" contains a
    compile error introduced during conflict resolution of the backport
    from 4.4 to 4.3:
    
     client/main.c: In function 'get_pty_fd':
     client/main.c:124:10: error: passing argument 1 of 'warn' makes pointer from integer without a cast [-Werror]
     In file included from client/main.c:35:0:
     /usr/include/err.h:35:13: note: expected 'const char *' but argument is of type 'int'
    
    Fix this.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/console/client/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index fcab3b9..8ef309f 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -120,7 +120,7 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1) 
-					warn(errno, "Could not open tty `%s'", 
+					warn("Could not open tty `%s'",
 					    pty_path);
 			}
 			free(pty_path);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sat Oct 24 11:44:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2015 11:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpxF2-0002pi-Lr; Sat, 24 Oct 2015 11:44:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxF0-0002pX-PD
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:06 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	83/04-12946-50F6B265; Sat, 24 Oct 2015 11:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445687044!25129124!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4228 invoked from network); 24 Oct 2015 11:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2015 11:44:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxEy-0008T8-6G
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxEx-0001EF-Tg
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:04 +0000
Date: Sat, 24 Oct 2015 11:44:03 +0000
Message-Id: <E1ZpxEx-0001EF-Tg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools/console: xenconsole tolerate
	tty errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb9d2117fae2166375f524967940439e45b08c92
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Feb 27 17:46:49 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:54:55 2015 +0100

    tools/console: xenconsole tolerate tty errors
    
    Since 28d386fc4341 (XSA-57), libxl writes an empty value for the
    console tty node, with read-only permission for the guest, when
    setting up pv console "frontends".  (The actual tty value is later set
    by xenconsoled.)   Writing an empty node is not strictly necessary to
    stop the frontend from writing dangerous values here, but it is a good
    belt-and-braces approach.
    
    Unfortunately this confuses xenconsole.  It reads the empty value, and
    tries to open it as the tty.  xenconsole then exits.
    
    Fix this by having xenconsole treat an empty value the same way as no
    value at all.
    
    Also, make the error opening the tty be nonfatal: we just print a
    warning, but do not exit.  I think this is helpful in theoretical
    situations where xenconsole is racing with libxl and/or xenconsoled.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
    
    ---
    v2: Combine two conditions and move the free
    (cherry picked from commit 39ba2989b10b6a1852e253b204eb010f8e7026f1)
    (cherry picked from commit 7b161be2e51c519754ac4435d63c8fc03db606ec)
    
    Conflicts:
    	tools/console/client/main.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 2ddcdd96a0996fe755c6a9ba08182925c57ea412)
---
 tools/console/client/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 38c856a..fcab3b9 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -115,15 +115,15 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 			/* We only watch for one thing, so no need to 
 			 * disambiguate: just read the pty path */
 			pty_path = xs_read(xs, XBT_NULL, path, &len);
-			if (pty_path != NULL) {
+			if (pty_path != NULL && pty_path[0] != '\0') {
 				if (access(pty_path, R_OK|W_OK) != 0)
 					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1) 
-					err(errno, "Could not open tty `%s'", 
+					warn(errno, "Could not open tty `%s'", 
 					    pty_path);
-				free(pty_path);
 			}
+			free(pty_path);
 		}
 	} while (pty_fd == -1 && (now = time(NULL)) < start + seconds);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sat Oct 24 11:44:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2015 11:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpxF2-0002pi-Lr; Sat, 24 Oct 2015 11:44:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxF0-0002pX-PD
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:06 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	83/04-12946-50F6B265; Sat, 24 Oct 2015 11:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1445687044!25129124!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4228 invoked from network); 24 Oct 2015 11:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2015 11:44:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxEy-0008T8-6G
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxEx-0001EF-Tg
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:04 +0000
Date: Sat, 24 Oct 2015 11:44:03 +0000
Message-Id: <E1ZpxEx-0001EF-Tg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools/console: xenconsole tolerate
	tty errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb9d2117fae2166375f524967940439e45b08c92
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Feb 27 17:46:49 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:54:55 2015 +0100

    tools/console: xenconsole tolerate tty errors
    
    Since 28d386fc4341 (XSA-57), libxl writes an empty value for the
    console tty node, with read-only permission for the guest, when
    setting up pv console "frontends".  (The actual tty value is later set
    by xenconsoled.)   Writing an empty node is not strictly necessary to
    stop the frontend from writing dangerous values here, but it is a good
    belt-and-braces approach.
    
    Unfortunately this confuses xenconsole.  It reads the empty value, and
    tries to open it as the tty.  xenconsole then exits.
    
    Fix this by having xenconsole treat an empty value the same way as no
    value at all.
    
    Also, make the error opening the tty be nonfatal: we just print a
    warning, but do not exit.  I think this is helpful in theoretical
    situations where xenconsole is racing with libxl and/or xenconsoled.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
    
    ---
    v2: Combine two conditions and move the free
    (cherry picked from commit 39ba2989b10b6a1852e253b204eb010f8e7026f1)
    (cherry picked from commit 7b161be2e51c519754ac4435d63c8fc03db606ec)
    
    Conflicts:
    	tools/console/client/main.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 2ddcdd96a0996fe755c6a9ba08182925c57ea412)
---
 tools/console/client/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 38c856a..fcab3b9 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -115,15 +115,15 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 			/* We only watch for one thing, so no need to 
 			 * disambiguate: just read the pty path */
 			pty_path = xs_read(xs, XBT_NULL, path, &len);
-			if (pty_path != NULL) {
+			if (pty_path != NULL && pty_path[0] != '\0') {
 				if (access(pty_path, R_OK|W_OK) != 0)
 					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1) 
-					err(errno, "Could not open tty `%s'", 
+					warn(errno, "Could not open tty `%s'", 
 					    pty_path);
-				free(pty_path);
 			}
+			free(pty_path);
 		}
 	} while (pty_fd == -1 && (now = time(NULL)) < start + seconds);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sat Oct 24 11:44:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2015 11:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpxFC-0002qw-OG; Sat, 24 Oct 2015 11:44:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFB-0002qg-2f
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:17 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	AF/36-06091-01F6B265; Sat, 24 Oct 2015 11:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1445687054!39362671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3034 invoked from network); 24 Oct 2015 11:44:15 -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;
	24 Oct 2015 11:44:15 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxF8-0008TD-EW
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxF8-0001Ev-Bv
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:14 +0000
Date: Sat, 24 Oct 2015 11:44:14 +0000
Message-Id: <E1ZpxF8-0001Ev-Bv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools: libxl: allow permissive
	qemu-upstream pci passthrough.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 77867d3ee2625ae823249c785de44b4a60929951
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 11:32:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:41 2015 +0100

    tools: libxl: allow permissive qemu-upstream pci passthrough.
    
    Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In
    order to allow local configuration of the existing libxl_device_pci
    "permissive" flag needs to be plumbed through via the new QMP property
    added by the XSA-131 patches.
    
    Versions of QEMU prior to XSA-131 did not support this permissive
    property, so we only pass it if it is true. Older versions only
    supported permissive mode.
    
    qemu-xen-traditional already supports the permissive mode setting via
    xenstore.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 015a373351e5c3553f848324ac0f07a9d92883fa)
---
 tools/libxl/libxl_qmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index dee9503..c16e3da 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -837,6 +837,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
         QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
                                PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
+    /*
+     * Version of QEMU prior to the XSA-131 fix did not support this
+     * property and were effectively always in permissive mode. The
+     * fix for XSA-131 switched the default to be restricted by
+     * default and added the permissive property.
+     *
+     * Therefore in order to support both old and new QEMU we only set
+     * the permissive flag if it is true. Users of older QEMU have no
+     * reason to set the flag so this is ok.
+     */
+    if (pcidev->permissive)
+        qmp_parameters_add_bool(gc, &args, "permissive", true);
 
     rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sat Oct 24 11:44:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2015 11:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpxFC-0002qw-OG; Sat, 24 Oct 2015 11:44:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFB-0002qg-2f
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:17 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	AF/36-06091-01F6B265; Sat, 24 Oct 2015 11:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1445687054!39362671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3034 invoked from network); 24 Oct 2015 11:44:15 -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;
	24 Oct 2015 11:44:15 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxF8-0008TD-EW
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxF8-0001Ev-Bv
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:14 +0000
Date: Sat, 24 Oct 2015 11:44:14 +0000
Message-Id: <E1ZpxF8-0001Ev-Bv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools: libxl: allow permissive
	qemu-upstream pci passthrough.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 77867d3ee2625ae823249c785de44b4a60929951
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 11:32:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 17:57:41 2015 +0100

    tools: libxl: allow permissive qemu-upstream pci passthrough.
    
    Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In
    order to allow local configuration of the existing libxl_device_pci
    "permissive" flag needs to be plumbed through via the new QMP property
    added by the XSA-131 patches.
    
    Versions of QEMU prior to XSA-131 did not support this permissive
    property, so we only pass it if it is true. Older versions only
    supported permissive mode.
    
    qemu-xen-traditional already supports the permissive mode setting via
    xenstore.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 015a373351e5c3553f848324ac0f07a9d92883fa)
---
 tools/libxl/libxl_qmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index dee9503..c16e3da 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -837,6 +837,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
         QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
                                PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
+    /*
+     * Version of QEMU prior to the XSA-131 fix did not support this
+     * property and were effectively always in permissive mode. The
+     * fix for XSA-131 switched the default to be restricted by
+     * default and added the permissive property.
+     *
+     * Therefore in order to support both old and new QEMU we only set
+     * the permissive flag if it is true. Users of older QEMU have no
+     * reason to set the flag so this is ok.
+     */
+    if (pcidev->permissive)
+        qmp_parameters_add_bool(gc, &args, "permissive", true);
 
     rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sat Oct 24 11:44:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2015 11: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 1ZpxFM-0002ss-R5; Sat, 24 Oct 2015 11: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 1ZpxFL-0002sc-Bo
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:27 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	C1/7B-04752-A1F6B265; Sat, 24 Oct 2015 11:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1445687064!28258108!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24940 invoked from network); 24 Oct 2015 11:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2015 11:44:25 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFI-0008TO-Kv
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFI-0001FQ-Iu
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:24 +0000
Date: Sat, 24 Oct 2015 11:44:24 +0000
Message-Id: <E1ZpxFI-0001FQ-Iu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 415e43ae325a640583de6c7b56d9b0b610a1e0bf
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 18:07:55 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
    
    Conflicts:
    	docs/man/xl.cfg.pod.5
    
    The text here in Xen 4.2 is quite different to that in 4.3 resulting
    in a big conflict.  I resolved it by turning this commit into one
    which simply removes the annotation `(PV only)'.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 4f7b583..a5a2e85 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -392,7 +392,7 @@ enable this option only for trusted VMs under administrator control.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
+Changes the default value of 'permissive' for all PCI
 devices for this VM.  This can still be overridden on a per-device
 basis. This option should be enabled with caution: it gives the guest
 much more control over the device, which may have security or
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sat Oct 24 11:44:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2015 11: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 1ZpxFM-0002ss-R5; Sat, 24 Oct 2015 11: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 1ZpxFL-0002sc-Bo
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:27 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	C1/7B-04752-A1F6B265; Sat, 24 Oct 2015 11:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1445687064!28258108!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24940 invoked from network); 24 Oct 2015 11:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2015 11:44:25 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFI-0008TO-Kv
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFI-0001FQ-Iu
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:24 +0000
Date: Sat, 24 Oct 2015 11:44:24 +0000
Message-Id: <E1ZpxFI-0001FQ-Iu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 415e43ae325a640583de6c7b56d9b0b610a1e0bf
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 20 18:07:55 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
    
    Conflicts:
    	docs/man/xl.cfg.pod.5
    
    The text here in Xen 4.2 is quite different to that in 4.3 resulting
    in a big conflict.  I resolved it by turning this commit into one
    which simply removes the annotation `(PV only)'.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 4f7b583..a5a2e85 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -392,7 +392,7 @@ enable this option only for trusted VMs under administrator control.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
+Changes the default value of 'permissive' for all PCI
 devices for this VM.  This can still be overridden on a per-device
 basis. This option should be enabled with caution: it gives the guest
 much more control over the device, which may have security or
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sat Oct 24 11:44:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2015 11:44:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpxFW-0002vO-Vw; Sat, 24 Oct 2015 11: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 1ZpxFV-0002v5-Cf
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:37 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	35/B0-13905-42F6B265; Sat, 24 Oct 2015 11:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1445687075!39362712!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 8633 invoked from network); 24 Oct 2015 11:44:35 -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;
	24 Oct 2015 11:44:35 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFS-0008TW-TF
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFS-0001Fs-Q9
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:34 +0000
Date: Sat, 24 Oct 2015 11:44:34 +0000
Message-Id: <E1ZpxFS-0001Fs-Q9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools/console: Fix build after
	"xenconsole tolerate tty errors"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 80a11b92a47cb8278c074f83f9ea29b7825eaa74
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 15:10:22 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 21 15:11:52 2015 +0100

    tools/console: Fix build after "xenconsole tolerate tty errors"
    
    2ddcdd96 "tools/console: xenconsole tolerate tty errors" contains a
    compile error introduced during conflict resolution of the backport
    from 4.4 to 4.3:
    
     client/main.c: In function 'get_pty_fd':
     client/main.c:124:10: error: passing argument 1 of 'warn' makes pointer from integer without a cast [-Werror]
     In file included from client/main.c:35:0:
     /usr/include/err.h:35:13: note: expected 'const char *' but argument is of type 'int'
    
    Fix this.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 85ca813ec23c5a60680e4a13777dad530065902b)
---
 tools/console/client/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index fcab3b9..8ef309f 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -120,7 +120,7 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1) 
-					warn(errno, "Could not open tty `%s'", 
+					warn("Could not open tty `%s'",
 					    pty_path);
 			}
 			free(pty_path);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sat Oct 24 11:44:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2015 11:44:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZpxFW-0002vO-Vw; Sat, 24 Oct 2015 11: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 1ZpxFV-0002v5-Cf
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:37 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	35/B0-13905-42F6B265; Sat, 24 Oct 2015 11:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1445687075!39362712!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 8633 invoked from network); 24 Oct 2015 11:44:35 -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;
	24 Oct 2015 11:44:35 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFS-0008TW-TF
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZpxFS-0001Fs-Q9
	for xen-changelog@lists.xensource.com; Sat, 24 Oct 2015 11:44:34 +0000
Date: Sat, 24 Oct 2015 11:44:34 +0000
Message-Id: <E1ZpxFS-0001Fs-Q9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools/console: Fix build after
	"xenconsole tolerate tty errors"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 80a11b92a47cb8278c074f83f9ea29b7825eaa74
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 15:10:22 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 21 15:11:52 2015 +0100

    tools/console: Fix build after "xenconsole tolerate tty errors"
    
    2ddcdd96 "tools/console: xenconsole tolerate tty errors" contains a
    compile error introduced during conflict resolution of the backport
    from 4.4 to 4.3:
    
     client/main.c: In function 'get_pty_fd':
     client/main.c:124:10: error: passing argument 1 of 'warn' makes pointer from integer without a cast [-Werror]
     In file included from client/main.c:35:0:
     /usr/include/err.h:35:13: note: expected 'const char *' but argument is of type 'int'
    
    Fix this.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 85ca813ec23c5a60680e4a13777dad530065902b)
---
 tools/console/client/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index fcab3b9..8ef309f 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -120,7 +120,7 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
 				if (pty_fd == -1) 
-					warn(errno, "Could not open tty `%s'", 
+					warn("Could not open tty `%s'",
 					    pty_path);
 			}
 			free(pty_path);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQRm-00057D-6Q; Sun, 25 Oct 2015 18:55: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 1ZqQRk-000578-3Z
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:12 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	2C/9B-13905-E852D265; Sun, 25 Oct 2015 18:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1445799309!44910706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1305 invoked from network); 25 Oct 2015 18:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRd-0001v4-0Y
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRc-0000lt-QE
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:04 +0000
Date: Sun, 25 Oct 2015 18:55:04 +0000
Message-Id: <E1ZqQRc-0000lt-QE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] update Xen version to 4.6.1-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit be6ce1e2b8e61bd3584da7342b309c589dfd97ea
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:37:30 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:37:30 2015 +0200

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

diff --git a/xen/Makefile b/xen/Makefile
index 4c54e9b..2050d69 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    = 6
-export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQRm-00057D-6Q; Sun, 25 Oct 2015 18:55: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 1ZqQRk-000578-3Z
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:12 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	2C/9B-13905-E852D265; Sun, 25 Oct 2015 18:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1445799309!44910706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1305 invoked from network); 25 Oct 2015 18:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRd-0001v4-0Y
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRc-0000lt-QE
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:04 +0000
Date: Sun, 25 Oct 2015 18:55:04 +0000
Message-Id: <E1ZqQRc-0000lt-QE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] update Xen version to 4.6.1-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit be6ce1e2b8e61bd3584da7342b309c589dfd97ea
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:37:30 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:37:30 2015 +0200

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

diff --git a/xen/Makefile b/xen/Makefile
index 4c54e9b..2050d69 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    = 6
-export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQRx-000581-8t; Sun, 25 Oct 2015 18:55:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRv-00057r-CN
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:23 +0000
Content-Length: 5145
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	AD/69-00475-A952D265; Sun, 25 Oct 2015 18:55:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445799320!61311571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21932 invoked from network); 25 Oct 2015 18:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRs-0001ve-Dy
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRr-0000mG-Em
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:19 +0000
Date: Sun, 25 Oct 2015 18:55:19 +0000
Message-Id: <E1ZqQRr-0000mG-Em@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/xsm: Make p->policyvers be a
	local variable (ver) to shut up GCC 5.1.1 warnings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4556802335836758727=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4556802335836758727==
Content-Length: 4815
Content-Transfer-Encoding: quoted-printable

commit 193aaaaff3aedd31bc1046af262533b859d7e582
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Oct 21 17:39:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:39:37 2015 +0200

    xen/xsm: Make p->policyvers be a local variable (ver) to shut up GCC 5.1.1 warnings.
    
    policydb.c: In function =E2=80=98user_read=E2=80=99:
    policydb.c:1443:26: error: =E2=80=98buf[2]=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized]
             usrdatum->bounds =3D le32_to_cpu(buf[2]);
                              ^
    cc1: all warnings being treated as errors
    
    Which (as Andrew mentioned) is because GCC cannot assume
    that 'p->policyvers' has the same value between checks.
    
    We make it local, optimize the name to 'ver' and the warnings go away.
    We also update another call site with this modification to
    make it more inline with the rest of the functions.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 6a2f81459e1455d65a9a6f78dd2a0d0278619680
    master date: 2015-09-22 12:09:03 -0400
---
 xen/xsm/flask/ss/policydb.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index a1060b1..eebfe9c 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1258,6 +1258,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     role =3D xzalloc(struct role_datum);
     if ( !role )
@@ -1266,7 +1267,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
         goto out;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1276,7 +1277,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     role->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         role->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1328,6 +1329,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[4];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     typdatum =3D xzalloc(struct type_datum);
     if ( !typdatum )
@@ -1336,7 +1338,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
         return rc;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
@@ -1346,7 +1348,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     typdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
     {
         u32 prop =3D le32_to_cpu(buf[2]);
 
@@ -1421,6 +1423,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     usrdatum =3D xzalloc(struct user_datum);
     if ( !usrdatum )
@@ -1429,7 +1432,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
         goto out;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1439,7 +1442,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     usrdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         usrdatum->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1457,7 +1460,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( rc )
         goto bad;
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_MLS )
+    if ( ver >=3D POLICYDB_VERSION_MLS )
     {
         rc =3D mls_read_range_helper(&usrdatum->range, fp);
         if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6


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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQRx-000581-8t; Sun, 25 Oct 2015 18:55:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRv-00057r-CN
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:23 +0000
Content-Length: 5145
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	AD/69-00475-A952D265; Sun, 25 Oct 2015 18:55:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1445799320!61311571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21932 invoked from network); 25 Oct 2015 18:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRs-0001ve-Dy
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQRr-0000mG-Em
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:19 +0000
Date: Sun, 25 Oct 2015 18:55:19 +0000
Message-Id: <E1ZqQRr-0000mG-Em@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/xsm: Make p->policyvers be a
	local variable (ver) to shut up GCC 5.1.1 warnings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4556802335836758727=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4556802335836758727==
Content-Length: 4815
Content-Transfer-Encoding: quoted-printable

commit 193aaaaff3aedd31bc1046af262533b859d7e582
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Oct 21 17:39:37 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:39:37 2015 +0200

    xen/xsm: Make p->policyvers be a local variable (ver) to shut up GCC 5.1.1 warnings.
    
    policydb.c: In function =E2=80=98user_read=E2=80=99:
    policydb.c:1443:26: error: =E2=80=98buf[2]=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized]
             usrdatum->bounds =3D le32_to_cpu(buf[2]);
                              ^
    cc1: all warnings being treated as errors
    
    Which (as Andrew mentioned) is because GCC cannot assume
    that 'p->policyvers' has the same value between checks.
    
    We make it local, optimize the name to 'ver' and the warnings go away.
    We also update another call site with this modification to
    make it more inline with the rest of the functions.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 6a2f81459e1455d65a9a6f78dd2a0d0278619680
    master date: 2015-09-22 12:09:03 -0400
---
 xen/xsm/flask/ss/policydb.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index a1060b1..eebfe9c 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1258,6 +1258,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     role =3D xzalloc(struct role_datum);
     if ( !role )
@@ -1266,7 +1267,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
         goto out;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1276,7 +1277,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     role->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         role->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1328,6 +1329,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[4];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     typdatum =3D xzalloc(struct type_datum);
     if ( !typdatum )
@@ -1336,7 +1338,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
         return rc;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
@@ -1346,7 +1348,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     typdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
     {
         u32 prop =3D le32_to_cpu(buf[2]);
 
@@ -1421,6 +1423,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     int rc;
     __le32 buf[3];
     u32 len;
+    u32 ver =3D p->policyvers;
 
     usrdatum =3D xzalloc(struct user_datum);
     if ( !usrdatum )
@@ -1429,7 +1432,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
         goto out;
     }
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
         rc =3D next_entry(buf, fp, sizeof(buf[0]) * 2);
@@ -1439,7 +1442,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
 
     len =3D le32_to_cpu(buf[0]);
     usrdatum->value =3D le32_to_cpu(buf[1]);
-    if ( p->policyvers >=3D POLICYDB_VERSION_BOUNDARY )
+    if ( ver >=3D POLICYDB_VERSION_BOUNDARY )
         usrdatum->bounds =3D le32_to_cpu(buf[2]);
 
     key =3D xmalloc_array(char, len + 1);
@@ -1457,7 +1460,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( rc )
         goto bad;
 
-    if ( p->policyvers >=3D POLICYDB_VERSION_MLS )
+    if ( ver >=3D POLICYDB_VERSION_MLS )
     {
         rc =3D mls_read_range_helper(&usrdatum->range, fp);
         if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6


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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQS6-00059B-BS; Sun, 25 Oct 2015 18:55:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQS5-000593-Fd
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:33 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	EE/BB-32615-4A52D265; Sun, 25 Oct 2015 18:55:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1445799331!15036103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14932 invoked from network); 25 Oct 2015 18:55:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQS2-0001wQ-PY
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQS2-0000nA-Lm
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:30 +0000
Date: Sun, 25 Oct 2015 18:55:30 +0000
Message-Id: <E1ZqQS2-0000nA-Lm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/PV: properly populate
	descriptor tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 60a466559004b84d65805775116ac6960bf0235a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:40:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:40:02 2015 +0200

    x86/PV: properly populate descriptor tables
    
    Us extending the GDT limit past the Xen descriptors so far meant that
    guests (including user mode programs) accessing any descriptor table
    slot above the original OS'es limit but below the first Xen descriptor
    caused a #PF, converted to a #GP in our #PF handler. Which is quite
    different from the native behavior, where some of such accesses (LAR
    and LSL) don't fault. Mimic that behavior by mapping a blank page into
    unused slots.
    
    While not strictly required, treat the LDT the same for consistency.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cf6d39f81992c29a637c603dbabf1e21a0ea563f
    master date: 2015-09-25 09:05:29 +0200
---
 xen/arch/x86/mm.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 202ff76..327b837 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -502,12 +502,13 @@ void update_cr3(struct vcpu *v)
     make_cr3(v, cr3_mfn);
 }
 
+static const char __section(".bss.page_aligned") zero_page[PAGE_SIZE];
 
 static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 {
     l1_pgentry_t *pl1e;
-    int i;
-    unsigned long pfn;
+    unsigned int i;
+    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
     struct page_info *page;
 
     BUG_ON(unlikely(in_irq()));
@@ -523,8 +524,9 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
     for ( i = 16; i < 32; i++ )
     {
         pfn = l1e_get_pfn(pl1e[i]);
-        if ( pfn == 0 ) continue;
-        l1e_write(&pl1e[i], l1e_empty());
+        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn )
+            continue;
+        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
         page = mfn_to_page(pfn);
         ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
         ASSERT_PAGE_IS_DOMAIN(page, v->domain);
@@ -4420,16 +4422,17 @@ long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
 void destroy_gdt(struct vcpu *v)
 {
     l1_pgentry_t *pl1e;
-    int i;
-    unsigned long pfn;
+    unsigned int i;
+    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
 
     v->arch.pv_vcpu.gdt_ents = 0;
     pl1e = gdt_ldt_ptes(v->domain, v);
     for ( i = 0; i < FIRST_RESERVED_GDT_PAGE; i++ )
     {
-        if ( (pfn = l1e_get_pfn(pl1e[i])) != 0 )
+        pfn = l1e_get_pfn(pl1e[i]);
+        if ( (l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) && pfn != zero_pfn )
             put_page_and_type(mfn_to_page(pfn));
-        l1e_write(&pl1e[i], l1e_empty());
+        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
         v->arch.pv_vcpu.gdt_frames[i] = 0;
     }
 }
@@ -4442,7 +4445,7 @@ long set_gdt(struct vcpu *v,
     struct domain *d = v->domain;
     l1_pgentry_t *pl1e;
     /* NB. There are 512 8-byte entries per GDT page. */
-    int i, nr_pages = (entries + 511) / 512;
+    unsigned int i, nr_pages = (entries + 511) / 512;
 
     if ( entries > FIRST_RESERVED_GDT_ENTRY )
         return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQS6-00059B-BS; Sun, 25 Oct 2015 18:55:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQS5-000593-Fd
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:33 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	EE/BB-32615-4A52D265; Sun, 25 Oct 2015 18:55:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1445799331!15036103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14932 invoked from network); 25 Oct 2015 18:55:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQS2-0001wQ-PY
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQS2-0000nA-Lm
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:30 +0000
Date: Sun, 25 Oct 2015 18:55:30 +0000
Message-Id: <E1ZqQS2-0000nA-Lm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/PV: properly populate
	descriptor tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 60a466559004b84d65805775116ac6960bf0235a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:40:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:40:02 2015 +0200

    x86/PV: properly populate descriptor tables
    
    Us extending the GDT limit past the Xen descriptors so far meant that
    guests (including user mode programs) accessing any descriptor table
    slot above the original OS'es limit but below the first Xen descriptor
    caused a #PF, converted to a #GP in our #PF handler. Which is quite
    different from the native behavior, where some of such accesses (LAR
    and LSL) don't fault. Mimic that behavior by mapping a blank page into
    unused slots.
    
    While not strictly required, treat the LDT the same for consistency.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cf6d39f81992c29a637c603dbabf1e21a0ea563f
    master date: 2015-09-25 09:05:29 +0200
---
 xen/arch/x86/mm.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 202ff76..327b837 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -502,12 +502,13 @@ void update_cr3(struct vcpu *v)
     make_cr3(v, cr3_mfn);
 }
 
+static const char __section(".bss.page_aligned") zero_page[PAGE_SIZE];
 
 static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 {
     l1_pgentry_t *pl1e;
-    int i;
-    unsigned long pfn;
+    unsigned int i;
+    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
     struct page_info *page;
 
     BUG_ON(unlikely(in_irq()));
@@ -523,8 +524,9 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
     for ( i = 16; i < 32; i++ )
     {
         pfn = l1e_get_pfn(pl1e[i]);
-        if ( pfn == 0 ) continue;
-        l1e_write(&pl1e[i], l1e_empty());
+        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn )
+            continue;
+        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
         page = mfn_to_page(pfn);
         ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
         ASSERT_PAGE_IS_DOMAIN(page, v->domain);
@@ -4420,16 +4422,17 @@ long do_update_va_mapping_otherdomain(unsigned long va, u64 val64,
 void destroy_gdt(struct vcpu *v)
 {
     l1_pgentry_t *pl1e;
-    int i;
-    unsigned long pfn;
+    unsigned int i;
+    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
 
     v->arch.pv_vcpu.gdt_ents = 0;
     pl1e = gdt_ldt_ptes(v->domain, v);
     for ( i = 0; i < FIRST_RESERVED_GDT_PAGE; i++ )
     {
-        if ( (pfn = l1e_get_pfn(pl1e[i])) != 0 )
+        pfn = l1e_get_pfn(pl1e[i]);
+        if ( (l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) && pfn != zero_pfn )
             put_page_and_type(mfn_to_page(pfn));
-        l1e_write(&pl1e[i], l1e_empty());
+        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
         v->arch.pv_vcpu.gdt_frames[i] = 0;
     }
 }
@@ -4442,7 +4445,7 @@ long set_gdt(struct vcpu *v,
     struct domain *d = v->domain;
     l1_pgentry_t *pl1e;
     /* NB. There are 512 8-byte entries per GDT page. */
-    int i, nr_pages = (entries + 511) / 512;
+    unsigned int i, nr_pages = (entries + 511) / 512;
 
     if ( entries > FIRST_RESERVED_GDT_ENTRY )
         return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55: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 1ZqQSG-0005AP-Dz; Sun, 25 Oct 2015 18:55: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 1ZqQSF-0005AE-NW
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:43 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	7F/D9-24856-FA52D265; Sun, 25 Oct 2015 18:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1445799341!15036117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15136 invoked from network); 25 Oct 2015 18:55:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSD-0001wY-52
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSD-0000nW-0B
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:41 +0000
Date: Sun, 25 Oct 2015 18:55:41 +0000
Message-Id: <E1ZqQSD-0000nW-0B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VT-d: don't suppress invalidation
	address write when it is zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9aab62a8ad005aa21fb4aab916ca340d8f14a59a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:40:43 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:40:43 2015 +0200

    VT-d: don't suppress invalidation address write when it is zero
    
    GFN zero is a valid address, and hence may need invalidation done for
    it just like for any other GFN.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 710942e57fb42ff8f344ca82f6b678f67e38ae63
    master date: 2015-10-12 15:58:35 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index dd13865..914b335 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -414,7 +414,7 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 {
     struct iommu *iommu = (struct iommu *) _iommu;
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
-    u64 val = 0, val_iva = 0;
+    u64 val = 0;
     unsigned long flags;
 
     /*
@@ -435,7 +435,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
     switch ( type )
     {
     case DMA_TLB_GLOBAL_FLUSH:
-        /* global flush doesn't need set IVA_REG */
         val = DMA_TLB_GLOBAL_FLUSH|DMA_TLB_IVT;
         break;
     case DMA_TLB_DSI_FLUSH:
@@ -443,8 +442,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
         break;
     case DMA_TLB_PSI_FLUSH:
         val = DMA_TLB_PSI_FLUSH|DMA_TLB_IVT|DMA_TLB_DID(did);
-        /* Note: always flush non-leaf currently */
-        val_iva = size_order | addr;
         break;
     default:
         BUG();
@@ -457,8 +454,11 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     /* Note: Only uses first TLB reg currently */
-    if ( val_iva )
-        dmar_writeq(iommu->reg, tlb_offset, val_iva);
+    if ( type == DMA_TLB_PSI_FLUSH )
+    {
+        /* Note: always flush non-leaf currently. */
+        dmar_writeq(iommu->reg, tlb_offset, size_order | addr);
+    }
     dmar_writeq(iommu->reg, tlb_offset + 8, val);
 
     /* Make sure hardware complete it */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55: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 1ZqQSG-0005AP-Dz; Sun, 25 Oct 2015 18:55: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 1ZqQSF-0005AE-NW
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:43 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	7F/D9-24856-FA52D265; Sun, 25 Oct 2015 18:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1445799341!15036117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15136 invoked from network); 25 Oct 2015 18:55:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSD-0001wY-52
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSD-0000nW-0B
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:41 +0000
Date: Sun, 25 Oct 2015 18:55:41 +0000
Message-Id: <E1ZqQSD-0000nW-0B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VT-d: don't suppress invalidation
	address write when it is zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9aab62a8ad005aa21fb4aab916ca340d8f14a59a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:40:43 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:40:43 2015 +0200

    VT-d: don't suppress invalidation address write when it is zero
    
    GFN zero is a valid address, and hence may need invalidation done for
    it just like for any other GFN.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 710942e57fb42ff8f344ca82f6b678f67e38ae63
    master date: 2015-10-12 15:58:35 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index dd13865..914b335 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -414,7 +414,7 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 {
     struct iommu *iommu = (struct iommu *) _iommu;
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
-    u64 val = 0, val_iva = 0;
+    u64 val = 0;
     unsigned long flags;
 
     /*
@@ -435,7 +435,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
     switch ( type )
     {
     case DMA_TLB_GLOBAL_FLUSH:
-        /* global flush doesn't need set IVA_REG */
         val = DMA_TLB_GLOBAL_FLUSH|DMA_TLB_IVT;
         break;
     case DMA_TLB_DSI_FLUSH:
@@ -443,8 +442,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
         break;
     case DMA_TLB_PSI_FLUSH:
         val = DMA_TLB_PSI_FLUSH|DMA_TLB_IVT|DMA_TLB_DID(did);
-        /* Note: always flush non-leaf currently */
-        val_iva = size_order | addr;
         break;
     default:
         BUG();
@@ -457,8 +454,11 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     /* Note: Only uses first TLB reg currently */
-    if ( val_iva )
-        dmar_writeq(iommu->reg, tlb_offset, val_iva);
+    if ( type == DMA_TLB_PSI_FLUSH )
+    {
+        /* Note: always flush non-leaf currently. */
+        dmar_writeq(iommu->reg, tlb_offset, size_order | addr);
+    }
     dmar_writeq(iommu->reg, tlb_offset + 8, val);
 
     /* Make sure hardware complete it */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQSR-0005CB-GT; Sun, 25 Oct 2015 18:55:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSQ-0005Bw-Hb
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:54 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	C5/5B-00536-9B52D265; Sun, 25 Oct 2015 18:55:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445799351!7005209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9401 invoked from network); 25 Oct 2015 18:55:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSN-0001wg-Fh
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSN-0000ns-CZ
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:51 +0000
Date: Sun, 25 Oct 2015 18:55:51 +0000
Message-Id: <E1ZqQSN-0000ns-CZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] build: don't shadow debug with
	"@debug@" in tools build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 62d9e74a593a336a4f0451d7c5cd2a4f223c6298
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 21 17:41:11 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:41:11 2015 +0200

    build: don't shadow debug with "@debug@" in tools build
    
    In 16181cbb (tools: Honor Config.mk debug value, rather than setting our
    own), configure doesn't set debug variable anymore. There is, however,
    one place that was missed. The file config/Tools.mk.in was still
    expecting a @debug@ value from configure. After 16181cbb that value
    remained "debug := @debug@" all the time because configure didn't
    substitute it.
    
    The consequence was that we couldn't get a debug build even if debug was
    set to "y" in Config.mk.
    
    Fix this by removing the stray line "debug := @debug@" in Tools.mk.in.
    
    Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 973ce7bd8fb1513dcc5ff04760e03915a9eccd08
    master date: 2015-10-12 16:02:53 +0200
---
 config/Tools.mk.in |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 9bd5f6c..ccfe137 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -5,9 +5,6 @@ ifeq ($(CONFIG_RUMP),y)
 XEN_OS              := NetBSDRump
 endif
 
-# A debug build of tools?
-debug               := @debug@
-
 # Tools path
 BISON               := @BISON@
 FLEX                := @FLEX@
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:55:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:55:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQSR-0005CB-GT; Sun, 25 Oct 2015 18:55:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSQ-0005Bw-Hb
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:54 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	C5/5B-00536-9B52D265; Sun, 25 Oct 2015 18:55:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1445799351!7005209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9401 invoked from network); 25 Oct 2015 18:55:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:55:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSN-0001wg-Fh
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSN-0000ns-CZ
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:55:51 +0000
Date: Sun, 25 Oct 2015 18:55:51 +0000
Message-Id: <E1ZqQSN-0000ns-CZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] build: don't shadow debug with
	"@debug@" in tools build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 62d9e74a593a336a4f0451d7c5cd2a4f223c6298
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 21 17:41:11 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:41:11 2015 +0200

    build: don't shadow debug with "@debug@" in tools build
    
    In 16181cbb (tools: Honor Config.mk debug value, rather than setting our
    own), configure doesn't set debug variable anymore. There is, however,
    one place that was missed. The file config/Tools.mk.in was still
    expecting a @debug@ value from configure. After 16181cbb that value
    remained "debug := @debug@" all the time because configure didn't
    substitute it.
    
    The consequence was that we couldn't get a debug build even if debug was
    set to "y" in Config.mk.
    
    Fix this by removing the stray line "debug := @debug@" in Tools.mk.in.
    
    Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 973ce7bd8fb1513dcc5ff04760e03915a9eccd08
    master date: 2015-10-12 16:02:53 +0200
---
 config/Tools.mk.in |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 9bd5f6c..ccfe137 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -5,9 +5,6 @@ ifeq ($(CONFIG_RUMP),y)
 XEN_OS              := NetBSDRump
 endif
 
-# A debug build of tools?
-debug               := @debug@
-
 # Tools path
 BISON               := @BISON@
 FLEX                := @FLEX@
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:56:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:56:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQSe-0005Dv-Iz; Sun, 25 Oct 2015 18:56: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 1ZqQSd-0005Dm-P1
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:07 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	A8/83-21201-7C52D265; Sun, 25 Oct 2015 18:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445799365!23718128!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9522 invoked from network); 25 Oct 2015 18:56:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:56:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSX-0001xH-S4
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSX-0000oN-OQ
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:01 +0000
Date: Sun, 25 Oct 2015 18:56:01 +0000
Message-Id: <E1ZqQSX-0000oN-OQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: hide MWAITX from PV domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 674c1f884b294751bcaf4ba4066d220244f4de0e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:41:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:41:59 2015 +0200

    x86: hide MWAITX from PV domains
    
    Since MWAIT is hidden too. (Linux starting with 4.3 is making use of
    that feature, and is checking for it without looking at the MWAIT one.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 941cd44324db7eddc46cba4596fa13d505066ccf
    master date: 2015-10-13 17:17:52 +0200
---
 xen/arch/x86/traps.c             |    1 +
 xen/include/asm-x86/cpufeature.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 9f5a6c6..c6231b5 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -967,6 +967,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_LWP % 32, &c);
         __clear_bit(X86_FEATURE_NODEID_MSR % 32, &c);
         __clear_bit(X86_FEATURE_TOPOEXT % 32, &c);
+        __clear_bit(X86_FEATURE_MWAITX % 32, &c);
         break;
 
     case 0x0000000a: /* Architectural Performance Monitor Features (Intel) */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 9a01563..0bf278b 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -135,6 +135,7 @@
 #define X86_FEATURE_TBM         (6*32+21) /* trailing bit manipulations */
 #define X86_FEATURE_TOPOEXT     (6*32+22) /* topology extensions CPUID leafs */
 #define X86_FEATURE_DBEXT       (6*32+26) /* data breakpoint extension */
+#define X86_FEATURE_MWAITX      (6*32+29) /* MWAIT extension (MONITORX/MWAITX) */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:56:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:56:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQSe-0005Dv-Iz; Sun, 25 Oct 2015 18:56: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 1ZqQSd-0005Dm-P1
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:07 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	A8/83-21201-7C52D265; Sun, 25 Oct 2015 18:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1445799365!23718128!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9522 invoked from network); 25 Oct 2015 18:56:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:56:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSX-0001xH-S4
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSX-0000oN-OQ
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:01 +0000
Date: Sun, 25 Oct 2015 18:56:01 +0000
Message-Id: <E1ZqQSX-0000oN-OQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: hide MWAITX from PV domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 674c1f884b294751bcaf4ba4066d220244f4de0e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:41:59 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:41:59 2015 +0200

    x86: hide MWAITX from PV domains
    
    Since MWAIT is hidden too. (Linux starting with 4.3 is making use of
    that feature, and is checking for it without looking at the MWAIT one.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 941cd44324db7eddc46cba4596fa13d505066ccf
    master date: 2015-10-13 17:17:52 +0200
---
 xen/arch/x86/traps.c             |    1 +
 xen/include/asm-x86/cpufeature.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 9f5a6c6..c6231b5 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -967,6 +967,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_LWP % 32, &c);
         __clear_bit(X86_FEATURE_NODEID_MSR % 32, &c);
         __clear_bit(X86_FEATURE_TOPOEXT % 32, &c);
+        __clear_bit(X86_FEATURE_MWAITX % 32, &c);
         break;
 
     case 0x0000000a: /* Architectural Performance Monitor Features (Intel) */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 9a01563..0bf278b 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -135,6 +135,7 @@
 #define X86_FEATURE_TBM         (6*32+21) /* trailing bit manipulations */
 #define X86_FEATURE_TOPOEXT     (6*32+22) /* topology extensions CPUID leafs */
 #define X86_FEATURE_DBEXT       (6*32+26) /* data breakpoint extension */
+#define X86_FEATURE_MWAITX      (6*32+29) /* MWAIT extension (MONITORX/MWAITX) */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:56:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:56:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQSp-0005FN-LN; Sun, 25 Oct 2015 18:56:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSo-0005FB-7J
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:18 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	90/99-06179-1D52D265; Sun, 25 Oct 2015 18:56:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1445799375!40808299!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4093 invoked from network); 25 Oct 2015 18:56:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:56:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSl-0001xP-LE
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSl-0000op-IO
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:15 +0000
Date: Sun, 25 Oct 2015 18:56:15 +0000
Message-Id: <E1ZqQSl-0000op-IO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/NUMA: fix SRAT table processor
	entry parsing and consumption
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83bd6ba0b5dffa4e54a5b57ff0d62bf7c5d646b9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:42:51 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:42:51 2015 +0200

    x86/NUMA: fix SRAT table processor entry parsing and consumption
    
    - don't overrun apicid_to_node[] (possible in the x2APIC case)
    - don't limit number of processor related SRAT entries we can consume
    - make acpi_numa_{processor,x2apic}_affinity_init() as similar to one
      another as possible
    - print APIC IDs in hex (to ease matching with other log messages), at
      once making legacy and x2APIC ones distinguishable (by width)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 83281fc9b31396e94c0bfb6550b75c165037a0ad
    master date: 2015-10-14 12:46:27 +0200
---
 xen/arch/x86/numa.c     |    2 +-
 xen/arch/x86/setup.c    |    2 +-
 xen/arch/x86/smpboot.c  |    3 ++-
 xen/arch/x86/srat.c     |   18 +++++++++++-------
 xen/drivers/acpi/numa.c |    4 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 132d694..87fb704 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -349,7 +349,7 @@ void __init init_cpu_to_node(void)
         u32 apicid = x86_cpu_to_apicid[i];
         if ( apicid == BAD_APICID )
             continue;
-        node = apicid_to_node[apicid];
+        node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
         if ( node == NUMA_NO_NODE || !node_online(node) )
             node = 0;
         numa_set_node(i, node);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3946e4c..54995ed 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -200,7 +200,7 @@ void __devinit srat_detect_node(int cpu)
     nodeid_t node;
     u32 apicid = x86_cpu_to_apicid[cpu];
 
-    node = apicid_to_node[apicid];
+    node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
     if ( node == NUMA_NO_NODE )
         node = 0;
 
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 0d55d7f..0946992 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -993,7 +993,8 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm)
             cpu = node;
             goto out;
         }
-        apicid_to_node[apic_id] = node;
+        if ( apic_id < MAX_LOCAL_APIC )
+             apicid_to_node[apic_id] = node;
     }
 
     /* Physically added CPUs do not have synchronised TSC. */
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 4242d10..909c6f7 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -209,7 +209,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 {
 	unsigned pxm;
 	nodeid_t node;
-	u32 apic_id;
 
 	if (srat_disabled())
 		return;
@@ -217,8 +216,13 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		bad_srat();
 		return;
 	}
-	if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
+	if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
+		return;
+	if (pa->apic_id >= MAX_LOCAL_APIC) {
+		printk(KERN_INFO "SRAT: APIC %08x ignored\n", pa->apic_id);
 		return;
+	}
+
 	pxm = pa->proximity_domain;
 	node = setup_node(pxm);
 	if (node == NUMA_NO_NODE) {
@@ -226,11 +230,11 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		return;
 	}
 
-	apic_id = pa->apic_id;
-	apicid_to_node[apic_id] = node;
+	apicid_to_node[pa->apic_id] = node;
+	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
-	       pxm, apic_id, node);
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n",
+	       pxm, pa->apic_id, node);
 }
 
 /* Callback for Proximity Domain -> LAPIC mapping */
@@ -262,7 +266,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	apicid_to_node[pa->apic_id] = node;
 	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n",
 	       pxm, pa->apic_id, node);
 }
 
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 434194e..c1fd753 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -198,9 +198,9 @@ int __init acpi_numa_init(void)
 	/* SRAT: Static Resource Affinity Table */
 	if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
-				      acpi_parse_x2apic_affinity, NR_CPUS);
+				      acpi_parse_x2apic_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
-				      acpi_parse_processor_affinity, NR_CPUS);
+				      acpi_parse_processor_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
 				      acpi_parse_memory_affinity,
 				      NR_NODE_MEMBLKS);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:56:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:56:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZqQSp-0005FN-LN; Sun, 25 Oct 2015 18:56:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSo-0005FB-7J
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:18 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	90/99-06179-1D52D265; Sun, 25 Oct 2015 18:56:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1445799375!40808299!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4093 invoked from network); 25 Oct 2015 18:56:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:56:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSl-0001xP-LE
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSl-0000op-IO
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:15 +0000
Date: Sun, 25 Oct 2015 18:56:15 +0000
Message-Id: <E1ZqQSl-0000op-IO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/NUMA: fix SRAT table processor
	entry parsing and consumption
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83bd6ba0b5dffa4e54a5b57ff0d62bf7c5d646b9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:42:51 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:42:51 2015 +0200

    x86/NUMA: fix SRAT table processor entry parsing and consumption
    
    - don't overrun apicid_to_node[] (possible in the x2APIC case)
    - don't limit number of processor related SRAT entries we can consume
    - make acpi_numa_{processor,x2apic}_affinity_init() as similar to one
      another as possible
    - print APIC IDs in hex (to ease matching with other log messages), at
      once making legacy and x2APIC ones distinguishable (by width)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 83281fc9b31396e94c0bfb6550b75c165037a0ad
    master date: 2015-10-14 12:46:27 +0200
---
 xen/arch/x86/numa.c     |    2 +-
 xen/arch/x86/setup.c    |    2 +-
 xen/arch/x86/smpboot.c  |    3 ++-
 xen/arch/x86/srat.c     |   18 +++++++++++-------
 xen/drivers/acpi/numa.c |    4 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 132d694..87fb704 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -349,7 +349,7 @@ void __init init_cpu_to_node(void)
         u32 apicid = x86_cpu_to_apicid[i];
         if ( apicid == BAD_APICID )
             continue;
-        node = apicid_to_node[apicid];
+        node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
         if ( node == NUMA_NO_NODE || !node_online(node) )
             node = 0;
         numa_set_node(i, node);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3946e4c..54995ed 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -200,7 +200,7 @@ void __devinit srat_detect_node(int cpu)
     nodeid_t node;
     u32 apicid = x86_cpu_to_apicid[cpu];
 
-    node = apicid_to_node[apicid];
+    node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
     if ( node == NUMA_NO_NODE )
         node = 0;
 
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 0d55d7f..0946992 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -993,7 +993,8 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm)
             cpu = node;
             goto out;
         }
-        apicid_to_node[apic_id] = node;
+        if ( apic_id < MAX_LOCAL_APIC )
+             apicid_to_node[apic_id] = node;
     }
 
     /* Physically added CPUs do not have synchronised TSC. */
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 4242d10..909c6f7 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -209,7 +209,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 {
 	unsigned pxm;
 	nodeid_t node;
-	u32 apic_id;
 
 	if (srat_disabled())
 		return;
@@ -217,8 +216,13 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		bad_srat();
 		return;
 	}
-	if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
+	if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
+		return;
+	if (pa->apic_id >= MAX_LOCAL_APIC) {
+		printk(KERN_INFO "SRAT: APIC %08x ignored\n", pa->apic_id);
 		return;
+	}
+
 	pxm = pa->proximity_domain;
 	node = setup_node(pxm);
 	if (node == NUMA_NO_NODE) {
@@ -226,11 +230,11 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		return;
 	}
 
-	apic_id = pa->apic_id;
-	apicid_to_node[apic_id] = node;
+	apicid_to_node[pa->apic_id] = node;
+	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
-	       pxm, apic_id, node);
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n",
+	       pxm, pa->apic_id, node);
 }
 
 /* Callback for Proximity Domain -> LAPIC mapping */
@@ -262,7 +266,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	apicid_to_node[pa->apic_id] = node;
 	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n",
 	       pxm, pa->apic_id, node);
 }
 
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 434194e..c1fd753 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -198,9 +198,9 @@ int __init acpi_numa_init(void)
 	/* SRAT: Static Resource Affinity Table */
 	if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
-				      acpi_parse_x2apic_affinity, NR_CPUS);
+				      acpi_parse_x2apic_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
-				      acpi_parse_processor_affinity, NR_CPUS);
+				      acpi_parse_processor_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
 				      acpi_parse_memory_affinity,
 				      NR_NODE_MEMBLKS);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:56:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:56: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 1ZqQSz-0005H4-Pm; Sun, 25 Oct 2015 18:56: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 1ZqQSy-0005Gs-FL
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:28 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	78/1D-12831-BD52D265; Sun, 25 Oct 2015 18:56:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1445799386!44926818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31935 invoked from network); 25 Oct 2015 18:56:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:56:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSw-0001xX-0a
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSv-0000pv-U6
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:25 +0000
Date: Sun, 25 Oct 2015 18:56:25 +0000
Message-Id: <E1ZqQSv-0000pv-U6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] arm: reduce power use by contented
	spin locks with WFE/SEV
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a5921e557f534a569b22268ebdb58dbc29a30a0
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Aug 3 12:29:19 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 12:36:55 2015 +0100

    arm: reduce power use by contented spin locks with WFE/SEV
    
    Instead of cpu_relax() while spinning and observing the ticket head,
    introduce arch_lock_relax() which executes a WFE instruction.  After
    the ticket head is changed call arch_lock_signal() to execute an SEV
    instruction (with the required DSB first) to wake any spinners.
    
    This should improve power consumption when locks are contented and
    spinning.
    
    For consistency also move arch_lock_(acquire|release)_barrier to
    asm/spinlock.h.
    
    Booted the result on arm32 (Midway) and arm64 (Mustang). Build test
    only on amd64.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    [ijc: add barrier, rename as arch_lock_*, move arch_lock_*_barrier, test]
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    
    (cherry picked from commit e625faf45ee1349be7da2b27e38567e01ce4b453)
---
 xen/common/spinlock.c          |    5 +++--
 xen/include/asm-arm/spinlock.h |    9 ++++++++-
 xen/include/asm-arm/system.h   |    3 ---
 xen/include/asm-x86/spinlock.h |   14 ++++++++++++++
 xen/include/asm-x86/system.h   |   11 -----------
 5 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 29149d1..7f89694 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -141,7 +141,7 @@ void _spin_lock(spinlock_t *lock)
     while ( tickets.tail != observe_head(&lock->tickets) )
     {
         LOCK_PROFILE_BLOCK;
-        cpu_relax();
+        arch_lock_relax();
     }
     LOCK_PROFILE_GOT;
     preempt_disable();
@@ -170,6 +170,7 @@ void _spin_unlock(spinlock_t *lock)
     preempt_enable();
     LOCK_PROFILE_REL;
     add_sized(&lock->tickets.head, 1);
+    arch_lock_signal();
 }
 
 void _spin_unlock_irq(spinlock_t *lock)
@@ -228,7 +229,7 @@ void _spin_barrier(spinlock_t *lock)
     if ( sample.head != sample.tail )
     {
         while ( observe_head(&lock->tickets) == sample.head )
-            cpu_relax();
+            arch_lock_relax();
 #ifdef LOCK_PROFILE
         if ( lock->profile )
         {
diff --git a/xen/include/asm-arm/spinlock.h b/xen/include/asm-arm/spinlock.h
index 81955d1..8cdf9e1 100644
--- a/xen/include/asm-arm/spinlock.h
+++ b/xen/include/asm-arm/spinlock.h
@@ -1,6 +1,13 @@
 #ifndef __ASM_SPINLOCK_H
 #define __ASM_SPINLOCK_H
 
-/* Nothing ARM specific. */
+#define arch_lock_acquire_barrier() smp_mb()
+#define arch_lock_release_barrier() smp_mb()
+
+#define arch_lock_relax() wfe()
+#define arch_lock_signal() do { \
+    dsb(ishst);                 \
+    sev();                      \
+} while(0)
 
 #endif /* __ASM_SPINLOCK_H */
diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
index f0e222f..2eb96e8 100644
--- a/xen/include/asm-arm/system.h
+++ b/xen/include/asm-arm/system.h
@@ -53,9 +53,6 @@
 
 #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
 
-#define arch_lock_acquire_barrier() smp_mb()
-#define arch_lock_release_barrier() smp_mb()
-
 extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);
 
 #endif
diff --git a/xen/include/asm-x86/spinlock.h b/xen/include/asm-x86/spinlock.h
index 7d69e75..70a85af 100644
--- a/xen/include/asm-x86/spinlock.h
+++ b/xen/include/asm-x86/spinlock.h
@@ -4,4 +4,18 @@
 #define _raw_read_unlock(l) \
     asm volatile ( "lock; dec%z0 %0" : "+m" ((l)->lock) :: "memory" )
 
+/*
+ * On x86 the only reordering is of reads with older writes.  In the
+ * lock case, the read in observe_head() can only be reordered with
+ * writes that precede it, and moving a write _into_ a locked section
+ * is OK.  In the release case, the write in add_sized() can only be
+ * reordered with reads that follow it, and hoisting a read _into_ a
+ * locked region is OK.
+ */
+#define arch_lock_acquire_barrier() barrier()
+#define arch_lock_release_barrier() barrier()
+
+#define arch_lock_relax() cpu_relax()
+#define arch_lock_signal()
+
 #endif /* __ASM_SPINLOCK_H */
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 25a6a2a..9fb70f5 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -185,17 +185,6 @@ static always_inline unsigned long __xadd(
 #define set_mb(var, value) do { xchg(&var, value); } while (0)
 #define set_wmb(var, value) do { var = value; wmb(); } while (0)
 
-/*
- * On x86 the only reordering is of reads with older writes.  In the
- * lock case, the read in observe_head() can only be reordered with
- * writes that precede it, and moving a write _into_ a locked section
- * is OK.  In the release case, the write in add_sized() can only be
- * reordered with reads that follow it, and hoisting a read _into_ a
- * locked region is OK.
- */
-#define arch_lock_acquire_barrier() barrier()
-#define arch_lock_release_barrier() barrier()
-
 #define local_irq_disable()     asm volatile ( "cli" : : : "memory" )
 #define local_irq_enable()      asm volatile ( "sti" : : : "memory" )
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:56:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:56: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 1ZqQSz-0005H4-Pm; Sun, 25 Oct 2015 18:56: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 1ZqQSy-0005Gs-FL
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:28 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	78/1D-12831-BD52D265; Sun, 25 Oct 2015 18:56:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1445799386!44926818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31935 invoked from network); 25 Oct 2015 18:56:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:56:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSw-0001xX-0a
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQSv-0000pv-U6
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:25 +0000
Date: Sun, 25 Oct 2015 18:56:25 +0000
Message-Id: <E1ZqQSv-0000pv-U6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] arm: reduce power use by contented
	spin locks with WFE/SEV
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a5921e557f534a569b22268ebdb58dbc29a30a0
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Aug 3 12:29:19 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 12:36:55 2015 +0100

    arm: reduce power use by contented spin locks with WFE/SEV
    
    Instead of cpu_relax() while spinning and observing the ticket head,
    introduce arch_lock_relax() which executes a WFE instruction.  After
    the ticket head is changed call arch_lock_signal() to execute an SEV
    instruction (with the required DSB first) to wake any spinners.
    
    This should improve power consumption when locks are contented and
    spinning.
    
    For consistency also move arch_lock_(acquire|release)_barrier to
    asm/spinlock.h.
    
    Booted the result on arm32 (Midway) and arm64 (Mustang). Build test
    only on amd64.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    [ijc: add barrier, rename as arch_lock_*, move arch_lock_*_barrier, test]
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    
    (cherry picked from commit e625faf45ee1349be7da2b27e38567e01ce4b453)
---
 xen/common/spinlock.c          |    5 +++--
 xen/include/asm-arm/spinlock.h |    9 ++++++++-
 xen/include/asm-arm/system.h   |    3 ---
 xen/include/asm-x86/spinlock.h |   14 ++++++++++++++
 xen/include/asm-x86/system.h   |   11 -----------
 5 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 29149d1..7f89694 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -141,7 +141,7 @@ void _spin_lock(spinlock_t *lock)
     while ( tickets.tail != observe_head(&lock->tickets) )
     {
         LOCK_PROFILE_BLOCK;
-        cpu_relax();
+        arch_lock_relax();
     }
     LOCK_PROFILE_GOT;
     preempt_disable();
@@ -170,6 +170,7 @@ void _spin_unlock(spinlock_t *lock)
     preempt_enable();
     LOCK_PROFILE_REL;
     add_sized(&lock->tickets.head, 1);
+    arch_lock_signal();
 }
 
 void _spin_unlock_irq(spinlock_t *lock)
@@ -228,7 +229,7 @@ void _spin_barrier(spinlock_t *lock)
     if ( sample.head != sample.tail )
     {
         while ( observe_head(&lock->tickets) == sample.head )
-            cpu_relax();
+            arch_lock_relax();
 #ifdef LOCK_PROFILE
         if ( lock->profile )
         {
diff --git a/xen/include/asm-arm/spinlock.h b/xen/include/asm-arm/spinlock.h
index 81955d1..8cdf9e1 100644
--- a/xen/include/asm-arm/spinlock.h
+++ b/xen/include/asm-arm/spinlock.h
@@ -1,6 +1,13 @@
 #ifndef __ASM_SPINLOCK_H
 #define __ASM_SPINLOCK_H
 
-/* Nothing ARM specific. */
+#define arch_lock_acquire_barrier() smp_mb()
+#define arch_lock_release_barrier() smp_mb()
+
+#define arch_lock_relax() wfe()
+#define arch_lock_signal() do { \
+    dsb(ishst);                 \
+    sev();                      \
+} while(0)
 
 #endif /* __ASM_SPINLOCK_H */
diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
index f0e222f..2eb96e8 100644
--- a/xen/include/asm-arm/system.h
+++ b/xen/include/asm-arm/system.h
@@ -53,9 +53,6 @@
 
 #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
 
-#define arch_lock_acquire_barrier() smp_mb()
-#define arch_lock_release_barrier() smp_mb()
-
 extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);
 
 #endif
diff --git a/xen/include/asm-x86/spinlock.h b/xen/include/asm-x86/spinlock.h
index 7d69e75..70a85af 100644
--- a/xen/include/asm-x86/spinlock.h
+++ b/xen/include/asm-x86/spinlock.h
@@ -4,4 +4,18 @@
 #define _raw_read_unlock(l) \
     asm volatile ( "lock; dec%z0 %0" : "+m" ((l)->lock) :: "memory" )
 
+/*
+ * On x86 the only reordering is of reads with older writes.  In the
+ * lock case, the read in observe_head() can only be reordered with
+ * writes that precede it, and moving a write _into_ a locked section
+ * is OK.  In the release case, the write in add_sized() can only be
+ * reordered with reads that follow it, and hoisting a read _into_ a
+ * locked region is OK.
+ */
+#define arch_lock_acquire_barrier() barrier()
+#define arch_lock_release_barrier() barrier()
+
+#define arch_lock_relax() cpu_relax()
+#define arch_lock_signal()
+
 #endif /* __ASM_SPINLOCK_H */
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 25a6a2a..9fb70f5 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -185,17 +185,6 @@ static always_inline unsigned long __xadd(
 #define set_mb(var, value) do { xchg(&var, value); } while (0)
 #define set_wmb(var, value) do { var = value; wmb(); } while (0)
 
-/*
- * On x86 the only reordering is of reads with older writes.  In the
- * lock case, the read in observe_head() can only be reordered with
- * writes that precede it, and moving a write _into_ a locked section
- * is OK.  In the release case, the write in add_sized() can only be
- * reordered with reads that follow it, and hoisting a read _into_ a
- * locked region is OK.
- */
-#define arch_lock_acquire_barrier() barrier()
-#define arch_lock_release_barrier() barrier()
-
 #define local_irq_disable()     asm volatile ( "cli" : : : "memory" )
 #define local_irq_enable()      asm volatile ( "sti" : : : "memory" )
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:56:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:56: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 1ZqQT9-0005My-Sk; Sun, 25 Oct 2015 18:56: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 1ZqQT9-0005LA-3Q
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:39 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	FC/1D-01753-6E52D265; Sun, 25 Oct 2015 18:56:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1445799396!55254534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29351 invoked from network); 25 Oct 2015 18:56:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:56:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQT6-0001xg-9G
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQT6-0000qN-7Q
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:36 +0000
Date: Sun, 25 Oct 2015 18:56:36 +0000
Message-Id: <E1ZqQT6-0000qN-7Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4a1dcbfaeb4aa30101b2c9befaca9d460713396
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 22 16:03:10 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index d422924..d20cdef 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -741,14 +741,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -787,9 +790,8 @@ Note this would override global B<rdm> option.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Oct 25 18:56:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Oct 2015 18:56: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 1ZqQT9-0005My-Sk; Sun, 25 Oct 2015 18:56: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 1ZqQT9-0005LA-3Q
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:39 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	FC/1D-01753-6E52D265; Sun, 25 Oct 2015 18:56:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1445799396!55254534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29351 invoked from network); 25 Oct 2015 18:56:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2015 18:56:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQT6-0001xg-9G
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZqQT6-0000qN-7Q
	for xen-changelog@lists.xensource.com; Sun, 25 Oct 2015 18:56:36 +0000
Date: Sun, 25 Oct 2015 18:56:36 +0000
Message-Id: <E1ZqQT6-0000qN-7Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] docs: xl.cfg: permissive option is
	not PV only.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4a1dcbfaeb4aa30101b2c9befaca9d460713396
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 6 09:42:35 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 22 16:03:10 2015 +0100

    docs: xl.cfg: permissive option is not PV only.
    
    Since XSA-131 qemu-xen has defaulted to non-permissive mode and the
    option was extended to cover that case in 015a373351e5 "tools: libxl:
    allow permissive qemu-upstream pci passthrough".
    
    Since I was rewrapping to adjust the text anyway I've split the safety
    warning into a separate paragraph to make it more obvious.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Eric <epretorious@yahoo.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 7f25baba1c0942e50757f4ecb233202dbbc057b9)
---
 docs/man/xl.cfg.pod.5 |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index d422924..d20cdef 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -741,14 +741,17 @@ Possible B<KEY>s are:
 
 =item B<permissive=BOOLEAN>
 
-(PV only) By default pciback only allows PV guests to write "known
-safe" values into PCI config space.  But many devices require writes
-to other areas of config space in order to operate properly.  This
-tells the pciback driver to allow all writes to PCI config space of
-this device by this domain.  This option should be enabled with
-caution: it gives the guest much more control over the device, which
-may have security or stability implications.  It is recommended to
-enable this option only for trusted VMs under administrator control.
+By default pciback only allows PV guests to write "known safe" values
+into PCI config space, likewise QEMU (both qemu-xen and
+qemu-traditional) imposes the same contraint on HVM guests. However
+many devices require writes to other areas of config space in order to
+operate properly.  This option tells the backend (pciback or QEMU) to
+allow all writes to PCI config space of this device by this domain.
+
+This option should be enabled with caution: it gives the guest much
+more control over the device, which may have security or stability
+implications.  It is recommended to enable this option only for
+trusted VMs under administrator control.
 
 =item B<msitranslate=BOOLEAN>
 
@@ -787,9 +790,8 @@ Note this would override global B<rdm> option.
 
 =item B<pci_permissive=BOOLEAN>
 
-(PV only) Changes the default value of 'permissive' for all PCI
-devices passed through to this VM. See L<permissive|/"permissive_boolean">
-above.
+Changes the default value of 'permissive' for all PCI devices passed
+through to this VM. See L<permissive|/"permissive_boolean"> above.
 
 =item B<pci_msitranslate=BOOLEAN>
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:11:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkB1-0001Sb-NG; Thu, 29 Oct 2015 10:11:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB0-0001SK-Jr
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:22 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	A9/90-12371-7C0F1365; Thu, 29 Oct 2015 10:11:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446113476!35986682!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7654 invoked from network); 29 Oct 2015 10:11:18 -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;
	29 Oct 2015 10:11:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkAu-0004ZB-2i
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkAt-00052S-T2
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:15 +0000
Date: Thu, 29 Oct 2015 10:11:15 +0000
Message-Id: <E1ZrkAt-00052S-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: CODING_STYLE: GC* cannot
	be used with NOGC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b7df8e8079995b3b9431084f77fe2526eb4ef18
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 16 11:33:12 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:07:43 2015 +0100

    tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
    
    GC* assume an existing gc in scope, which means they can't be passed
    NOGC. Instead recommend the use of the underlying functions with NOGC,
    noting that this is excepitonal.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- refer to libxl__calloc not (nonexistent) libxl__alloc ]
---
 tools/libxl/CODING_STYLE |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/CODING_STYLE b/tools/libxl/CODING_STYLE
index a65efb3..919bcc6 100644
--- a/tools/libxl/CODING_STYLE
+++ b/tools/libxl/CODING_STYLE
@@ -57,13 +57,14 @@ whenever they are applicable.  For example:
   libxl__log[v]           LOG, LOGE, LOGEV
   libxl__sprintf          GCSPRINTF
   libxl__*alloc et al.    GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY
-  malloc et al.           GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY with NOGC
   isalnum etc. directly   CTYPE
   libxl__ctx_[un]lock     CTX_LOCK, CTX_UNLOCK
   gc=...; ao=...;         EGC_GC, AO_GC, STATE_AO_GC
   explicit gc creation    GC_INIT, GC_FREE
   memset(..,0,sizeof..)   FILLZERO
 
+Instead of malloc et al one should (as an exception to the above) use
+libxl__{zalloc,calloc,realloc} etc but passing NOGC.
 
 ERROR HANDLING
 --------------
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:11:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkB1-0001Sg-PV; Thu, 29 Oct 2015 10:11:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB0-0001SR-9r
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:22 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	85/E6-14422-9C0F1365; Thu, 29 Oct 2015 10:11:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446113465!40647746!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 8603 invoked from network); 29 Oct 2015 10:11:06 -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 Oct 2015 10:11:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkAj-0004Z7-4V
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkAi-000516-Rq
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:05 +0000
Date: Thu, 29 Oct 2015 10:11:04 +0000
Message-Id: <E1ZrkAi-000516-Rq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Update libxl flex outputs to
	Flex from Jessie.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f8b201e720020b7fb7e557dc3146913b3c18b90f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jul 15 11:21:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:05:39 2015 +0100

    tools: Update libxl flex outputs to Flex from Jessie.
    
    This is the result of
      $ find -name \*.l -exec touch {} \;
      $ find -name \*.y -exec touch {} \;
    
    and then rebuilding.
    
    This avoids churn on the machine I use for committing which has been
    updated, causing flex to go from 2.5.35-10.1 to 2.5.39-8.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxlu_cfg_l.c  |   80 ++--
 tools/libxl/libxlu_cfg_l.h  |   12 +-
 tools/libxl/libxlu_cfg_y.c  | 1177 +++++++++++++++++++------------------------
 tools/libxl/libxlu_cfg_y.h  |   70 ++--
 tools/libxl/libxlu_disk_l.c |   72 ++--
 tools/libxl/libxlu_disk_l.h |   12 +-
 6 files changed, 651 insertions(+), 772 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_l.c b/tools/libxl/libxlu_cfg_l.c
index 450863a..2d2be39 100644
--- a/tools/libxl/libxlu_cfg_l.c
+++ b/tools/libxl/libxlu_cfg_l.c
@@ -9,7 +9,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -179,6 +179,11 @@ typedef void* yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
@@ -197,6 +202,13 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
             }while(0)
+    #define YY_LINENO_REWIND_TO(dst) \
+            do {\
+                const char *p;\
+                for ( p = yy_cp-1; p >= (dst); --p)\
+                    if ( *p == '\n' )\
+                        --yylineno;\
+            }while(0)
     
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -214,11 +226,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -236,7 +243,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -315,7 +322,7 @@ static void xlu__cfg_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yysc
 
 YY_BUFFER_STATE xlu__cfg_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE xlu__cfg_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 void *xlu__cfg_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *xlu__cfg_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -345,7 +352,7 @@ void xlu__cfg_yyfree (void * ,yyscan_t yyscanner );
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
-#define xlu__cfg_yywrap(n) 1
+#define xlu__cfg_yywrap(yyscanner) 1
 #define YY_SKIP_YYWRAP
 
 typedef unsigned char YY_CHAR;
@@ -514,7 +521,7 @@ int xlu__cfg_yyget_column(yyscan_t yyscanner);
 void xlu__cfg_yyset_column(int  column_no, yyscan_t yyscanner);
 
 
-#line 518 "libxlu_cfg_l.c"
+#line 525 "libxlu_cfg_l.c"
 
 #define INITIAL 0
 #define lexerr 1
@@ -544,8 +551,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -602,7 +609,7 @@ FILE *xlu__cfg_yyget_out (yyscan_t yyscanner );
 
 void xlu__cfg_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int xlu__cfg_yyget_leng (yyscan_t yyscanner );
+yy_size_t xlu__cfg_yyget_leng (yyscan_t yyscanner );
 
 char *xlu__cfg_yyget_text (yyscan_t yyscanner );
 
@@ -763,11 +770,6 @@ YY_DECL
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 53 "libxlu_cfg_l.l"
-
-
-#line 770 "libxlu_cfg_l.c"
-
     yylval = yylval_param;
 
     yylloc = yylloc_param;
@@ -798,6 +800,12 @@ YY_DECL
 		xlu__cfg_yy_load_buffer_state(yyscanner );
 		}
 
+	{
+#line 53 "libxlu_cfg_l.l"
+
+
+#line 808 "libxlu_cfg_l.c"
+
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
 		yyg->yy_more_len = 0;
@@ -820,7 +828,7 @@ YY_DECL
 yy_match:
 		do
 			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
 			if ( yy_accept[yy_current_state] )
 				{
 				yyg->yy_last_accepting_state = yy_current_state;
@@ -846,7 +854,7 @@ yy_find_action:
 
 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
 			{
-			int yyl;
+			yy_size_t yyl;
 			for ( yyl = yyg->yy_more_len; yyl < yyleng; ++yyl )
 				if ( yytext[yyl] == '\n' )
 					   
@@ -975,7 +983,7 @@ YY_RULE_SETUP
 #line 104 "libxlu_cfg_l.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
 	YY_BREAK
-#line 979 "libxlu_cfg_l.c"
+#line 987 "libxlu_cfg_l.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(lexerr):
 	yyterminate();
@@ -1108,6 +1116,7 @@ case YY_STATE_EOF(lexerr):
 			"fatal flex scanner internal error--no action found" );
 	} /* end of action switch */
 		} /* end of scanning one token */
+	} /* end of user's declarations */
 } /* end of xlu__cfg_yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1164,21 +1173,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 	else
 		{
-			int num_to_read =
+			yy_size_t num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
 			{ /* Not enough room in the buffer - grow it. */
 
 			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
 			int yy_c_buf_p_offset =
 				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 			if ( b->yy_is_our_buffer )
 				{
-				int new_size = b->yy_buf_size * 2;
+				yy_size_t new_size = b->yy_buf_size * 2;
 
 				if ( new_size <= 0 )
 					b->yy_buf_size += b->yy_buf_size / 8;
@@ -1209,7 +1218,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, (size_t) num_to_read );
+			yyg->yy_n_chars, num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
@@ -1306,6 +1315,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 	yy_is_jam = (yy_current_state == 34);
 
+	(void)yyg;
 	return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1334,7 +1344,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		else
 			{ /* need more input */
-			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 			++yyg->yy_c_buf_p;
 
 			switch ( yy_get_next_buffer( yyscanner ) )
@@ -1505,10 +1515,6 @@ static void xlu__cfg_yy_load_buffer_state  (yyscan_t yyscanner)
 	xlu__cfg_yyfree((void *) b ,yyscanner );
 }
 
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a xlu__cfg_yyrestart() or at EOF.
@@ -1625,7 +1631,7 @@ void xlu__cfg_yypop_buffer_state (yyscan_t yyscanner)
  */
 static void xlu__cfg_yyensure_buffer_stack (yyscan_t yyscanner)
 {
-	int num_to_alloc;
+	yy_size_t num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 	if (!yyg->yy_buffer_stack) {
@@ -1723,12 +1729,12 @@ YY_BUFFER_STATE xlu__cfg_yy_scan_string (yyconst char * yystr , yyscan_t yyscann
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE xlu__cfg_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE xlu__cfg_yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
 	char *buf;
 	yy_size_t n;
-	int i;
+	yy_size_t i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
@@ -1838,7 +1844,7 @@ FILE *xlu__cfg_yyget_out  (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int xlu__cfg_yyget_leng  (yyscan_t yyscanner)
+yy_size_t xlu__cfg_yyget_leng  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyleng;
@@ -1874,7 +1880,7 @@ void xlu__cfg_yyset_lineno (int  line_number , yyscan_t yyscanner)
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "xlu__cfg_yyset_lineno called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "xlu__cfg_yyset_lineno called with no buffer" );
     
     yylineno = line_number;
 }
@@ -1889,7 +1895,7 @@ void xlu__cfg_yyset_column (int  column_no , yyscan_t yyscanner)
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "xlu__cfg_yyset_column called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "xlu__cfg_yyset_column called with no buffer" );
     
     yycolumn = column_no;
 }
@@ -2125,4 +2131,4 @@ void xlu__cfg_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 104 "libxlu_cfg_l.l"
+#line 103 "libxlu_cfg_l.l"
diff --git a/tools/libxl/libxlu_cfg_l.h b/tools/libxl/libxlu_cfg_l.h
index 151064e..bdf0517 100644
--- a/tools/libxl/libxlu_cfg_l.h
+++ b/tools/libxl/libxlu_cfg_l.h
@@ -13,7 +13,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -170,7 +170,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -214,13 +214,13 @@ void xlu__cfg_yypop_buffer_state (yyscan_t yyscanner );
 
 YY_BUFFER_STATE xlu__cfg_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE xlu__cfg_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 void *xlu__cfg_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *xlu__cfg_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
 void xlu__cfg_yyfree (void * ,yyscan_t yyscanner );
 
-#define xlu__cfg_yywrap(n) 1
+#define xlu__cfg_yywrap(yyscanner) 1
 #define YY_SKIP_YYWRAP
 
 #define yytext_ptr yytext_r
@@ -268,7 +268,7 @@ FILE *xlu__cfg_yyget_out (yyscan_t yyscanner );
 
 void xlu__cfg_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int xlu__cfg_yyget_leng (yyscan_t yyscanner );
+yy_size_t xlu__cfg_yyget_leng (yyscan_t yyscanner );
 
 char *xlu__cfg_yyget_text (yyscan_t yyscanner );
 
@@ -354,7 +354,7 @@ extern int xlu__cfg_yylex \
 #undef YY_DECL
 #endif
 
-#line 104 "libxlu_cfg_l.l"
+#line 103 "libxlu_cfg_l.l"
 
 #line 360 "libxlu_cfg_l.h"
 #undef xlu__cfg_yyIN_HEADER
diff --git a/tools/libxl/libxlu_cfg_y.c b/tools/libxl/libxlu_cfg_y.c
index fbfdd0f..734e60a 100644
--- a/tools/libxl/libxlu_cfg_y.c
+++ b/tools/libxl/libxlu_cfg_y.c
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.5.  */
+/* A Bison parser, made by GNU Bison 3.0.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -26,7 +26,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -44,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.5"
+#define YYBISON_VERSION "3.0.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -58,36 +58,31 @@
 /* Pull parsers.  */
 #define YYPULL 1
 
-/* Using locations.  */
-#define YYLSP_NEEDED 1
 
 /* Substitute the variable and function names.  */
 #define yyparse         xlu__cfg_yyparse
 #define yylex           xlu__cfg_yylex
 #define yyerror         xlu__cfg_yyerror
-#define yylval          xlu__cfg_yylval
-#define yychar          xlu__cfg_yychar
 #define yydebug         xlu__cfg_yydebug
 #define yynerrs         xlu__cfg_yynerrs
-#define yylloc          xlu__cfg_yylloc
 
-/* Copy the first part of user declarations.  */
 
-/* Line 268 of yacc.c  */
-#line 19 "libxlu_cfg_y.y"
+/* Copy the first part of user declarations.  */
+#line 19 "libxlu_cfg_y.y" /* yacc.c:339  */
 
 #define ctx_scanner ctx->scanner
 #include "libxlu_cfg_i.h"
 #include "libxlu_cfg_l.h"
 
+#line 78 "libxlu_cfg_y.c" /* yacc.c:339  */
 
-/* Line 268 of yacc.c  */
-#line 86 "libxlu_cfg_y.c"
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_NULLPTR
+#  if defined __cplusplus && 201103L <= __cplusplus
+#   define YY_NULLPTR nullptr
+#  else
+#   define YY_NULLPTR 0
+#  endif
+# endif
 
 /* Enabling verbose error messages.  */
 #ifdef YYERROR_VERBOSE
@@ -97,66 +92,69 @@
 # define YYERROR_VERBOSE 1
 #endif
 
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+/* In a future release of Bison, this section will be replaced
+   by #include "libxlu_cfg_y.h".  */
+#ifndef YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED
+# define YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED
+/* Debug traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int xlu__cfg_yydebug;
 #endif
 
-
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     IDENT = 258,
-     STRING = 259,
-     NUMBER = 260,
-     NEWLINE = 261
-   };
+  enum yytokentype
+  {
+    IDENT = 258,
+    STRING = 259,
+    NUMBER = 260,
+    NEWLINE = 261
+  };
 #endif
 
-
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
 {
-
-/* Line 293 of yacc.c  */
-#line 25 "libxlu_cfg_y.y"
+#line 25 "libxlu_cfg_y.y" /* yacc.c:355  */
 
   char *string;
   XLU_ConfigValue *value;
 
-
-
-/* Line 293 of yacc.c  */
-#line 135 "libxlu_cfg_y.c"
-} YYSTYPE;
+#line 130 "libxlu_cfg_y.c" /* yacc.c:355  */
+};
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+/* Location type.  */
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
 {
   int first_line;
   int first_column;
   int last_line;
   int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
 # define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
-/* Copy the second part of user declarations.  */
 
+int xlu__cfg_yyparse (CfgParseContext *ctx);
+
+#endif /* !YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED  */
+
+/* Copy the second part of user declarations.  */
 
-/* Line 343 of yacc.c  */
-#line 160 "libxlu_cfg_y.c"
+#line 158 "libxlu_cfg_y.c" /* yacc.c:358  */
 
 #ifdef short
 # undef short
@@ -170,11 +168,8 @@ typedef unsigned char yytype_uint8;
 
 #ifdef YYTYPE_INT8
 typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
 #else
-typedef short int yytype_int8;
+typedef signed char yytype_int8;
 #endif
 
 #ifdef YYTYPE_UINT16
@@ -194,8 +189,7 @@ typedef short int yytype_int16;
 #  define YYSIZE_T __SIZE_TYPE__
 # elif defined size_t
 #  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+# elif ! defined YYSIZE_T
 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 #  define YYSIZE_T size_t
 # else
@@ -209,39 +203,68 @@ typedef short int yytype_int16;
 # if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
 #  endif
 # endif
 # ifndef YY_
-#  define YY_(msgid) msgid
+#  define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+#  define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
 # endif
 #endif
 
 /* Suppress unused-variable warnings by "using" E.  */
 #if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
 #else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
 #endif
 
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(n) (n)
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+    _Pragma ("GCC diagnostic pop")
 #else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
-    int yyi;
+# define YY_INITIAL_VALUE(Value) Value
 #endif
-{
-  return yyi;
-}
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
 #endif
 
+
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -259,9 +282,9 @@ YYID (yyi)
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
 #     ifndef EXIT_SUCCESS
 #      define EXIT_SUCCESS 0
 #     endif
@@ -271,8 +294,8 @@ YYID (yyi)
 # endif
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+   /* Pacify GCC's 'empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
     /* The OS might guarantee only one guard page at the bottom of the stack,
        and a page size can be as small as 4096 bytes.  So we cannot safely
@@ -288,7 +311,7 @@ YYID (yyi)
 #  endif
 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
-	     && (defined YYFREE || defined free)))
+             && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 #   ifndef EXIT_SUCCESS
 #    define EXIT_SUCCESS 0
@@ -296,15 +319,13 @@ YYID (yyi)
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined malloc && ! defined EXIT_SUCCESS
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined free && ! defined EXIT_SUCCESS
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
@@ -314,8 +335,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
 
 #if (! defined yyoverflow \
      && (! defined __cplusplus \
-	 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
-	     && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
@@ -341,35 +362,35 @@ union yyalloc
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
-    do									\
-      {									\
-	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
-	Stack = &yyptr->Stack_alloc;					\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (YYID (0))
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
+    do                                                                  \
+      {                                                                 \
+        YYSIZE_T yynewbytes;                                            \
+        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
+        Stack = &yyptr->Stack_alloc;                                    \
+        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+        yyptr += yynewbytes / sizeof (*yyptr);                          \
+      }                                                                 \
+    while (0)
 
 #endif
 
 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from FROM to TO.  The source and destination do
+/* Copy COUNT objects from SRC to DST.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
 #  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#   define YYCOPY(Dst, Src, Count) \
+      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
 #  else
-#   define YYCOPY(To, From, Count)		\
-      do					\
-	{					\
-	  YYSIZE_T yyi;				\
-	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (YYID (0))
+#   define YYCOPY(Dst, Src, Count)              \
+      do                                        \
+        {                                       \
+          YYSIZE_T yyi;                         \
+          for (yyi = 0; yyi < (Count); yyi++)   \
+            (Dst)[yyi] = (Src)[yyi];            \
+        }                                       \
+      while (0)
 #  endif
 # endif
 #endif /* !YYCOPY_NEEDED */
@@ -385,17 +406,19 @@ union yyalloc
 #define YYNNTS  11
 /* YYNRULES -- Number of rules.  */
 #define YYNRULES  22
-/* YYNRULES -- Number of states.  */
+/* YYNSTATES -- Number of states.  */
 #define YYNSTATES  30
 
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   261
 
-#define YYTRANSLATE(YYX)						\
+#define YYTRANSLATE(YYX)                                                \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, without out-of-bounds checking.  */
 static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -428,27 +451,7 @@ static const yytype_uint8 yytranslate[] =
 };
 
 #if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint8 yyprhs[] =
-{
-       0,     0,     3,     5,     8,     9,    12,    15,    17,    20,
-      24,    26,    28,    30,    35,    37,    39,    40,    42,    46,
-      49,    55,    56
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int8 yyrhs[] =
-{
-      13,     0,    -1,    14,    -1,    14,    16,    -1,    -1,    14,
-      15,    -1,    16,    17,    -1,    17,    -1,     1,     6,    -1,
-       3,     7,    18,    -1,     6,    -1,     8,    -1,    19,    -1,
-       9,    22,    20,    10,    -1,     4,    -1,     5,    -1,    -1,
-      21,    -1,    21,    11,    22,    -1,    18,    22,    -1,    21,
-      11,    22,    18,    22,    -1,    -1,    22,     6,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
        0,    47,    47,    48,    50,    51,    53,    54,    55,    57,
@@ -457,20 +460,20 @@ static const yytype_uint8 yyrline[] =
 };
 #endif
 
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 1
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "IDENT", "STRING", "NUMBER", "NEWLINE",
   "'='", "';'", "'['", "']'", "','", "$accept", "file", "stmts", "stmt",
-  "assignment", "endstmt", "value", "atom", "valuelist", "values", "nlok", 0
+  "assignment", "endstmt", "value", "atom", "valuelist", "values", "nlok", YY_NULLPTR
 };
 #endif
 
 # ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+   (internal) symbol number NUM (which must be that of a token).  */
 static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,    61,    59,    91,
@@ -478,42 +481,18 @@ static const yytype_uint16 yytoknum[] =
 };
 # endif
 
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    12,    13,    13,    14,    14,    15,    15,    15,    16,
-      17,    17,    18,    18,    19,    19,    20,    20,    20,    21,
-      21,    22,    22
-};
+#define YYPACT_NINF -18
 
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     1,     2,     0,     2,     2,     1,     2,     3,
-       1,     1,     1,     4,     1,     1,     0,     1,     3,     2,
-       5,     0,     2
-};
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-18)))
 
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       4,     0,     0,     1,     0,     0,    10,    11,     5,     3,
-       7,     8,     0,     6,    14,    15,    21,     9,    12,    16,
-      22,    21,     0,    17,    19,    13,    21,    18,    21,    20
-};
+#define YYTABLE_NINF -3
 
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int8 yydefgoto[] =
-{
-      -1,     1,     2,     8,     9,    10,    17,    18,    22,    23,
-      19
-};
+#define yytable_value_is_error(Yytable_value) \
+  0
 
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -18
+  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+     STATE-NUM.  */
 static const yytype_int8 yypact[] =
 {
      -18,     4,     0,   -18,    -1,     6,   -18,   -18,   -18,     3,
@@ -521,17 +500,33 @@ static const yytype_int8 yypact[] =
      -18,   -18,    12,    10,    18,   -18,   -18,    11,   -18,    18
 };
 
-/* YYPGOTO[NTERM-NUM].  */
+  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+     Performed when YYTABLE does not specify something else to do.  Zero
+     means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       4,     0,     0,     1,     0,     0,    10,    11,     5,     3,
+       7,     8,     0,     6,    14,    15,    21,     9,    12,    16,
+      22,    21,     0,    17,    19,    13,    21,    18,    21,    20
+};
+
+  /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
      -18,   -18,   -18,   -18,   -18,    16,   -17,   -18,   -18,   -18,
      -14
 };
 
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -3
+  /* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
+{
+      -1,     1,     2,     8,     9,    10,    17,    18,    22,    23,
+      19
+};
+
+  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+     positive, shift that token.  If negative, reduce the rule whose
+     number is the opposite.  If YYTABLE_NINF, syntax error.  */
 static const yytype_int8 yytable[] =
 {
       -2,     4,    21,     5,     3,    11,     6,    24,     7,     6,
@@ -539,12 +534,6 @@ static const yytype_int8 yytable[] =
       16,    26,    25,    16,    20,    13
 };
 
-#define yypact_value_is_default(yystate) \
-  ((yystate) == (-18))
-
-#define yytable_value_is_error(yytable_value) \
-  YYID (0)
-
 static const yytype_uint8 yycheck[] =
 {
        0,     1,    19,     3,     0,     6,     6,    21,     8,     6,
@@ -552,8 +541,8 @@ static const yytype_uint8 yycheck[] =
        9,    11,    10,     9,     6,     9
 };
 
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
+  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+     symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
        0,    13,    14,     0,     1,     3,     6,     8,    15,    16,
@@ -561,79 +550,98 @@ static const yytype_uint8 yystos[] =
        6,    18,    20,    21,    22,    10,    11,    22,    18,    22
 };
 
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		(-2)
-#define YYEOF		0
-
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT		goto yyabortlab
-#define YYERROR		goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  However,
-   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
-   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
-   discussed.  */
-
-#define YYFAIL		goto yyerrlab
-#if defined YYFAIL
-  /* This is here to suppress warnings from the GCC cpp's
-     -Wunused-macros.  Normally we don't worry about that warning, but
-     some users do, and we want to make it easy for users to remove
-     YYFAIL uses, which will produce warnings from Bison 2.5.  */
-#endif
+  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    12,    13,    13,    14,    14,    15,    15,    15,    16,
+      17,    17,    18,    18,    19,    19,    20,    20,    20,    21,
+      21,    22,    22
+};
+
+  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     1,     2,     0,     2,     2,     1,     2,     3,
+       1,     1,     1,     4,     1,     1,     0,     1,     3,     2,
+       5,     0,     2
+};
+
+
+#define yyerrok         (yyerrstatus = 0)
+#define yyclearin       (yychar = YYEMPTY)
+#define YYEMPTY         (-2)
+#define YYEOF           0
+
+#define YYACCEPT        goto yyacceptlab
+#define YYABORT         goto yyabortlab
+#define YYERROR         goto yyerrorlab
+
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
-#define YYBACKUP(Token, Value)					\
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    {								\
-      yychar = (Token);						\
-      yylval = (Value);						\
-      YYPOPSTACK (1);						\
-      goto yybackup;						\
-    }								\
-  else								\
-    {								\
+#define YYBACKUP(Token, Value)                                  \
+do                                                              \
+  if (yychar == YYEMPTY)                                        \
+    {                                                           \
+      yychar = (Token);                                         \
+      yylval = (Value);                                         \
+      YYPOPSTACK (yylen);                                       \
+      yystate = *yyssp;                                         \
+      goto yybackup;                                            \
+    }                                                           \
+  else                                                          \
+    {                                                           \
       yyerror (&yylloc, ctx, YY_("syntax error: cannot back up")); \
-      YYERROR;							\
-    }								\
-while (YYID (0))
-
+      YYERROR;                                                  \
+    }                                                           \
+while (0)
 
-#define YYTERROR	1
-#define YYERRCODE	256
+/* Error token number */
+#define YYTERROR        1
+#define YYERRCODE       256
 
 
 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
    If N is 0, then set CURRENT to the empty location which ends
    the previous symbol: RHS[0] (always defined).  */
 
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
 #ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)				\
-    do									\
-      if (YYID (N))                                                    \
-	{								\
-	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
-	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
-	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
-	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
-	}								\
-      else								\
-	{								\
-	  (Current).first_line   = (Current).last_line   =		\
-	    YYRHSLOC (Rhs, 0).last_line;				\
-	  (Current).first_column = (Current).last_column =		\
-	    YYRHSLOC (Rhs, 0).last_column;				\
-	}								\
-    while (YYID (0))
+# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
+    do                                                                  \
+      if (N)                                                            \
+        {                                                               \
+          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
+          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
+          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
+          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
+        }                                                               \
+      else                                                              \
+        {                                                               \
+          (Current).first_line   = (Current).last_line   =              \
+            YYRHSLOC (Rhs, 0).last_line;                                \
+          (Current).first_column = (Current).last_column =              \
+            YYRHSLOC (Rhs, 0).last_column;                              \
+        }                                                               \
+    while (0)
 #endif
 
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)                        \
+do {                                            \
+  if (yydebug)                                  \
+    YYFPRINTF Args;                             \
+} while (0)
+
 
 /* YY_LOCATION_PRINT -- Print the location on the stream.
    This macro was not mandated originally: define only if we know
@@ -641,84 +649,74 @@ while (YYID (0))
 
 #ifndef YY_LOCATION_PRINT
 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-#  define YY_LOCATION_PRINT(File, Loc)			\
-     fprintf (File, "%d.%d-%d.%d",			\
-	      (Loc).first_line, (Loc).first_column,	\
-	      (Loc).last_line,  (Loc).last_column)
-# else
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
 
+/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
 
-/* YYLEX -- calling `yylex' with the right arguments.  */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, &yylloc, ctx_scanner)
-#endif
+YY_ATTRIBUTE_UNUSED
+static unsigned
+yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
+{
+  unsigned res = 0;
+  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
+  if (0 <= yylocp->first_line)
+    {
+      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
+      if (0 <= yylocp->first_column)
+        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
+    }
+  if (0 <= yylocp->last_line)
+    {
+      if (yylocp->first_line < yylocp->last_line)
+        {
+          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
+          if (0 <= end_col)
+            res += YYFPRINTF (yyo, ".%d", end_col);
+        }
+      else if (0 <= end_col && yylocp->first_column < end_col)
+        res += YYFPRINTF (yyo, "-%d", end_col);
+    }
+  return res;
+ }
 
-/* Enable debugging if requested.  */
-#if YYDEBUG
+#  define YY_LOCATION_PRINT(File, Loc)          \
+  yy_location_print_ (File, &(Loc))
 
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 # endif
+#endif
 
-# define YYDPRINTF(Args)			\
-do {						\
-  if (yydebug)					\
-    YYFPRINTF Args;				\
-} while (YYID (0))
 
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
-do {									  \
-  if (yydebug)								  \
-    {									  \
-      YYFPRINTF (stderr, "%s ", Title);					  \
-      yy_symbol_print (stderr,						  \
-		  Type, Value, Location, ctx); \
-      YYFPRINTF (stderr, "\n");						  \
-    }									  \
-} while (YYID (0))
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
+do {                                                                      \
+  if (yydebug)                                                            \
+    {                                                                     \
+      YYFPRINTF (stderr, "%s ", Title);                                   \
+      yy_symbol_print (stderr,                                            \
+                  Type, Value, Location, ctx); \
+      YYFPRINTF (stderr, "\n");                                           \
+    }                                                                     \
+} while (0)
 
 
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT.  |
+`----------------------------------------*/
 
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, CfgParseContext *ctx)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, ctx)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    YYLTYPE const * const yylocationp;
-    CfgParseContext *ctx;
-#endif
 {
-  if (!yyvaluep)
-    return;
+  FILE *yyo = yyoutput;
+  YYUSE (yyo);
   YYUSE (yylocationp);
   YYUSE (ctx);
+  if (!yyvaluep)
+    return;
 # ifdef YYPRINT
   if (yytype < YYNTOKENS)
     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
 # endif
-  switch (yytype)
-    {
-      default:
-	break;
-    }
+  YYUSE (yytype);
 }
 
 
@@ -726,24 +724,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, ctx)
 | Print this symbol on YYOUTPUT.  |
 `--------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, CfgParseContext *ctx)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, ctx)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    YYLTYPE const * const yylocationp;
-    CfgParseContext *ctx;
-#endif
 {
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+  YYFPRINTF (yyoutput, "%s %s (",
+             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
 
   YY_LOCATION_PRINT (yyoutput, *yylocationp);
   YYFPRINTF (yyoutput, ": ");
@@ -756,16 +741,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, ctx)
 | TOP (included).                                                   |
 `------------------------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
-    yytype_int16 *yybottom;
-    yytype_int16 *yytop;
-#endif
 {
   YYFPRINTF (stderr, "Stack now");
   for (; yybottom <= yytop; yybottom++)
@@ -776,51 +753,42 @@ yy_stack_print (yybottom, yytop)
   YYFPRINTF (stderr, "\n");
 }
 
-# define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
-  if (yydebug)							\
-    yy_stack_print ((Bottom), (Top));				\
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top)                            \
+do {                                                            \
+  if (yydebug)                                                  \
+    yy_stack_print ((Bottom), (Top));                           \
+} while (0)
 
 
 /*------------------------------------------------.
 | Report that the YYRULE is going to be reduced.  |
 `------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, CfgParseContext *ctx)
-#else
 static void
-yy_reduce_print (yyvsp, yylsp, yyrule, ctx)
-    YYSTYPE *yyvsp;
-    YYLTYPE *yylsp;
-    int yyrule;
-    CfgParseContext *ctx;
-#endif
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, CfgParseContext *ctx)
 {
+  unsigned long int yylno = yyrline[yyrule];
   int yynrhs = yyr2[yyrule];
   int yyi;
-  unsigned long int yylno = yyrline[yyrule];
   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-	     yyrule - 1, yylno);
+             yyrule - 1, yylno);
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-		       &(yyvsp[(yyi + 1) - (yynrhs)])
-		       , &(yylsp[(yyi + 1) - (yynrhs)])		       , ctx);
+      yy_symbol_print (stderr,
+                       yystos[yyssp[yyi + 1 - yynrhs]],
+                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                       , &(yylsp[(yyi + 1) - (yynrhs)])                       , ctx);
       YYFPRINTF (stderr, "\n");
     }
 }
 
-# define YY_REDUCE_PRINT(Rule)		\
-do {					\
-  if (yydebug)				\
-    yy_reduce_print (yyvsp, yylsp, Rule, ctx); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule)          \
+do {                                    \
+  if (yydebug)                          \
+    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, ctx); \
+} while (0)
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
@@ -834,7 +802,7 @@ int yydebug;
 
 
 /* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef	YYINITDEPTH
+#ifndef YYINITDEPTH
 # define YYINITDEPTH 200
 #endif
 
@@ -857,15 +825,8 @@ int yydebug;
 #   define yystrlen strlen
 #  else
 /* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
 yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
 {
   YYSIZE_T yylen;
   for (yylen = 0; yystr[yylen]; yylen++)
@@ -881,16 +842,8 @@ yystrlen (yystr)
 #  else
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static char *
 yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
 {
   char *yyd = yydest;
   const char *yys = yysrc;
@@ -920,27 +873,27 @@ yytnamerr (char *yyres, const char *yystr)
       char const *yyp = yystr;
 
       for (;;)
-	switch (*++yyp)
-	  {
-	  case '\'':
-	  case ',':
-	    goto do_not_strip_quotes;
-
-	  case '\\':
-	    if (*++yyp != '\\')
-	      goto do_not_strip_quotes;
-	    /* Fall through.  */
-	  default:
-	    if (yyres)
-	      yyres[yyn] = *yyp;
-	    yyn++;
-	    break;
-
-	  case '"':
-	    if (yyres)
-	      yyres[yyn] = '\0';
-	    return yyn;
-	  }
+        switch (*++yyp)
+          {
+          case '\'':
+          case ',':
+            goto do_not_strip_quotes;
+
+          case '\\':
+            if (*++yyp != '\\')
+              goto do_not_strip_quotes;
+            /* Fall through.  */
+          default:
+            if (yyres)
+              yyres[yyn] = *yyp;
+            yyn++;
+            break;
+
+          case '"':
+            if (yyres)
+              yyres[yyn] = '\0';
+            return yyn;
+          }
     do_not_strip_quotes: ;
     }
 
@@ -963,12 +916,11 @@ static int
 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                 yytype_int16 *yyssp, int yytoken)
 {
-  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
   YYSIZE_T yysize = yysize0;
-  YYSIZE_T yysize1;
   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
   /* Internationalized format string. */
-  const char *yyformat = 0;
+  const char *yyformat = YY_NULLPTR;
   /* Arguments of yyformat. */
   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
   /* Number of reported tokens (one for the "unexpected", one per
@@ -976,10 +928,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
   int yycount = 0;
 
   /* There are many possibilities here to consider:
-     - Assume YYFAIL is not used.  It's too flawed to consider.  See
-       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-       for details.  YYERROR is fine as it does not invoke this
-       function.
      - If this state is a consistent state with a default action, then
        the only way this function was invoked is if the default action
        is an error action.  In that case, don't check for expected
@@ -1028,11 +976,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                     break;
                   }
                 yyarg[yycount++] = yytname[yyx];
-                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-                if (! (yysize <= yysize1
-                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                  return 2;
-                yysize = yysize1;
+                {
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+                  if (! (yysize <= yysize1
+                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                    return 2;
+                  yysize = yysize1;
+                }
               }
         }
     }
@@ -1052,10 +1002,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 # undef YYCASE_
     }
 
-  yysize1 = yysize + yystrlen (yyformat);
-  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-    return 2;
-  yysize = yysize1;
+  {
+    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+      return 2;
+    yysize = yysize1;
+  }
 
   if (*yymsg_alloc < yysize)
     {
@@ -1092,151 +1044,95 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, CfgParseContext *ctx)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-    YYLTYPE *yylocationp;
-    CfgParseContext *ctx;
-#endif
 {
   YYUSE (yyvaluep);
   YYUSE (yylocationp);
   YYUSE (ctx);
-
   if (!yymsg)
     yymsg = "Deleting";
   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   switch (yytype)
     {
-      case 3: /* "IDENT" */
-
-/* Line 1391 of yacc.c  */
-#line 40 "libxlu_cfg_y.y"
-	{ free((yyvaluep->string)); };
-
-/* Line 1391 of yacc.c  */
-#line 1128 "libxlu_cfg_y.c"
-	break;
-      case 4: /* "STRING" */
-
-/* Line 1391 of yacc.c  */
-#line 40 "libxlu_cfg_y.y"
-	{ free((yyvaluep->string)); };
-
-/* Line 1391 of yacc.c  */
-#line 1137 "libxlu_cfg_y.c"
-	break;
-      case 5: /* "NUMBER" */
-
-/* Line 1391 of yacc.c  */
-#line 40 "libxlu_cfg_y.y"
-	{ free((yyvaluep->string)); };
-
-/* Line 1391 of yacc.c  */
-#line 1146 "libxlu_cfg_y.c"
-	break;
-      case 18: /* "value" */
-
-/* Line 1391 of yacc.c  */
-#line 43 "libxlu_cfg_y.y"
-	{ xlu__cfg_value_free((yyvaluep->value)); };
-
-/* Line 1391 of yacc.c  */
-#line 1155 "libxlu_cfg_y.c"
-	break;
-      case 19: /* "atom" */
-
-/* Line 1391 of yacc.c  */
-#line 40 "libxlu_cfg_y.y"
-	{ free((yyvaluep->string)); };
-
-/* Line 1391 of yacc.c  */
-#line 1164 "libxlu_cfg_y.c"
-	break;
-      case 20: /* "valuelist" */
-
-/* Line 1391 of yacc.c  */
-#line 43 "libxlu_cfg_y.y"
-	{ xlu__cfg_value_free((yyvaluep->value)); };
-
-/* Line 1391 of yacc.c  */
-#line 1173 "libxlu_cfg_y.c"
-	break;
-      case 21: /* "values" */
-
-/* Line 1391 of yacc.c  */
-#line 43 "libxlu_cfg_y.y"
-	{ xlu__cfg_value_free((yyvaluep->value)); };
-
-/* Line 1391 of yacc.c  */
-#line 1182 "libxlu_cfg_y.c"
-	break;
+          case 3: /* IDENT  */
+#line 40 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).string)); }
+#line 1064 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 4: /* STRING  */
+#line 40 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).string)); }
+#line 1070 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 5: /* NUMBER  */
+#line 40 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).string)); }
+#line 1076 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 18: /* value  */
+#line 43 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { xlu__cfg_value_free(((*yyvaluep).value)); }
+#line 1082 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 19: /* atom  */
+#line 40 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).string)); }
+#line 1088 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 20: /* valuelist  */
+#line 43 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { xlu__cfg_value_free(((*yyvaluep).value)); }
+#line 1094 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 21: /* values  */
+#line 43 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { xlu__cfg_value_free(((*yyvaluep).value)); }
+#line 1100 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
 
       default:
-	break;
+        break;
     }
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
-/* Prevent warnings from -Wmissing-prototypes.  */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (CfgParseContext *ctx);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
 
 
 /*----------.
 | yyparse.  |
 `----------*/
 
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 int
 yyparse (CfgParseContext *ctx)
-#else
-int
-yyparse (ctx)
-    CfgParseContext *ctx;
-#endif
-#endif
 {
 /* The lookahead symbol.  */
 int yychar;
 
+
 /* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
+/* Default value used for initialization, for pacifying older GCCs
+   or non-GCC compilers.  */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
 
 /* Location data for the lookahead symbol.  */
-YYLTYPE yylloc;
+static YYLTYPE yyloc_default
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+  = { 1, 1, 1, 1 }
+# endif
+;
+YYLTYPE yylloc = yyloc_default;
 
     /* Number of syntax errors so far.  */
     int yynerrs;
@@ -1246,11 +1142,11 @@ YYLTYPE yylloc;
     int yyerrstatus;
 
     /* The stacks and their tools:
-       `yyss': related to states.
-       `yyvs': related to semantic values.
-       `yyls': related to locations.
+       'yyss': related to states.
+       'yyvs': related to semantic values.
+       'yyls': related to locations.
 
-       Refer to the stacks thru separate pointers, to allow yyoverflow
+       Refer to the stacks through separate pointers, to allow yyoverflow
        to reallocate them elsewhere.  */
 
     /* The state stack.  */
@@ -1276,7 +1172,7 @@ YYLTYPE yylloc;
   int yyn;
   int yyresult;
   /* Lookahead token as an internal (translated) token number.  */
-  int yytoken;
+  int yytoken = 0;
   /* The variables used to return semantic value and location from the
      action routines.  */
   YYSTYPE yyval;
@@ -1295,10 +1191,9 @@ YYLTYPE yylloc;
      Keep to zero when no symbol should be popped.  */
   int yylen = 0;
 
-  yytoken = 0;
-  yyss = yyssa;
-  yyvs = yyvsa;
-  yyls = yylsa;
+  yyssp = yyss = yyssa;
+  yyvsp = yyvs = yyvsa;
+  yylsp = yyls = yylsa;
   yystacksize = YYINITDEPTH;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1307,21 +1202,7 @@ YYLTYPE yylloc;
   yyerrstatus = 0;
   yynerrs = 0;
   yychar = YYEMPTY; /* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-  yyssp = yyss;
-  yyvsp = yyvs;
-  yylsp = yyls;
-
-#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-  /* Initialize the default location before parsing starts.  */
-  yylloc.first_line   = yylloc.last_line   = 1;
-  yylloc.first_column = yylloc.last_column = 1;
-#endif
-
+  yylsp[0] = yylloc;
   goto yysetstate;
 
 /*------------------------------------------------------------.
@@ -1342,26 +1223,26 @@ YYLTYPE yylloc;
 
 #ifdef yyoverflow
       {
-	/* Give user a chance to reallocate the stack.  Use copies of
-	   these so that the &'s don't force the real ones into
-	   memory.  */
-	YYSTYPE *yyvs1 = yyvs;
-	yytype_int16 *yyss1 = yyss;
-	YYLTYPE *yyls1 = yyls;
-
-	/* Each stack pointer address is followed by the size of the
-	   data in use in that stack, in bytes.  This used to be a
-	   conditional around just the two extra args, but that might
-	   be undefined if yyoverflow is a macro.  */
-	yyoverflow (YY_("memory exhausted"),
-		    &yyss1, yysize * sizeof (*yyssp),
-		    &yyvs1, yysize * sizeof (*yyvsp),
-		    &yyls1, yysize * sizeof (*yylsp),
-		    &yystacksize);
-
-	yyls = yyls1;
-	yyss = yyss1;
-	yyvs = yyvs1;
+        /* Give user a chance to reallocate the stack.  Use copies of
+           these so that the &'s don't force the real ones into
+           memory.  */
+        YYSTYPE *yyvs1 = yyvs;
+        yytype_int16 *yyss1 = yyss;
+        YYLTYPE *yyls1 = yyls;
+
+        /* Each stack pointer address is followed by the size of the
+           data in use in that stack, in bytes.  This used to be a
+           conditional around just the two extra args, but that might
+           be undefined if yyoverflow is a macro.  */
+        yyoverflow (YY_("memory exhausted"),
+                    &yyss1, yysize * sizeof (*yyssp),
+                    &yyvs1, yysize * sizeof (*yyvsp),
+                    &yyls1, yysize * sizeof (*yylsp),
+                    &yystacksize);
+
+        yyls = yyls1;
+        yyss = yyss1;
+        yyvs = yyvs1;
       }
 #else /* no yyoverflow */
 # ifndef YYSTACK_RELOCATE
@@ -1369,23 +1250,23 @@ YYLTYPE yylloc;
 # else
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-	goto yyexhaustedlab;
+        goto yyexhaustedlab;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
-	yystacksize = YYMAXDEPTH;
+        yystacksize = YYMAXDEPTH;
 
       {
-	yytype_int16 *yyss1 = yyss;
-	union yyalloc *yyptr =
-	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-	if (! yyptr)
-	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss_alloc, yyss);
-	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-	YYSTACK_RELOCATE (yyls_alloc, yyls);
+        yytype_int16 *yyss1 = yyss;
+        union yyalloc *yyptr =
+          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+        if (! yyptr)
+          goto yyexhaustedlab;
+        YYSTACK_RELOCATE (yyss_alloc, yyss);
+        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+        YYSTACK_RELOCATE (yyls_alloc, yyls);
 #  undef YYSTACK_RELOCATE
-	if (yyss1 != yyssa)
-	  YYSTACK_FREE (yyss1);
+        if (yyss1 != yyssa)
+          YYSTACK_FREE (yyss1);
       }
 # endif
 #endif /* no yyoverflow */
@@ -1395,10 +1276,10 @@ YYLTYPE yylloc;
       yylsp = yyls + yysize - 1;
 
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-		  (unsigned long int) yystacksize));
+                  (unsigned long int) yystacksize));
 
       if (yyss + yystacksize - 1 <= yyssp)
-	YYABORT;
+        YYABORT;
     }
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -1427,7 +1308,7 @@ yybackup:
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
+      yychar = yylex (&yylval, &yylloc, ctx_scanner);
     }
 
   if (yychar <= YYEOF)
@@ -1467,7 +1348,9 @@ yybackup:
   yychar = YYEMPTY;
 
   yystate = yyn;
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
   *++yylsp = yylloc;
   goto yynewstate;
 
@@ -1490,7 +1373,7 @@ yyreduce:
   yylen = yyr2[yyn];
 
   /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
+     '$$ = $1'.
 
      Otherwise, the following line sets YYVAL to garbage.
      This behavior is undocumented and Bison
@@ -1505,79 +1388,67 @@ yyreduce:
   switch (yyn)
     {
         case 9:
-
-/* Line 1806 of yacc.c  */
-#line 57 "libxlu_cfg_y.y"
-    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].value),(yylsp[(3) - (3)]).first_line); }
+#line 57 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { xlu__cfg_set_store(ctx,(yyvsp[-2].string),(yyvsp[0].value),(yylsp[0]).first_line); }
+#line 1394 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 12:
-
-/* Line 1806 of yacc.c  */
-#line 62 "libxlu_cfg_y.y"
-    { (yyval.value)= xlu__cfg_string_mk(ctx,(yyvsp[(1) - (1)].string),&(yylsp[(1) - (1)])); }
+#line 62 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= xlu__cfg_string_mk(ctx,(yyvsp[0].string),&(yylsp[0])); }
+#line 1400 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 13:
-
-/* Line 1806 of yacc.c  */
-#line 63 "libxlu_cfg_y.y"
-    { (yyval.value)= (yyvsp[(3) - (4)].value); }
+#line 63 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= (yyvsp[-1].value); }
+#line 1406 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 14:
-
-/* Line 1806 of yacc.c  */
-#line 65 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); }
+#line 65 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.string)= (yyvsp[0].string); }
+#line 1412 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 15:
-
-/* Line 1806 of yacc.c  */
-#line 66 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); }
+#line 66 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.string)= (yyvsp[0].string); }
+#line 1418 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 16:
-
-/* Line 1806 of yacc.c  */
-#line 68 "libxlu_cfg_y.y"
+#line 68 "libxlu_cfg_y.y" /* yacc.c:1646  */
     { (yyval.value)= xlu__cfg_list_mk(ctx,NULL,&yylloc); }
+#line 1424 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 17:
-
-/* Line 1806 of yacc.c  */
-#line 69 "libxlu_cfg_y.y"
-    { (yyval.value)= (yyvsp[(1) - (1)].value); }
+#line 69 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= (yyvsp[0].value); }
+#line 1430 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 18:
-
-/* Line 1806 of yacc.c  */
-#line 70 "libxlu_cfg_y.y"
-    { (yyval.value)= (yyvsp[(1) - (3)].value); }
+#line 70 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= (yyvsp[-2].value); }
+#line 1436 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 19:
-
-/* Line 1806 of yacc.c  */
-#line 72 "libxlu_cfg_y.y"
-    { (yyval.value)= xlu__cfg_list_mk(ctx,(yyvsp[(1) - (2)].value),&(yylsp[(1) - (2)])); }
+#line 72 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= xlu__cfg_list_mk(ctx,(yyvsp[-1].value),&(yylsp[-1])); }
+#line 1442 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 20:
-
-/* Line 1806 of yacc.c  */
-#line 73 "libxlu_cfg_y.y"
-    { xlu__cfg_list_append(ctx,(yyvsp[(1) - (5)].value),(yyvsp[(4) - (5)].value)); (yyval.value)= (yyvsp[(1) - (5)].value); }
+#line 73 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { xlu__cfg_list_append(ctx,(yyvsp[-4].value),(yyvsp[-1].value)); (yyval.value)= (yyvsp[-4].value); }
+#line 1448 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
 
-
-/* Line 1806 of yacc.c  */
-#line 1581 "libxlu_cfg_y.c"
+#line 1452 "libxlu_cfg_y.c" /* yacc.c:1646  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1600,7 +1471,7 @@ yyreduce:
   *++yyvsp = yyval;
   *++yylsp = yyloc;
 
-  /* Now `shift' the result of the reduction.  Determine what state
+  /* Now 'shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
 
@@ -1615,9 +1486,9 @@ yyreduce:
   goto yynewstate;
 
 
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error.  |
+`--------------------------------------*/
 yyerrlab:
   /* Make sure we have latest lookahead translation.  See comments at
      user semantic actions for why this is necessary.  */
@@ -1668,20 +1539,20 @@ yyerrlab:
   if (yyerrstatus == 3)
     {
       /* If just tried and failed to reuse lookahead token after an
-	 error, discard it.  */
+         error, discard it.  */
 
       if (yychar <= YYEOF)
-	{
-	  /* Return failure if at end of input.  */
-	  if (yychar == YYEOF)
-	    YYABORT;
-	}
+        {
+          /* Return failure if at end of input.  */
+          if (yychar == YYEOF)
+            YYABORT;
+        }
       else
-	{
-	  yydestruct ("Error: discarding",
-		      yytoken, &yylval, &yylloc, ctx);
-	  yychar = YYEMPTY;
-	}
+        {
+          yydestruct ("Error: discarding",
+                      yytoken, &yylval, &yylloc, ctx);
+          yychar = YYEMPTY;
+        }
     }
 
   /* Else will try to reuse lookahead token after shifting the error
@@ -1701,7 +1572,7 @@ yyerrorlab:
      goto yyerrorlab;
 
   yyerror_range[1] = yylsp[1-yylen];
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
   yylen = 0;
@@ -1714,35 +1585,37 @@ yyerrorlab:
 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
 `-------------------------------------------------------------*/
 yyerrlab1:
-  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
   for (;;)
     {
       yyn = yypact[yystate];
       if (!yypact_value_is_default (yyn))
-	{
-	  yyn += YYTERROR;
-	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-	    {
-	      yyn = yytable[yyn];
-	      if (0 < yyn)
-		break;
-	    }
-	}
+        {
+          yyn += YYTERROR;
+          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+            {
+              yyn = yytable[yyn];
+              if (0 < yyn)
+                break;
+            }
+        }
 
       /* Pop the current state because it cannot handle the error token.  */
       if (yyssp == yyss)
-	YYABORT;
+        YYABORT;
 
       yyerror_range[1] = *yylsp;
       yydestruct ("Error: popping",
-		  yystos[yystate], yyvsp, yylsp, ctx);
+                  yystos[yystate], yyvsp, yylsp, ctx);
       YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
     }
 
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 
   yyerror_range[2] = yylloc;
   /* Using YYLLOC is tempting, but would change the location of
@@ -1771,7 +1644,7 @@ yyabortlab:
   yyresult = 1;
   goto yyreturn;
 
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
@@ -1790,14 +1663,14 @@ yyreturn:
       yydestruct ("Cleanup: discarding lookahead",
                   yytoken, &yylval, &yylloc, ctx);
     }
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
   YY_STACK_PRINT (yyss, yyssp);
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
-		  yystos[*yyssp], yyvsp, yylsp, ctx);
+                  yystos[*yyssp], yyvsp, yylsp, ctx);
       YYPOPSTACK (1);
     }
 #ifndef yyoverflow
@@ -1808,9 +1681,5 @@ yyreturn:
   if (yymsg != yymsgbuf)
     YYSTACK_FREE (yymsg);
 #endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
+  return yyresult;
 }
-
-
-
diff --git a/tools/libxl/libxlu_cfg_y.h b/tools/libxl/libxlu_cfg_y.h
index 37e8213..0211f80 100644
--- a/tools/libxl/libxlu_cfg_y.h
+++ b/tools/libxl/libxlu_cfg_y.h
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.5.  */
+/* A Bison parser, made by GNU Bison 3.0.2.  */
 
 /* Bison interface for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -26,60 +26,64 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
+#ifndef YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED
+# define YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED
+/* Debug traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int xlu__cfg_yydebug;
+#endif
 
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     IDENT = 258,
-     STRING = 259,
-     NUMBER = 260,
-     NEWLINE = 261
-   };
+  enum yytokentype
+  {
+    IDENT = 258,
+    STRING = 259,
+    NUMBER = 260,
+    NEWLINE = 261
+  };
 #endif
 
-
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
 {
-
-/* Line 2068 of yacc.c  */
-#line 25 "libxlu_cfg_y.y"
+#line 25 "libxlu_cfg_y.y" /* yacc.c:1909  */
 
   char *string;
   XLU_ConfigValue *value;
 
-
-
-/* Line 2068 of yacc.c  */
-#line 63 "libxlu_cfg_y.h"
-} YYSTYPE;
+#line 66 "libxlu_cfg_y.h" /* yacc.c:1909  */
+};
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
-
-
+/* Location type.  */
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
 {
   int first_line;
   int first_column;
   int last_line;
   int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
 # define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
 
+int xlu__cfg_yyparse (CfgParseContext *ctx);
+
+#endif /* !YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED  */
diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c
index beea7f9..d15d7d6 100644
--- a/tools/libxl/libxlu_disk_l.c
+++ b/tools/libxl/libxlu_disk_l.c
@@ -13,7 +13,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -183,11 +183,17 @@ typedef void* yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
     #define YY_LESS_LINENO(n)
+    #define YY_LINENO_REWIND_TO(ptr)
     
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -205,11 +211,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -227,7 +228,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -306,7 +307,7 @@ static void xlu__disk_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yys
 
 YY_BUFFER_STATE xlu__disk_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 void *xlu__disk_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *xlu__disk_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -336,7 +337,7 @@ void xlu__disk_yyfree (void * ,yyscan_t yyscanner );
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
-#define xlu__disk_yywrap(n) 1
+#define xlu__disk_yywrap(yyscanner) 1
 #define YY_SKIP_YYWRAP
 
 typedef unsigned char YY_CHAR;
@@ -914,7 +915,7 @@ static int vdev_and_devtype(DiskParseContext *dpc, char *str) {
 #define DPC ((DiskParseContext*)yyextra)
 
 
-#line 918 "libxlu_disk_l.c"
+#line 919 "libxlu_disk_l.c"
 
 #define INITIAL 0
 #define LEXERR 1
@@ -944,8 +945,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -1003,7 +1004,7 @@ FILE *xlu__disk_yyget_out (yyscan_t yyscanner );
 
 void xlu__disk_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int xlu__disk_yyget_leng (yyscan_t yyscanner );
+yy_size_t xlu__disk_yyget_leng (yyscan_t yyscanner );
 
 char *xlu__disk_yyget_text (yyscan_t yyscanner );
 
@@ -1154,13 +1155,6 @@ YY_DECL
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 155 "libxlu_disk_l.l"
-
-
- /*----- the scanner rules which do the parsing -----*/
-
-#line 1163 "libxlu_disk_l.c"
-
 	if ( !yyg->yy_init )
 		{
 		yyg->yy_init = 1;
@@ -1193,6 +1187,14 @@ YY_DECL
 		xlu__disk_yy_load_buffer_state(yyscanner );
 		}
 
+	{
+#line 155 "libxlu_disk_l.l"
+
+
+ /*----- the scanner rules which do the parsing -----*/
+
+#line 1197 "libxlu_disk_l.c"
+
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
 		yyg->yy_more_len = 0;
@@ -1219,7 +1221,7 @@ YY_DECL
 yy_match:
 		do
 			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
@@ -1502,7 +1504,7 @@ YY_RULE_SETUP
 #line 259 "libxlu_disk_l.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
 	YY_BREAK
-#line 1506 "libxlu_disk_l.c"
+#line 1508 "libxlu_disk_l.c"
 			case YY_STATE_EOF(INITIAL):
 			case YY_STATE_EOF(LEXERR):
 				yyterminate();
@@ -1634,6 +1636,7 @@ YY_FATAL_ERROR( "flex scanner jammed" );
 			"fatal flex scanner internal error--no action found" );
 	} /* end of action switch */
 		} /* end of scanning one token */
+	} /* end of user's declarations */
 } /* end of xlu__disk_yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1690,7 +1693,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 	else
 		{
-			int num_to_read =
+			yy_size_t num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
@@ -1706,7 +1709,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, (size_t) num_to_read );
+			yyg->yy_n_chars, num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
@@ -1798,6 +1801,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	if ( ! yy_is_jam )
 		*yyg->yy_state_ptr++ = yy_current_state;
 
+	(void)yyg;
 	return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1826,7 +1830,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		else
 			{ /* need more input */
-			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 			++yyg->yy_c_buf_p;
 
 			switch ( yy_get_next_buffer( yyscanner ) )
@@ -1990,10 +1994,6 @@ static void xlu__disk_yy_load_buffer_state  (yyscan_t yyscanner)
 	xlu__disk_yyfree((void *) b ,yyscanner );
 }
 
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a xlu__disk_yyrestart() or at EOF.
@@ -2110,7 +2110,7 @@ void xlu__disk_yypop_buffer_state (yyscan_t yyscanner)
  */
 static void xlu__disk_yyensure_buffer_stack (yyscan_t yyscanner)
 {
-	int num_to_alloc;
+	yy_size_t num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 	if (!yyg->yy_buffer_stack) {
@@ -2208,12 +2208,12 @@ YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char * yystr , yyscan_t yyscan
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE xlu__disk_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE xlu__disk_yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
 	char *buf;
 	yy_size_t n;
-	int i;
+	yy_size_t i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
@@ -2323,7 +2323,7 @@ FILE *xlu__disk_yyget_out  (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int xlu__disk_yyget_leng  (yyscan_t yyscanner)
+yy_size_t xlu__disk_yyget_leng  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyleng;
@@ -2359,7 +2359,7 @@ void xlu__disk_yyset_lineno (int  line_number , yyscan_t yyscanner)
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "xlu__disk_yyset_lineno called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "xlu__disk_yyset_lineno called with no buffer" );
     
     yylineno = line_number;
 }
@@ -2374,7 +2374,7 @@ void xlu__disk_yyset_column (int  column_no , yyscan_t yyscanner)
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "xlu__disk_yyset_column called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "xlu__disk_yyset_column called with no buffer" );
     
     yycolumn = column_no;
 }
@@ -2594,4 +2594,4 @@ void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 259 "libxlu_disk_l.l"
+#line 258 "libxlu_disk_l.l"
diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libxl/libxlu_disk_l.h
index f615582..496f208 100644
--- a/tools/libxl/libxlu_disk_l.h
+++ b/tools/libxl/libxlu_disk_l.h
@@ -17,7 +17,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -174,7 +174,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -218,13 +218,13 @@ void xlu__disk_yypop_buffer_state (yyscan_t yyscanner );
 
 YY_BUFFER_STATE xlu__disk_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 void *xlu__disk_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *xlu__disk_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
 void xlu__disk_yyfree (void * ,yyscan_t yyscanner );
 
-#define xlu__disk_yywrap(n) 1
+#define xlu__disk_yywrap(yyscanner) 1
 #define YY_SKIP_YYWRAP
 
 #define yytext_ptr yytext_r
@@ -272,7 +272,7 @@ FILE *xlu__disk_yyget_out (yyscan_t yyscanner );
 
 void xlu__disk_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int xlu__disk_yyget_leng (yyscan_t yyscanner );
+yy_size_t xlu__disk_yyget_leng (yyscan_t yyscanner );
 
 char *xlu__disk_yyget_text (yyscan_t yyscanner );
 
@@ -348,7 +348,7 @@ extern int xlu__disk_yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
-#line 259 "libxlu_disk_l.l"
+#line 258 "libxlu_disk_l.l"
 
 #line 354 "libxlu_disk_l.h"
 #undef xlu__disk_yyIN_HEADER
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:11:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkB1-0001Sg-PV; Thu, 29 Oct 2015 10:11:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB0-0001SR-9r
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:22 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	85/E6-14422-9C0F1365; Thu, 29 Oct 2015 10:11:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446113465!40647746!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 8603 invoked from network); 29 Oct 2015 10:11:06 -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 Oct 2015 10:11:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkAj-0004Z7-4V
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkAi-000516-Rq
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:05 +0000
Date: Thu, 29 Oct 2015 10:11:04 +0000
Message-Id: <E1ZrkAi-000516-Rq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Update libxl flex outputs to
	Flex from Jessie.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f8b201e720020b7fb7e557dc3146913b3c18b90f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jul 15 11:21:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:05:39 2015 +0100

    tools: Update libxl flex outputs to Flex from Jessie.
    
    This is the result of
      $ find -name \*.l -exec touch {} \;
      $ find -name \*.y -exec touch {} \;
    
    and then rebuilding.
    
    This avoids churn on the machine I use for committing which has been
    updated, causing flex to go from 2.5.35-10.1 to 2.5.39-8.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxlu_cfg_l.c  |   80 ++--
 tools/libxl/libxlu_cfg_l.h  |   12 +-
 tools/libxl/libxlu_cfg_y.c  | 1177 +++++++++++++++++++------------------------
 tools/libxl/libxlu_cfg_y.h  |   70 ++--
 tools/libxl/libxlu_disk_l.c |   72 ++--
 tools/libxl/libxlu_disk_l.h |   12 +-
 6 files changed, 651 insertions(+), 772 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_l.c b/tools/libxl/libxlu_cfg_l.c
index 450863a..2d2be39 100644
--- a/tools/libxl/libxlu_cfg_l.c
+++ b/tools/libxl/libxlu_cfg_l.c
@@ -9,7 +9,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -179,6 +179,11 @@ typedef void* yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
@@ -197,6 +202,13 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
             }while(0)
+    #define YY_LINENO_REWIND_TO(dst) \
+            do {\
+                const char *p;\
+                for ( p = yy_cp-1; p >= (dst); --p)\
+                    if ( *p == '\n' )\
+                        --yylineno;\
+            }while(0)
     
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -214,11 +226,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -236,7 +243,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -315,7 +322,7 @@ static void xlu__cfg_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yysc
 
 YY_BUFFER_STATE xlu__cfg_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE xlu__cfg_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 void *xlu__cfg_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *xlu__cfg_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -345,7 +352,7 @@ void xlu__cfg_yyfree (void * ,yyscan_t yyscanner );
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
-#define xlu__cfg_yywrap(n) 1
+#define xlu__cfg_yywrap(yyscanner) 1
 #define YY_SKIP_YYWRAP
 
 typedef unsigned char YY_CHAR;
@@ -514,7 +521,7 @@ int xlu__cfg_yyget_column(yyscan_t yyscanner);
 void xlu__cfg_yyset_column(int  column_no, yyscan_t yyscanner);
 
 
-#line 518 "libxlu_cfg_l.c"
+#line 525 "libxlu_cfg_l.c"
 
 #define INITIAL 0
 #define lexerr 1
@@ -544,8 +551,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -602,7 +609,7 @@ FILE *xlu__cfg_yyget_out (yyscan_t yyscanner );
 
 void xlu__cfg_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int xlu__cfg_yyget_leng (yyscan_t yyscanner );
+yy_size_t xlu__cfg_yyget_leng (yyscan_t yyscanner );
 
 char *xlu__cfg_yyget_text (yyscan_t yyscanner );
 
@@ -763,11 +770,6 @@ YY_DECL
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 53 "libxlu_cfg_l.l"
-
-
-#line 770 "libxlu_cfg_l.c"
-
     yylval = yylval_param;
 
     yylloc = yylloc_param;
@@ -798,6 +800,12 @@ YY_DECL
 		xlu__cfg_yy_load_buffer_state(yyscanner );
 		}
 
+	{
+#line 53 "libxlu_cfg_l.l"
+
+
+#line 808 "libxlu_cfg_l.c"
+
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
 		yyg->yy_more_len = 0;
@@ -820,7 +828,7 @@ YY_DECL
 yy_match:
 		do
 			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
 			if ( yy_accept[yy_current_state] )
 				{
 				yyg->yy_last_accepting_state = yy_current_state;
@@ -846,7 +854,7 @@ yy_find_action:
 
 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
 			{
-			int yyl;
+			yy_size_t yyl;
 			for ( yyl = yyg->yy_more_len; yyl < yyleng; ++yyl )
 				if ( yytext[yyl] == '\n' )
 					   
@@ -975,7 +983,7 @@ YY_RULE_SETUP
 #line 104 "libxlu_cfg_l.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
 	YY_BREAK
-#line 979 "libxlu_cfg_l.c"
+#line 987 "libxlu_cfg_l.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(lexerr):
 	yyterminate();
@@ -1108,6 +1116,7 @@ case YY_STATE_EOF(lexerr):
 			"fatal flex scanner internal error--no action found" );
 	} /* end of action switch */
 		} /* end of scanning one token */
+	} /* end of user's declarations */
 } /* end of xlu__cfg_yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1164,21 +1173,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 	else
 		{
-			int num_to_read =
+			yy_size_t num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
 			{ /* Not enough room in the buffer - grow it. */
 
 			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
 			int yy_c_buf_p_offset =
 				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 			if ( b->yy_is_our_buffer )
 				{
-				int new_size = b->yy_buf_size * 2;
+				yy_size_t new_size = b->yy_buf_size * 2;
 
 				if ( new_size <= 0 )
 					b->yy_buf_size += b->yy_buf_size / 8;
@@ -1209,7 +1218,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, (size_t) num_to_read );
+			yyg->yy_n_chars, num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
@@ -1306,6 +1315,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 	yy_is_jam = (yy_current_state == 34);
 
+	(void)yyg;
 	return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1334,7 +1344,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		else
 			{ /* need more input */
-			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 			++yyg->yy_c_buf_p;
 
 			switch ( yy_get_next_buffer( yyscanner ) )
@@ -1505,10 +1515,6 @@ static void xlu__cfg_yy_load_buffer_state  (yyscan_t yyscanner)
 	xlu__cfg_yyfree((void *) b ,yyscanner );
 }
 
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a xlu__cfg_yyrestart() or at EOF.
@@ -1625,7 +1631,7 @@ void xlu__cfg_yypop_buffer_state (yyscan_t yyscanner)
  */
 static void xlu__cfg_yyensure_buffer_stack (yyscan_t yyscanner)
 {
-	int num_to_alloc;
+	yy_size_t num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 	if (!yyg->yy_buffer_stack) {
@@ -1723,12 +1729,12 @@ YY_BUFFER_STATE xlu__cfg_yy_scan_string (yyconst char * yystr , yyscan_t yyscann
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE xlu__cfg_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE xlu__cfg_yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
 	char *buf;
 	yy_size_t n;
-	int i;
+	yy_size_t i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
@@ -1838,7 +1844,7 @@ FILE *xlu__cfg_yyget_out  (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int xlu__cfg_yyget_leng  (yyscan_t yyscanner)
+yy_size_t xlu__cfg_yyget_leng  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyleng;
@@ -1874,7 +1880,7 @@ void xlu__cfg_yyset_lineno (int  line_number , yyscan_t yyscanner)
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "xlu__cfg_yyset_lineno called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "xlu__cfg_yyset_lineno called with no buffer" );
     
     yylineno = line_number;
 }
@@ -1889,7 +1895,7 @@ void xlu__cfg_yyset_column (int  column_no , yyscan_t yyscanner)
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "xlu__cfg_yyset_column called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "xlu__cfg_yyset_column called with no buffer" );
     
     yycolumn = column_no;
 }
@@ -2125,4 +2131,4 @@ void xlu__cfg_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 104 "libxlu_cfg_l.l"
+#line 103 "libxlu_cfg_l.l"
diff --git a/tools/libxl/libxlu_cfg_l.h b/tools/libxl/libxlu_cfg_l.h
index 151064e..bdf0517 100644
--- a/tools/libxl/libxlu_cfg_l.h
+++ b/tools/libxl/libxlu_cfg_l.h
@@ -13,7 +13,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -170,7 +170,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -214,13 +214,13 @@ void xlu__cfg_yypop_buffer_state (yyscan_t yyscanner );
 
 YY_BUFFER_STATE xlu__cfg_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE xlu__cfg_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE xlu__cfg_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 void *xlu__cfg_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *xlu__cfg_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
 void xlu__cfg_yyfree (void * ,yyscan_t yyscanner );
 
-#define xlu__cfg_yywrap(n) 1
+#define xlu__cfg_yywrap(yyscanner) 1
 #define YY_SKIP_YYWRAP
 
 #define yytext_ptr yytext_r
@@ -268,7 +268,7 @@ FILE *xlu__cfg_yyget_out (yyscan_t yyscanner );
 
 void xlu__cfg_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int xlu__cfg_yyget_leng (yyscan_t yyscanner );
+yy_size_t xlu__cfg_yyget_leng (yyscan_t yyscanner );
 
 char *xlu__cfg_yyget_text (yyscan_t yyscanner );
 
@@ -354,7 +354,7 @@ extern int xlu__cfg_yylex \
 #undef YY_DECL
 #endif
 
-#line 104 "libxlu_cfg_l.l"
+#line 103 "libxlu_cfg_l.l"
 
 #line 360 "libxlu_cfg_l.h"
 #undef xlu__cfg_yyIN_HEADER
diff --git a/tools/libxl/libxlu_cfg_y.c b/tools/libxl/libxlu_cfg_y.c
index fbfdd0f..734e60a 100644
--- a/tools/libxl/libxlu_cfg_y.c
+++ b/tools/libxl/libxlu_cfg_y.c
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.5.  */
+/* A Bison parser, made by GNU Bison 3.0.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -26,7 +26,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -44,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.5"
+#define YYBISON_VERSION "3.0.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -58,36 +58,31 @@
 /* Pull parsers.  */
 #define YYPULL 1
 
-/* Using locations.  */
-#define YYLSP_NEEDED 1
 
 /* Substitute the variable and function names.  */
 #define yyparse         xlu__cfg_yyparse
 #define yylex           xlu__cfg_yylex
 #define yyerror         xlu__cfg_yyerror
-#define yylval          xlu__cfg_yylval
-#define yychar          xlu__cfg_yychar
 #define yydebug         xlu__cfg_yydebug
 #define yynerrs         xlu__cfg_yynerrs
-#define yylloc          xlu__cfg_yylloc
 
-/* Copy the first part of user declarations.  */
 
-/* Line 268 of yacc.c  */
-#line 19 "libxlu_cfg_y.y"
+/* Copy the first part of user declarations.  */
+#line 19 "libxlu_cfg_y.y" /* yacc.c:339  */
 
 #define ctx_scanner ctx->scanner
 #include "libxlu_cfg_i.h"
 #include "libxlu_cfg_l.h"
 
+#line 78 "libxlu_cfg_y.c" /* yacc.c:339  */
 
-/* Line 268 of yacc.c  */
-#line 86 "libxlu_cfg_y.c"
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_NULLPTR
+#  if defined __cplusplus && 201103L <= __cplusplus
+#   define YY_NULLPTR nullptr
+#  else
+#   define YY_NULLPTR 0
+#  endif
+# endif
 
 /* Enabling verbose error messages.  */
 #ifdef YYERROR_VERBOSE
@@ -97,66 +92,69 @@
 # define YYERROR_VERBOSE 1
 #endif
 
-/* Enabling the token table.  */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+/* In a future release of Bison, this section will be replaced
+   by #include "libxlu_cfg_y.h".  */
+#ifndef YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED
+# define YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED
+/* Debug traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int xlu__cfg_yydebug;
 #endif
 
-
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     IDENT = 258,
-     STRING = 259,
-     NUMBER = 260,
-     NEWLINE = 261
-   };
+  enum yytokentype
+  {
+    IDENT = 258,
+    STRING = 259,
+    NUMBER = 260,
+    NEWLINE = 261
+  };
 #endif
 
-
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
 {
-
-/* Line 293 of yacc.c  */
-#line 25 "libxlu_cfg_y.y"
+#line 25 "libxlu_cfg_y.y" /* yacc.c:355  */
 
   char *string;
   XLU_ConfigValue *value;
 
-
-
-/* Line 293 of yacc.c  */
-#line 135 "libxlu_cfg_y.c"
-} YYSTYPE;
+#line 130 "libxlu_cfg_y.c" /* yacc.c:355  */
+};
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+/* Location type.  */
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
 {
   int first_line;
   int first_column;
   int last_line;
   int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
 # define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
-/* Copy the second part of user declarations.  */
 
+int xlu__cfg_yyparse (CfgParseContext *ctx);
+
+#endif /* !YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED  */
+
+/* Copy the second part of user declarations.  */
 
-/* Line 343 of yacc.c  */
-#line 160 "libxlu_cfg_y.c"
+#line 158 "libxlu_cfg_y.c" /* yacc.c:358  */
 
 #ifdef short
 # undef short
@@ -170,11 +168,8 @@ typedef unsigned char yytype_uint8;
 
 #ifdef YYTYPE_INT8
 typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
 #else
-typedef short int yytype_int8;
+typedef signed char yytype_int8;
 #endif
 
 #ifdef YYTYPE_UINT16
@@ -194,8 +189,7 @@ typedef short int yytype_int16;
 #  define YYSIZE_T __SIZE_TYPE__
 # elif defined size_t
 #  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+# elif ! defined YYSIZE_T
 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 #  define YYSIZE_T size_t
 # else
@@ -209,39 +203,68 @@ typedef short int yytype_int16;
 # if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
 #  endif
 # endif
 # ifndef YY_
-#  define YY_(msgid) msgid
+#  define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+#  define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
 # endif
 #endif
 
 /* Suppress unused-variable warnings by "using" E.  */
 #if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
 #else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
 #endif
 
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(n) (n)
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+    _Pragma ("GCC diagnostic pop")
 #else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
-    int yyi;
+# define YY_INITIAL_VALUE(Value) Value
 #endif
-{
-  return yyi;
-}
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
 #endif
 
+
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -259,9 +282,9 @@ YYID (yyi)
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
 #     ifndef EXIT_SUCCESS
 #      define EXIT_SUCCESS 0
 #     endif
@@ -271,8 +294,8 @@ YYID (yyi)
 # endif
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+   /* Pacify GCC's 'empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
     /* The OS might guarantee only one guard page at the bottom of the stack,
        and a page size can be as small as 4096 bytes.  So we cannot safely
@@ -288,7 +311,7 @@ YYID (yyi)
 #  endif
 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
-	     && (defined YYFREE || defined free)))
+             && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 #   ifndef EXIT_SUCCESS
 #    define EXIT_SUCCESS 0
@@ -296,15 +319,13 @@ YYID (yyi)
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined malloc && ! defined EXIT_SUCCESS
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined free && ! defined EXIT_SUCCESS
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
@@ -314,8 +335,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
 
 #if (! defined yyoverflow \
      && (! defined __cplusplus \
-	 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
-	     && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
@@ -341,35 +362,35 @@ union yyalloc
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
-    do									\
-      {									\
-	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
-	Stack = &yyptr->Stack_alloc;					\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (YYID (0))
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
+    do                                                                  \
+      {                                                                 \
+        YYSIZE_T yynewbytes;                                            \
+        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
+        Stack = &yyptr->Stack_alloc;                                    \
+        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+        yyptr += yynewbytes / sizeof (*yyptr);                          \
+      }                                                                 \
+    while (0)
 
 #endif
 
 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from FROM to TO.  The source and destination do
+/* Copy COUNT objects from SRC to DST.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
 #  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#   define YYCOPY(Dst, Src, Count) \
+      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
 #  else
-#   define YYCOPY(To, From, Count)		\
-      do					\
-	{					\
-	  YYSIZE_T yyi;				\
-	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (YYID (0))
+#   define YYCOPY(Dst, Src, Count)              \
+      do                                        \
+        {                                       \
+          YYSIZE_T yyi;                         \
+          for (yyi = 0; yyi < (Count); yyi++)   \
+            (Dst)[yyi] = (Src)[yyi];            \
+        }                                       \
+      while (0)
 #  endif
 # endif
 #endif /* !YYCOPY_NEEDED */
@@ -385,17 +406,19 @@ union yyalloc
 #define YYNNTS  11
 /* YYNRULES -- Number of rules.  */
 #define YYNRULES  22
-/* YYNRULES -- Number of states.  */
+/* YYNSTATES -- Number of states.  */
 #define YYNSTATES  30
 
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   261
 
-#define YYTRANSLATE(YYX)						\
+#define YYTRANSLATE(YYX)                                                \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, without out-of-bounds checking.  */
 static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -428,27 +451,7 @@ static const yytype_uint8 yytranslate[] =
 };
 
 #if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint8 yyprhs[] =
-{
-       0,     0,     3,     5,     8,     9,    12,    15,    17,    20,
-      24,    26,    28,    30,    35,    37,    39,    40,    42,    46,
-      49,    55,    56
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int8 yyrhs[] =
-{
-      13,     0,    -1,    14,    -1,    14,    16,    -1,    -1,    14,
-      15,    -1,    16,    17,    -1,    17,    -1,     1,     6,    -1,
-       3,     7,    18,    -1,     6,    -1,     8,    -1,    19,    -1,
-       9,    22,    20,    10,    -1,     4,    -1,     5,    -1,    -1,
-      21,    -1,    21,    11,    22,    -1,    18,    22,    -1,    21,
-      11,    22,    18,    22,    -1,    -1,    22,     6,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
        0,    47,    47,    48,    50,    51,    53,    54,    55,    57,
@@ -457,20 +460,20 @@ static const yytype_uint8 yyrline[] =
 };
 #endif
 
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 1
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "IDENT", "STRING", "NUMBER", "NEWLINE",
   "'='", "';'", "'['", "']'", "','", "$accept", "file", "stmts", "stmt",
-  "assignment", "endstmt", "value", "atom", "valuelist", "values", "nlok", 0
+  "assignment", "endstmt", "value", "atom", "valuelist", "values", "nlok", YY_NULLPTR
 };
 #endif
 
 # ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+   (internal) symbol number NUM (which must be that of a token).  */
 static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,    61,    59,    91,
@@ -478,42 +481,18 @@ static const yytype_uint16 yytoknum[] =
 };
 # endif
 
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    12,    13,    13,    14,    14,    15,    15,    15,    16,
-      17,    17,    18,    18,    19,    19,    20,    20,    20,    21,
-      21,    22,    22
-};
+#define YYPACT_NINF -18
 
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     1,     2,     0,     2,     2,     1,     2,     3,
-       1,     1,     1,     4,     1,     1,     0,     1,     3,     2,
-       5,     0,     2
-};
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-18)))
 
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       4,     0,     0,     1,     0,     0,    10,    11,     5,     3,
-       7,     8,     0,     6,    14,    15,    21,     9,    12,    16,
-      22,    21,     0,    17,    19,    13,    21,    18,    21,    20
-};
+#define YYTABLE_NINF -3
 
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int8 yydefgoto[] =
-{
-      -1,     1,     2,     8,     9,    10,    17,    18,    22,    23,
-      19
-};
+#define yytable_value_is_error(Yytable_value) \
+  0
 
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -18
+  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+     STATE-NUM.  */
 static const yytype_int8 yypact[] =
 {
      -18,     4,     0,   -18,    -1,     6,   -18,   -18,   -18,     3,
@@ -521,17 +500,33 @@ static const yytype_int8 yypact[] =
      -18,   -18,    12,    10,    18,   -18,   -18,    11,   -18,    18
 };
 
-/* YYPGOTO[NTERM-NUM].  */
+  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+     Performed when YYTABLE does not specify something else to do.  Zero
+     means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       4,     0,     0,     1,     0,     0,    10,    11,     5,     3,
+       7,     8,     0,     6,    14,    15,    21,     9,    12,    16,
+      22,    21,     0,    17,    19,    13,    21,    18,    21,    20
+};
+
+  /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
      -18,   -18,   -18,   -18,   -18,    16,   -17,   -18,   -18,   -18,
      -14
 };
 
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -3
+  /* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
+{
+      -1,     1,     2,     8,     9,    10,    17,    18,    22,    23,
+      19
+};
+
+  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+     positive, shift that token.  If negative, reduce the rule whose
+     number is the opposite.  If YYTABLE_NINF, syntax error.  */
 static const yytype_int8 yytable[] =
 {
       -2,     4,    21,     5,     3,    11,     6,    24,     7,     6,
@@ -539,12 +534,6 @@ static const yytype_int8 yytable[] =
       16,    26,    25,    16,    20,    13
 };
 
-#define yypact_value_is_default(yystate) \
-  ((yystate) == (-18))
-
-#define yytable_value_is_error(yytable_value) \
-  YYID (0)
-
 static const yytype_uint8 yycheck[] =
 {
        0,     1,    19,     3,     0,     6,     6,    21,     8,     6,
@@ -552,8 +541,8 @@ static const yytype_uint8 yycheck[] =
        9,    11,    10,     9,     6,     9
 };
 
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
+  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+     symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
        0,    13,    14,     0,     1,     3,     6,     8,    15,    16,
@@ -561,79 +550,98 @@ static const yytype_uint8 yystos[] =
        6,    18,    20,    21,    22,    10,    11,    22,    18,    22
 };
 
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		(-2)
-#define YYEOF		0
-
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT		goto yyabortlab
-#define YYERROR		goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  However,
-   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
-   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
-   discussed.  */
-
-#define YYFAIL		goto yyerrlab
-#if defined YYFAIL
-  /* This is here to suppress warnings from the GCC cpp's
-     -Wunused-macros.  Normally we don't worry about that warning, but
-     some users do, and we want to make it easy for users to remove
-     YYFAIL uses, which will produce warnings from Bison 2.5.  */
-#endif
+  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    12,    13,    13,    14,    14,    15,    15,    15,    16,
+      17,    17,    18,    18,    19,    19,    20,    20,    20,    21,
+      21,    22,    22
+};
+
+  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     1,     2,     0,     2,     2,     1,     2,     3,
+       1,     1,     1,     4,     1,     1,     0,     1,     3,     2,
+       5,     0,     2
+};
+
+
+#define yyerrok         (yyerrstatus = 0)
+#define yyclearin       (yychar = YYEMPTY)
+#define YYEMPTY         (-2)
+#define YYEOF           0
+
+#define YYACCEPT        goto yyacceptlab
+#define YYABORT         goto yyabortlab
+#define YYERROR         goto yyerrorlab
+
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
-#define YYBACKUP(Token, Value)					\
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    {								\
-      yychar = (Token);						\
-      yylval = (Value);						\
-      YYPOPSTACK (1);						\
-      goto yybackup;						\
-    }								\
-  else								\
-    {								\
+#define YYBACKUP(Token, Value)                                  \
+do                                                              \
+  if (yychar == YYEMPTY)                                        \
+    {                                                           \
+      yychar = (Token);                                         \
+      yylval = (Value);                                         \
+      YYPOPSTACK (yylen);                                       \
+      yystate = *yyssp;                                         \
+      goto yybackup;                                            \
+    }                                                           \
+  else                                                          \
+    {                                                           \
       yyerror (&yylloc, ctx, YY_("syntax error: cannot back up")); \
-      YYERROR;							\
-    }								\
-while (YYID (0))
-
+      YYERROR;                                                  \
+    }                                                           \
+while (0)
 
-#define YYTERROR	1
-#define YYERRCODE	256
+/* Error token number */
+#define YYTERROR        1
+#define YYERRCODE       256
 
 
 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
    If N is 0, then set CURRENT to the empty location which ends
    the previous symbol: RHS[0] (always defined).  */
 
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
 #ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)				\
-    do									\
-      if (YYID (N))                                                    \
-	{								\
-	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
-	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
-	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
-	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
-	}								\
-      else								\
-	{								\
-	  (Current).first_line   = (Current).last_line   =		\
-	    YYRHSLOC (Rhs, 0).last_line;				\
-	  (Current).first_column = (Current).last_column =		\
-	    YYRHSLOC (Rhs, 0).last_column;				\
-	}								\
-    while (YYID (0))
+# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
+    do                                                                  \
+      if (N)                                                            \
+        {                                                               \
+          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
+          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
+          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
+          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
+        }                                                               \
+      else                                                              \
+        {                                                               \
+          (Current).first_line   = (Current).last_line   =              \
+            YYRHSLOC (Rhs, 0).last_line;                                \
+          (Current).first_column = (Current).last_column =              \
+            YYRHSLOC (Rhs, 0).last_column;                              \
+        }                                                               \
+    while (0)
 #endif
 
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)                        \
+do {                                            \
+  if (yydebug)                                  \
+    YYFPRINTF Args;                             \
+} while (0)
+
 
 /* YY_LOCATION_PRINT -- Print the location on the stream.
    This macro was not mandated originally: define only if we know
@@ -641,84 +649,74 @@ while (YYID (0))
 
 #ifndef YY_LOCATION_PRINT
 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-#  define YY_LOCATION_PRINT(File, Loc)			\
-     fprintf (File, "%d.%d-%d.%d",			\
-	      (Loc).first_line, (Loc).first_column,	\
-	      (Loc).last_line,  (Loc).last_column)
-# else
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
 
+/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
 
-/* YYLEX -- calling `yylex' with the right arguments.  */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, &yylloc, ctx_scanner)
-#endif
+YY_ATTRIBUTE_UNUSED
+static unsigned
+yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
+{
+  unsigned res = 0;
+  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
+  if (0 <= yylocp->first_line)
+    {
+      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
+      if (0 <= yylocp->first_column)
+        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
+    }
+  if (0 <= yylocp->last_line)
+    {
+      if (yylocp->first_line < yylocp->last_line)
+        {
+          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
+          if (0 <= end_col)
+            res += YYFPRINTF (yyo, ".%d", end_col);
+        }
+      else if (0 <= end_col && yylocp->first_column < end_col)
+        res += YYFPRINTF (yyo, "-%d", end_col);
+    }
+  return res;
+ }
 
-/* Enable debugging if requested.  */
-#if YYDEBUG
+#  define YY_LOCATION_PRINT(File, Loc)          \
+  yy_location_print_ (File, &(Loc))
 
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 # endif
+#endif
 
-# define YYDPRINTF(Args)			\
-do {						\
-  if (yydebug)					\
-    YYFPRINTF Args;				\
-} while (YYID (0))
 
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
-do {									  \
-  if (yydebug)								  \
-    {									  \
-      YYFPRINTF (stderr, "%s ", Title);					  \
-      yy_symbol_print (stderr,						  \
-		  Type, Value, Location, ctx); \
-      YYFPRINTF (stderr, "\n");						  \
-    }									  \
-} while (YYID (0))
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
+do {                                                                      \
+  if (yydebug)                                                            \
+    {                                                                     \
+      YYFPRINTF (stderr, "%s ", Title);                                   \
+      yy_symbol_print (stderr,                                            \
+                  Type, Value, Location, ctx); \
+      YYFPRINTF (stderr, "\n");                                           \
+    }                                                                     \
+} while (0)
 
 
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT.  |
+`----------------------------------------*/
 
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, CfgParseContext *ctx)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, ctx)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    YYLTYPE const * const yylocationp;
-    CfgParseContext *ctx;
-#endif
 {
-  if (!yyvaluep)
-    return;
+  FILE *yyo = yyoutput;
+  YYUSE (yyo);
   YYUSE (yylocationp);
   YYUSE (ctx);
+  if (!yyvaluep)
+    return;
 # ifdef YYPRINT
   if (yytype < YYNTOKENS)
     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
 # endif
-  switch (yytype)
-    {
-      default:
-	break;
-    }
+  YYUSE (yytype);
 }
 
 
@@ -726,24 +724,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, ctx)
 | Print this symbol on YYOUTPUT.  |
 `--------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, CfgParseContext *ctx)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, ctx)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    YYLTYPE const * const yylocationp;
-    CfgParseContext *ctx;
-#endif
 {
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+  YYFPRINTF (yyoutput, "%s %s (",
+             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
 
   YY_LOCATION_PRINT (yyoutput, *yylocationp);
   YYFPRINTF (yyoutput, ": ");
@@ -756,16 +741,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, ctx)
 | TOP (included).                                                   |
 `------------------------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
-    yytype_int16 *yybottom;
-    yytype_int16 *yytop;
-#endif
 {
   YYFPRINTF (stderr, "Stack now");
   for (; yybottom <= yytop; yybottom++)
@@ -776,51 +753,42 @@ yy_stack_print (yybottom, yytop)
   YYFPRINTF (stderr, "\n");
 }
 
-# define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
-  if (yydebug)							\
-    yy_stack_print ((Bottom), (Top));				\
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top)                            \
+do {                                                            \
+  if (yydebug)                                                  \
+    yy_stack_print ((Bottom), (Top));                           \
+} while (0)
 
 
 /*------------------------------------------------.
 | Report that the YYRULE is going to be reduced.  |
 `------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, CfgParseContext *ctx)
-#else
 static void
-yy_reduce_print (yyvsp, yylsp, yyrule, ctx)
-    YYSTYPE *yyvsp;
-    YYLTYPE *yylsp;
-    int yyrule;
-    CfgParseContext *ctx;
-#endif
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, CfgParseContext *ctx)
 {
+  unsigned long int yylno = yyrline[yyrule];
   int yynrhs = yyr2[yyrule];
   int yyi;
-  unsigned long int yylno = yyrline[yyrule];
   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-	     yyrule - 1, yylno);
+             yyrule - 1, yylno);
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-		       &(yyvsp[(yyi + 1) - (yynrhs)])
-		       , &(yylsp[(yyi + 1) - (yynrhs)])		       , ctx);
+      yy_symbol_print (stderr,
+                       yystos[yyssp[yyi + 1 - yynrhs]],
+                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                       , &(yylsp[(yyi + 1) - (yynrhs)])                       , ctx);
       YYFPRINTF (stderr, "\n");
     }
 }
 
-# define YY_REDUCE_PRINT(Rule)		\
-do {					\
-  if (yydebug)				\
-    yy_reduce_print (yyvsp, yylsp, Rule, ctx); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule)          \
+do {                                    \
+  if (yydebug)                          \
+    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, ctx); \
+} while (0)
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
@@ -834,7 +802,7 @@ int yydebug;
 
 
 /* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef	YYINITDEPTH
+#ifndef YYINITDEPTH
 # define YYINITDEPTH 200
 #endif
 
@@ -857,15 +825,8 @@ int yydebug;
 #   define yystrlen strlen
 #  else
 /* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
 yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
 {
   YYSIZE_T yylen;
   for (yylen = 0; yystr[yylen]; yylen++)
@@ -881,16 +842,8 @@ yystrlen (yystr)
 #  else
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static char *
 yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
 {
   char *yyd = yydest;
   const char *yys = yysrc;
@@ -920,27 +873,27 @@ yytnamerr (char *yyres, const char *yystr)
       char const *yyp = yystr;
 
       for (;;)
-	switch (*++yyp)
-	  {
-	  case '\'':
-	  case ',':
-	    goto do_not_strip_quotes;
-
-	  case '\\':
-	    if (*++yyp != '\\')
-	      goto do_not_strip_quotes;
-	    /* Fall through.  */
-	  default:
-	    if (yyres)
-	      yyres[yyn] = *yyp;
-	    yyn++;
-	    break;
-
-	  case '"':
-	    if (yyres)
-	      yyres[yyn] = '\0';
-	    return yyn;
-	  }
+        switch (*++yyp)
+          {
+          case '\'':
+          case ',':
+            goto do_not_strip_quotes;
+
+          case '\\':
+            if (*++yyp != '\\')
+              goto do_not_strip_quotes;
+            /* Fall through.  */
+          default:
+            if (yyres)
+              yyres[yyn] = *yyp;
+            yyn++;
+            break;
+
+          case '"':
+            if (yyres)
+              yyres[yyn] = '\0';
+            return yyn;
+          }
     do_not_strip_quotes: ;
     }
 
@@ -963,12 +916,11 @@ static int
 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                 yytype_int16 *yyssp, int yytoken)
 {
-  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
   YYSIZE_T yysize = yysize0;
-  YYSIZE_T yysize1;
   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
   /* Internationalized format string. */
-  const char *yyformat = 0;
+  const char *yyformat = YY_NULLPTR;
   /* Arguments of yyformat. */
   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
   /* Number of reported tokens (one for the "unexpected", one per
@@ -976,10 +928,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
   int yycount = 0;
 
   /* There are many possibilities here to consider:
-     - Assume YYFAIL is not used.  It's too flawed to consider.  See
-       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-       for details.  YYERROR is fine as it does not invoke this
-       function.
      - If this state is a consistent state with a default action, then
        the only way this function was invoked is if the default action
        is an error action.  In that case, don't check for expected
@@ -1028,11 +976,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                     break;
                   }
                 yyarg[yycount++] = yytname[yyx];
-                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-                if (! (yysize <= yysize1
-                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                  return 2;
-                yysize = yysize1;
+                {
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+                  if (! (yysize <= yysize1
+                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                    return 2;
+                  yysize = yysize1;
+                }
               }
         }
     }
@@ -1052,10 +1002,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 # undef YYCASE_
     }
 
-  yysize1 = yysize + yystrlen (yyformat);
-  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-    return 2;
-  yysize = yysize1;
+  {
+    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+      return 2;
+    yysize = yysize1;
+  }
 
   if (*yymsg_alloc < yysize)
     {
@@ -1092,151 +1044,95 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, CfgParseContext *ctx)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-    YYLTYPE *yylocationp;
-    CfgParseContext *ctx;
-#endif
 {
   YYUSE (yyvaluep);
   YYUSE (yylocationp);
   YYUSE (ctx);
-
   if (!yymsg)
     yymsg = "Deleting";
   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   switch (yytype)
     {
-      case 3: /* "IDENT" */
-
-/* Line 1391 of yacc.c  */
-#line 40 "libxlu_cfg_y.y"
-	{ free((yyvaluep->string)); };
-
-/* Line 1391 of yacc.c  */
-#line 1128 "libxlu_cfg_y.c"
-	break;
-      case 4: /* "STRING" */
-
-/* Line 1391 of yacc.c  */
-#line 40 "libxlu_cfg_y.y"
-	{ free((yyvaluep->string)); };
-
-/* Line 1391 of yacc.c  */
-#line 1137 "libxlu_cfg_y.c"
-	break;
-      case 5: /* "NUMBER" */
-
-/* Line 1391 of yacc.c  */
-#line 40 "libxlu_cfg_y.y"
-	{ free((yyvaluep->string)); };
-
-/* Line 1391 of yacc.c  */
-#line 1146 "libxlu_cfg_y.c"
-	break;
-      case 18: /* "value" */
-
-/* Line 1391 of yacc.c  */
-#line 43 "libxlu_cfg_y.y"
-	{ xlu__cfg_value_free((yyvaluep->value)); };
-
-/* Line 1391 of yacc.c  */
-#line 1155 "libxlu_cfg_y.c"
-	break;
-      case 19: /* "atom" */
-
-/* Line 1391 of yacc.c  */
-#line 40 "libxlu_cfg_y.y"
-	{ free((yyvaluep->string)); };
-
-/* Line 1391 of yacc.c  */
-#line 1164 "libxlu_cfg_y.c"
-	break;
-      case 20: /* "valuelist" */
-
-/* Line 1391 of yacc.c  */
-#line 43 "libxlu_cfg_y.y"
-	{ xlu__cfg_value_free((yyvaluep->value)); };
-
-/* Line 1391 of yacc.c  */
-#line 1173 "libxlu_cfg_y.c"
-	break;
-      case 21: /* "values" */
-
-/* Line 1391 of yacc.c  */
-#line 43 "libxlu_cfg_y.y"
-	{ xlu__cfg_value_free((yyvaluep->value)); };
-
-/* Line 1391 of yacc.c  */
-#line 1182 "libxlu_cfg_y.c"
-	break;
+          case 3: /* IDENT  */
+#line 40 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).string)); }
+#line 1064 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 4: /* STRING  */
+#line 40 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).string)); }
+#line 1070 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 5: /* NUMBER  */
+#line 40 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).string)); }
+#line 1076 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 18: /* value  */
+#line 43 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { xlu__cfg_value_free(((*yyvaluep).value)); }
+#line 1082 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 19: /* atom  */
+#line 40 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).string)); }
+#line 1088 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 20: /* valuelist  */
+#line 43 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { xlu__cfg_value_free(((*yyvaluep).value)); }
+#line 1094 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
+    case 21: /* values  */
+#line 43 "libxlu_cfg_y.y" /* yacc.c:1257  */
+      { xlu__cfg_value_free(((*yyvaluep).value)); }
+#line 1100 "libxlu_cfg_y.c" /* yacc.c:1257  */
+        break;
+
 
       default:
-	break;
+        break;
     }
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
-/* Prevent warnings from -Wmissing-prototypes.  */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (CfgParseContext *ctx);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
 
 
 /*----------.
 | yyparse.  |
 `----------*/
 
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 int
 yyparse (CfgParseContext *ctx)
-#else
-int
-yyparse (ctx)
-    CfgParseContext *ctx;
-#endif
-#endif
 {
 /* The lookahead symbol.  */
 int yychar;
 
+
 /* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
+/* Default value used for initialization, for pacifying older GCCs
+   or non-GCC compilers.  */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
 
 /* Location data for the lookahead symbol.  */
-YYLTYPE yylloc;
+static YYLTYPE yyloc_default
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+  = { 1, 1, 1, 1 }
+# endif
+;
+YYLTYPE yylloc = yyloc_default;
 
     /* Number of syntax errors so far.  */
     int yynerrs;
@@ -1246,11 +1142,11 @@ YYLTYPE yylloc;
     int yyerrstatus;
 
     /* The stacks and their tools:
-       `yyss': related to states.
-       `yyvs': related to semantic values.
-       `yyls': related to locations.
+       'yyss': related to states.
+       'yyvs': related to semantic values.
+       'yyls': related to locations.
 
-       Refer to the stacks thru separate pointers, to allow yyoverflow
+       Refer to the stacks through separate pointers, to allow yyoverflow
        to reallocate them elsewhere.  */
 
     /* The state stack.  */
@@ -1276,7 +1172,7 @@ YYLTYPE yylloc;
   int yyn;
   int yyresult;
   /* Lookahead token as an internal (translated) token number.  */
-  int yytoken;
+  int yytoken = 0;
   /* The variables used to return semantic value and location from the
      action routines.  */
   YYSTYPE yyval;
@@ -1295,10 +1191,9 @@ YYLTYPE yylloc;
      Keep to zero when no symbol should be popped.  */
   int yylen = 0;
 
-  yytoken = 0;
-  yyss = yyssa;
-  yyvs = yyvsa;
-  yyls = yylsa;
+  yyssp = yyss = yyssa;
+  yyvsp = yyvs = yyvsa;
+  yylsp = yyls = yylsa;
   yystacksize = YYINITDEPTH;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1307,21 +1202,7 @@ YYLTYPE yylloc;
   yyerrstatus = 0;
   yynerrs = 0;
   yychar = YYEMPTY; /* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-  yyssp = yyss;
-  yyvsp = yyvs;
-  yylsp = yyls;
-
-#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-  /* Initialize the default location before parsing starts.  */
-  yylloc.first_line   = yylloc.last_line   = 1;
-  yylloc.first_column = yylloc.last_column = 1;
-#endif
-
+  yylsp[0] = yylloc;
   goto yysetstate;
 
 /*------------------------------------------------------------.
@@ -1342,26 +1223,26 @@ YYLTYPE yylloc;
 
 #ifdef yyoverflow
       {
-	/* Give user a chance to reallocate the stack.  Use copies of
-	   these so that the &'s don't force the real ones into
-	   memory.  */
-	YYSTYPE *yyvs1 = yyvs;
-	yytype_int16 *yyss1 = yyss;
-	YYLTYPE *yyls1 = yyls;
-
-	/* Each stack pointer address is followed by the size of the
-	   data in use in that stack, in bytes.  This used to be a
-	   conditional around just the two extra args, but that might
-	   be undefined if yyoverflow is a macro.  */
-	yyoverflow (YY_("memory exhausted"),
-		    &yyss1, yysize * sizeof (*yyssp),
-		    &yyvs1, yysize * sizeof (*yyvsp),
-		    &yyls1, yysize * sizeof (*yylsp),
-		    &yystacksize);
-
-	yyls = yyls1;
-	yyss = yyss1;
-	yyvs = yyvs1;
+        /* Give user a chance to reallocate the stack.  Use copies of
+           these so that the &'s don't force the real ones into
+           memory.  */
+        YYSTYPE *yyvs1 = yyvs;
+        yytype_int16 *yyss1 = yyss;
+        YYLTYPE *yyls1 = yyls;
+
+        /* Each stack pointer address is followed by the size of the
+           data in use in that stack, in bytes.  This used to be a
+           conditional around just the two extra args, but that might
+           be undefined if yyoverflow is a macro.  */
+        yyoverflow (YY_("memory exhausted"),
+                    &yyss1, yysize * sizeof (*yyssp),
+                    &yyvs1, yysize * sizeof (*yyvsp),
+                    &yyls1, yysize * sizeof (*yylsp),
+                    &yystacksize);
+
+        yyls = yyls1;
+        yyss = yyss1;
+        yyvs = yyvs1;
       }
 #else /* no yyoverflow */
 # ifndef YYSTACK_RELOCATE
@@ -1369,23 +1250,23 @@ YYLTYPE yylloc;
 # else
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-	goto yyexhaustedlab;
+        goto yyexhaustedlab;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
-	yystacksize = YYMAXDEPTH;
+        yystacksize = YYMAXDEPTH;
 
       {
-	yytype_int16 *yyss1 = yyss;
-	union yyalloc *yyptr =
-	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-	if (! yyptr)
-	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss_alloc, yyss);
-	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-	YYSTACK_RELOCATE (yyls_alloc, yyls);
+        yytype_int16 *yyss1 = yyss;
+        union yyalloc *yyptr =
+          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+        if (! yyptr)
+          goto yyexhaustedlab;
+        YYSTACK_RELOCATE (yyss_alloc, yyss);
+        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+        YYSTACK_RELOCATE (yyls_alloc, yyls);
 #  undef YYSTACK_RELOCATE
-	if (yyss1 != yyssa)
-	  YYSTACK_FREE (yyss1);
+        if (yyss1 != yyssa)
+          YYSTACK_FREE (yyss1);
       }
 # endif
 #endif /* no yyoverflow */
@@ -1395,10 +1276,10 @@ YYLTYPE yylloc;
       yylsp = yyls + yysize - 1;
 
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-		  (unsigned long int) yystacksize));
+                  (unsigned long int) yystacksize));
 
       if (yyss + yystacksize - 1 <= yyssp)
-	YYABORT;
+        YYABORT;
     }
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -1427,7 +1308,7 @@ yybackup:
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
+      yychar = yylex (&yylval, &yylloc, ctx_scanner);
     }
 
   if (yychar <= YYEOF)
@@ -1467,7 +1348,9 @@ yybackup:
   yychar = YYEMPTY;
 
   yystate = yyn;
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
   *++yylsp = yylloc;
   goto yynewstate;
 
@@ -1490,7 +1373,7 @@ yyreduce:
   yylen = yyr2[yyn];
 
   /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
+     '$$ = $1'.
 
      Otherwise, the following line sets YYVAL to garbage.
      This behavior is undocumented and Bison
@@ -1505,79 +1388,67 @@ yyreduce:
   switch (yyn)
     {
         case 9:
-
-/* Line 1806 of yacc.c  */
-#line 57 "libxlu_cfg_y.y"
-    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].value),(yylsp[(3) - (3)]).first_line); }
+#line 57 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { xlu__cfg_set_store(ctx,(yyvsp[-2].string),(yyvsp[0].value),(yylsp[0]).first_line); }
+#line 1394 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 12:
-
-/* Line 1806 of yacc.c  */
-#line 62 "libxlu_cfg_y.y"
-    { (yyval.value)= xlu__cfg_string_mk(ctx,(yyvsp[(1) - (1)].string),&(yylsp[(1) - (1)])); }
+#line 62 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= xlu__cfg_string_mk(ctx,(yyvsp[0].string),&(yylsp[0])); }
+#line 1400 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 13:
-
-/* Line 1806 of yacc.c  */
-#line 63 "libxlu_cfg_y.y"
-    { (yyval.value)= (yyvsp[(3) - (4)].value); }
+#line 63 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= (yyvsp[-1].value); }
+#line 1406 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 14:
-
-/* Line 1806 of yacc.c  */
-#line 65 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); }
+#line 65 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.string)= (yyvsp[0].string); }
+#line 1412 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 15:
-
-/* Line 1806 of yacc.c  */
-#line 66 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); }
+#line 66 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.string)= (yyvsp[0].string); }
+#line 1418 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 16:
-
-/* Line 1806 of yacc.c  */
-#line 68 "libxlu_cfg_y.y"
+#line 68 "libxlu_cfg_y.y" /* yacc.c:1646  */
     { (yyval.value)= xlu__cfg_list_mk(ctx,NULL,&yylloc); }
+#line 1424 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 17:
-
-/* Line 1806 of yacc.c  */
-#line 69 "libxlu_cfg_y.y"
-    { (yyval.value)= (yyvsp[(1) - (1)].value); }
+#line 69 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= (yyvsp[0].value); }
+#line 1430 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 18:
-
-/* Line 1806 of yacc.c  */
-#line 70 "libxlu_cfg_y.y"
-    { (yyval.value)= (yyvsp[(1) - (3)].value); }
+#line 70 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= (yyvsp[-2].value); }
+#line 1436 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 19:
-
-/* Line 1806 of yacc.c  */
-#line 72 "libxlu_cfg_y.y"
-    { (yyval.value)= xlu__cfg_list_mk(ctx,(yyvsp[(1) - (2)].value),&(yylsp[(1) - (2)])); }
+#line 72 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { (yyval.value)= xlu__cfg_list_mk(ctx,(yyvsp[-1].value),&(yylsp[-1])); }
+#line 1442 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
   case 20:
-
-/* Line 1806 of yacc.c  */
-#line 73 "libxlu_cfg_y.y"
-    { xlu__cfg_list_append(ctx,(yyvsp[(1) - (5)].value),(yyvsp[(4) - (5)].value)); (yyval.value)= (yyvsp[(1) - (5)].value); }
+#line 73 "libxlu_cfg_y.y" /* yacc.c:1646  */
+    { xlu__cfg_list_append(ctx,(yyvsp[-4].value),(yyvsp[-1].value)); (yyval.value)= (yyvsp[-4].value); }
+#line 1448 "libxlu_cfg_y.c" /* yacc.c:1646  */
     break;
 
 
-
-/* Line 1806 of yacc.c  */
-#line 1581 "libxlu_cfg_y.c"
+#line 1452 "libxlu_cfg_y.c" /* yacc.c:1646  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1600,7 +1471,7 @@ yyreduce:
   *++yyvsp = yyval;
   *++yylsp = yyloc;
 
-  /* Now `shift' the result of the reduction.  Determine what state
+  /* Now 'shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
 
@@ -1615,9 +1486,9 @@ yyreduce:
   goto yynewstate;
 
 
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error.  |
+`--------------------------------------*/
 yyerrlab:
   /* Make sure we have latest lookahead translation.  See comments at
      user semantic actions for why this is necessary.  */
@@ -1668,20 +1539,20 @@ yyerrlab:
   if (yyerrstatus == 3)
     {
       /* If just tried and failed to reuse lookahead token after an
-	 error, discard it.  */
+         error, discard it.  */
 
       if (yychar <= YYEOF)
-	{
-	  /* Return failure if at end of input.  */
-	  if (yychar == YYEOF)
-	    YYABORT;
-	}
+        {
+          /* Return failure if at end of input.  */
+          if (yychar == YYEOF)
+            YYABORT;
+        }
       else
-	{
-	  yydestruct ("Error: discarding",
-		      yytoken, &yylval, &yylloc, ctx);
-	  yychar = YYEMPTY;
-	}
+        {
+          yydestruct ("Error: discarding",
+                      yytoken, &yylval, &yylloc, ctx);
+          yychar = YYEMPTY;
+        }
     }
 
   /* Else will try to reuse lookahead token after shifting the error
@@ -1701,7 +1572,7 @@ yyerrorlab:
      goto yyerrorlab;
 
   yyerror_range[1] = yylsp[1-yylen];
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
   yylen = 0;
@@ -1714,35 +1585,37 @@ yyerrorlab:
 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
 `-------------------------------------------------------------*/
 yyerrlab1:
-  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
   for (;;)
     {
       yyn = yypact[yystate];
       if (!yypact_value_is_default (yyn))
-	{
-	  yyn += YYTERROR;
-	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-	    {
-	      yyn = yytable[yyn];
-	      if (0 < yyn)
-		break;
-	    }
-	}
+        {
+          yyn += YYTERROR;
+          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+            {
+              yyn = yytable[yyn];
+              if (0 < yyn)
+                break;
+            }
+        }
 
       /* Pop the current state because it cannot handle the error token.  */
       if (yyssp == yyss)
-	YYABORT;
+        YYABORT;
 
       yyerror_range[1] = *yylsp;
       yydestruct ("Error: popping",
-		  yystos[yystate], yyvsp, yylsp, ctx);
+                  yystos[yystate], yyvsp, yylsp, ctx);
       YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
     }
 
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 
   yyerror_range[2] = yylloc;
   /* Using YYLLOC is tempting, but would change the location of
@@ -1771,7 +1644,7 @@ yyabortlab:
   yyresult = 1;
   goto yyreturn;
 
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
@@ -1790,14 +1663,14 @@ yyreturn:
       yydestruct ("Cleanup: discarding lookahead",
                   yytoken, &yylval, &yylloc, ctx);
     }
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
   YY_STACK_PRINT (yyss, yyssp);
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
-		  yystos[*yyssp], yyvsp, yylsp, ctx);
+                  yystos[*yyssp], yyvsp, yylsp, ctx);
       YYPOPSTACK (1);
     }
 #ifndef yyoverflow
@@ -1808,9 +1681,5 @@ yyreturn:
   if (yymsg != yymsgbuf)
     YYSTACK_FREE (yymsg);
 #endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
+  return yyresult;
 }
-
-
-
diff --git a/tools/libxl/libxlu_cfg_y.h b/tools/libxl/libxlu_cfg_y.h
index 37e8213..0211f80 100644
--- a/tools/libxl/libxlu_cfg_y.h
+++ b/tools/libxl/libxlu_cfg_y.h
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.5.  */
+/* A Bison parser, made by GNU Bison 3.0.2.  */
 
 /* Bison interface for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -26,60 +26,64 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
+#ifndef YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED
+# define YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED
+/* Debug traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int xlu__cfg_yydebug;
+#endif
 
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     IDENT = 258,
-     STRING = 259,
-     NUMBER = 260,
-     NEWLINE = 261
-   };
+  enum yytokentype
+  {
+    IDENT = 258,
+    STRING = 259,
+    NUMBER = 260,
+    NEWLINE = 261
+  };
 #endif
 
-
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
 {
-
-/* Line 2068 of yacc.c  */
-#line 25 "libxlu_cfg_y.y"
+#line 25 "libxlu_cfg_y.y" /* yacc.c:1909  */
 
   char *string;
   XLU_ConfigValue *value;
 
-
-
-/* Line 2068 of yacc.c  */
-#line 63 "libxlu_cfg_y.h"
-} YYSTYPE;
+#line 66 "libxlu_cfg_y.h" /* yacc.c:1909  */
+};
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
-
-
+/* Location type.  */
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
 {
   int first_line;
   int first_column;
   int last_line;
   int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
 # define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
 
+int xlu__cfg_yyparse (CfgParseContext *ctx);
+
+#endif /* !YY_XLU_CFG_YY_LIBXLU_CFG_Y_H_INCLUDED  */
diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c
index beea7f9..d15d7d6 100644
--- a/tools/libxl/libxlu_disk_l.c
+++ b/tools/libxl/libxlu_disk_l.c
@@ -13,7 +13,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -183,11 +183,17 @@ typedef void* yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
     #define YY_LESS_LINENO(n)
+    #define YY_LINENO_REWIND_TO(ptr)
     
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -205,11 +211,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -227,7 +228,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -306,7 +307,7 @@ static void xlu__disk_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yys
 
 YY_BUFFER_STATE xlu__disk_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 void *xlu__disk_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *xlu__disk_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -336,7 +337,7 @@ void xlu__disk_yyfree (void * ,yyscan_t yyscanner );
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
-#define xlu__disk_yywrap(n) 1
+#define xlu__disk_yywrap(yyscanner) 1
 #define YY_SKIP_YYWRAP
 
 typedef unsigned char YY_CHAR;
@@ -914,7 +915,7 @@ static int vdev_and_devtype(DiskParseContext *dpc, char *str) {
 #define DPC ((DiskParseContext*)yyextra)
 
 
-#line 918 "libxlu_disk_l.c"
+#line 919 "libxlu_disk_l.c"
 
 #define INITIAL 0
 #define LEXERR 1
@@ -944,8 +945,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -1003,7 +1004,7 @@ FILE *xlu__disk_yyget_out (yyscan_t yyscanner );
 
 void xlu__disk_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int xlu__disk_yyget_leng (yyscan_t yyscanner );
+yy_size_t xlu__disk_yyget_leng (yyscan_t yyscanner );
 
 char *xlu__disk_yyget_text (yyscan_t yyscanner );
 
@@ -1154,13 +1155,6 @@ YY_DECL
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 155 "libxlu_disk_l.l"
-
-
- /*----- the scanner rules which do the parsing -----*/
-
-#line 1163 "libxlu_disk_l.c"
-
 	if ( !yyg->yy_init )
 		{
 		yyg->yy_init = 1;
@@ -1193,6 +1187,14 @@ YY_DECL
 		xlu__disk_yy_load_buffer_state(yyscanner );
 		}
 
+	{
+#line 155 "libxlu_disk_l.l"
+
+
+ /*----- the scanner rules which do the parsing -----*/
+
+#line 1197 "libxlu_disk_l.c"
+
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
 		yyg->yy_more_len = 0;
@@ -1219,7 +1221,7 @@ YY_DECL
 yy_match:
 		do
 			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
@@ -1502,7 +1504,7 @@ YY_RULE_SETUP
 #line 259 "libxlu_disk_l.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
 	YY_BREAK
-#line 1506 "libxlu_disk_l.c"
+#line 1508 "libxlu_disk_l.c"
 			case YY_STATE_EOF(INITIAL):
 			case YY_STATE_EOF(LEXERR):
 				yyterminate();
@@ -1634,6 +1636,7 @@ YY_FATAL_ERROR( "flex scanner jammed" );
 			"fatal flex scanner internal error--no action found" );
 	} /* end of action switch */
 		} /* end of scanning one token */
+	} /* end of user's declarations */
 } /* end of xlu__disk_yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1690,7 +1693,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 	else
 		{
-			int num_to_read =
+			yy_size_t num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
@@ -1706,7 +1709,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, (size_t) num_to_read );
+			yyg->yy_n_chars, num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
@@ -1798,6 +1801,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	if ( ! yy_is_jam )
 		*yyg->yy_state_ptr++ = yy_current_state;
 
+	(void)yyg;
 	return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1826,7 +1830,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		else
 			{ /* need more input */
-			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 			++yyg->yy_c_buf_p;
 
 			switch ( yy_get_next_buffer( yyscanner ) )
@@ -1990,10 +1994,6 @@ static void xlu__disk_yy_load_buffer_state  (yyscan_t yyscanner)
 	xlu__disk_yyfree((void *) b ,yyscanner );
 }
 
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a xlu__disk_yyrestart() or at EOF.
@@ -2110,7 +2110,7 @@ void xlu__disk_yypop_buffer_state (yyscan_t yyscanner)
  */
 static void xlu__disk_yyensure_buffer_stack (yyscan_t yyscanner)
 {
-	int num_to_alloc;
+	yy_size_t num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 	if (!yyg->yy_buffer_stack) {
@@ -2208,12 +2208,12 @@ YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char * yystr , yyscan_t yyscan
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE xlu__disk_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE xlu__disk_yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
 	char *buf;
 	yy_size_t n;
-	int i;
+	yy_size_t i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
@@ -2323,7 +2323,7 @@ FILE *xlu__disk_yyget_out  (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int xlu__disk_yyget_leng  (yyscan_t yyscanner)
+yy_size_t xlu__disk_yyget_leng  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyleng;
@@ -2359,7 +2359,7 @@ void xlu__disk_yyset_lineno (int  line_number , yyscan_t yyscanner)
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "xlu__disk_yyset_lineno called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "xlu__disk_yyset_lineno called with no buffer" );
     
     yylineno = line_number;
 }
@@ -2374,7 +2374,7 @@ void xlu__disk_yyset_column (int  column_no , yyscan_t yyscanner)
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "xlu__disk_yyset_column called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "xlu__disk_yyset_column called with no buffer" );
     
     yycolumn = column_no;
 }
@@ -2594,4 +2594,4 @@ void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 259 "libxlu_disk_l.l"
+#line 258 "libxlu_disk_l.l"
diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libxl/libxlu_disk_l.h
index f615582..496f208 100644
--- a/tools/libxl/libxlu_disk_l.h
+++ b/tools/libxl/libxlu_disk_l.h
@@ -17,7 +17,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -174,7 +174,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -218,13 +218,13 @@ void xlu__disk_yypop_buffer_state (yyscan_t yyscanner );
 
 YY_BUFFER_STATE xlu__disk_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 void *xlu__disk_yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *xlu__disk_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
 void xlu__disk_yyfree (void * ,yyscan_t yyscanner );
 
-#define xlu__disk_yywrap(n) 1
+#define xlu__disk_yywrap(yyscanner) 1
 #define YY_SKIP_YYWRAP
 
 #define yytext_ptr yytext_r
@@ -272,7 +272,7 @@ FILE *xlu__disk_yyget_out (yyscan_t yyscanner );
 
 void xlu__disk_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int xlu__disk_yyget_leng (yyscan_t yyscanner );
+yy_size_t xlu__disk_yyget_leng (yyscan_t yyscanner );
 
 char *xlu__disk_yyget_text (yyscan_t yyscanner );
 
@@ -348,7 +348,7 @@ extern int xlu__disk_yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
-#line 259 "libxlu_disk_l.l"
+#line 258 "libxlu_disk_l.l"
 
 #line 354 "libxlu_disk_l.h"
 #undef xlu__disk_yyIN_HEADER
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:11:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkB1-0001Sb-NG; Thu, 29 Oct 2015 10:11:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB0-0001SK-Jr
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:22 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	A9/90-12371-7C0F1365; Thu, 29 Oct 2015 10:11:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446113476!35986682!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7654 invoked from network); 29 Oct 2015 10:11:18 -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;
	29 Oct 2015 10:11:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkAu-0004ZB-2i
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkAt-00052S-T2
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:15 +0000
Date: Thu, 29 Oct 2015 10:11:15 +0000
Message-Id: <E1ZrkAt-00052S-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: CODING_STYLE: GC* cannot
	be used with NOGC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b7df8e8079995b3b9431084f77fe2526eb4ef18
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 16 11:33:12 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:07:43 2015 +0100

    tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
    
    GC* assume an existing gc in scope, which means they can't be passed
    NOGC. Instead recommend the use of the underlying functions with NOGC,
    noting that this is excepitonal.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- refer to libxl__calloc not (nonexistent) libxl__alloc ]
---
 tools/libxl/CODING_STYLE |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/CODING_STYLE b/tools/libxl/CODING_STYLE
index a65efb3..919bcc6 100644
--- a/tools/libxl/CODING_STYLE
+++ b/tools/libxl/CODING_STYLE
@@ -57,13 +57,14 @@ whenever they are applicable.  For example:
   libxl__log[v]           LOG, LOGE, LOGEV
   libxl__sprintf          GCSPRINTF
   libxl__*alloc et al.    GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY
-  malloc et al.           GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY with NOGC
   isalnum etc. directly   CTYPE
   libxl__ctx_[un]lock     CTX_LOCK, CTX_UNLOCK
   gc=...; ao=...;         EGC_GC, AO_GC, STATE_AO_GC
   explicit gc creation    GC_INIT, GC_FREE
   memset(..,0,sizeof..)   FILLZERO
 
+Instead of malloc et al one should (as an exception to the above) use
+libxl__{zalloc,calloc,realloc} etc but passing NOGC.
 
 ERROR HANDLING
 --------------
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:11:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkB8-0001UK-VI; Thu, 29 Oct 2015 10:11:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB8-0001U8-BZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:30 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	9C/BC-29649-1D0F1365; Thu, 29 Oct 2015 10:11:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1446113487!55492533!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14862 invoked from network); 29 Oct 2015 10:11:28 -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;
	29 Oct 2015 10:11:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB5-0004ZG-8Y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB4-00053C-Cf
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:26 +0000
Date: Thu, 29 Oct 2015 10:11:26 +0000
Message-Id: <E1ZrkB4-00053C-Cf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: No emulated disk driver for
	xvdX disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c0c099d157cc5bc942afef766cf141628a6380a1
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Oct 14 12:05:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:10:31 2015 +0100

    libxl: No emulated disk driver for xvdX disk
    
    When a guest configuration list xvdX for its disks, there is no need to
    provide an emulated driver for the same target.
    
    Such configuration can work with the OVMF firmware, as it supports PV
    disk.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index e33d492..9c9eaa3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1189,6 +1189,12 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                     drive = libxl__sprintf
                         (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback",
                          pdev_path, disk, format);
+                else if (strncmp(disks[i].vdev, "xvd", 3) == 0)
+                    /*
+                     * Do not add any emulated disk when PV disk are
+                     * explicitly asked for.
+                     */
+                    continue;
                 else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
                     flexarray_vappend(dm_args, "-drive",
                         GCSPRINTF("file=%s,if=none,id=ahcidisk-%d,format=%s,cache=writeback",
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:11:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkB8-0001UK-VI; Thu, 29 Oct 2015 10:11:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB8-0001U8-BZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:30 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	9C/BC-29649-1D0F1365; Thu, 29 Oct 2015 10:11:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1446113487!55492533!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14862 invoked from network); 29 Oct 2015 10:11:28 -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;
	29 Oct 2015 10:11:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB5-0004ZG-8Y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkB4-00053C-Cf
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:26 +0000
Date: Thu, 29 Oct 2015 10:11:26 +0000
Message-Id: <E1ZrkB4-00053C-Cf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: No emulated disk driver for
	xvdX disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c0c099d157cc5bc942afef766cf141628a6380a1
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Oct 14 12:05:17 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:10:31 2015 +0100

    libxl: No emulated disk driver for xvdX disk
    
    When a guest configuration list xvdX for its disks, there is no need to
    provide an emulated driver for the same target.
    
    Such configuration can work with the OVMF firmware, as it supports PV
    disk.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index e33d492..9c9eaa3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1189,6 +1189,12 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                     drive = libxl__sprintf
                         (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback",
                          pdev_path, disk, format);
+                else if (strncmp(disks[i].vdev, "xvd", 3) == 0)
+                    /*
+                     * Do not add any emulated disk when PV disk are
+                     * explicitly asked for.
+                     */
+                    continue;
                 else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
                     flexarray_vappend(dm_args, "-drive",
                         GCSPRINTF("file=%s,if=none,id=ahcidisk-%d,format=%s,cache=writeback",
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:11:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11: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 1ZrkBK-0001W8-1i; Thu, 29 Oct 2015 10:11: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 1ZrkBI-0001Vx-HY
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:40 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	51/37-13905-BD0F1365; Thu, 29 Oct 2015 10:11:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446113497!16164869!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25377 invoked from network); 29 Oct 2015 10:11:38 -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;
	29 Oct 2015 10:11:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBF-0004Zb-Kd
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBF-00053w-IC
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:37 +0000
Date: Thu, 29 Oct 2015 10:11:37 +0000
Message-Id: <E1ZrkBF-00053w-IC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04c5efb0a141fa53e805e396970419436e74ce67
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:12:09 2015 +0100

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 114db9a..5db7ca5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -253,7 +253,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
+OVMF_UPSTREAM_REVISION ?= af9785a9ed61daea52b47f0bf448f1f228beee1e
 QEMU_UPSTREAM_REVISION ?= master
 MINIOS_UPSTREAM_REVISION ?= 256035e01a1aa5739e34f245f3b1e9e8ee204210
 # Thu Jul 23 11:08:38 2015 +0100
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:11:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11: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 1ZrkBK-0001W8-1i; Thu, 29 Oct 2015 10:11: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 1ZrkBI-0001Vx-HY
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:40 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	51/37-13905-BD0F1365; Thu, 29 Oct 2015 10:11:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446113497!16164869!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25377 invoked from network); 29 Oct 2015 10:11:38 -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;
	29 Oct 2015 10:11:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBF-0004Zb-Kd
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBF-00053w-IC
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:37 +0000
Date: Thu, 29 Oct 2015 10:11:37 +0000
Message-Id: <E1ZrkBF-00053w-IC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04c5efb0a141fa53e805e396970419436e74ce67
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:12:09 2015 +0100

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 114db9a..5db7ca5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -253,7 +253,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
+OVMF_UPSTREAM_REVISION ?= af9785a9ed61daea52b47f0bf448f1f228beee1e
 QEMU_UPSTREAM_REVISION ?= master
 MINIOS_UPSTREAM_REVISION ?= 256035e01a1aa5739e34f245f3b1e9e8ee204210
 # Thu Jul 23 11:08:38 2015 +0100
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:11:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11: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 1ZrkBU-0001YQ-4T; Thu, 29 Oct 2015 10:11: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 1ZrkBT-0001YF-As
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:51 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	59/FD-25435-6E0F1365; Thu, 29 Oct 2015 10:11:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446113508!35986917!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13814 invoked from network); 29 Oct 2015 10:11:49 -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;
	29 Oct 2015 10:11:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBQ-0004Zj-1e
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBP-00055U-W7
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:48 +0000
Date: Thu, 29 Oct 2015 10:11:47 +0000
Message-Id: <E1ZrkBP-00055U-W7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools & docs: add tools and docs
	support for Intel CDP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fc5b2486441359f64bf749bc6f27c38fcc8d60c4
Author:     He Chen <he.chen@linux.intel.com>
AuthorDate: Mon Oct 19 15:31:55 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:15:09 2015 +0100

    tools & docs: add tools and docs support for Intel CDP
    
    This is the xl/xc changes to support Intel Code/Data Prioritization.
    CAT xl commands to set/get CBMs are extended to support CDP.
    Add new CDP options with CAT commands in xl interface man page.
    Add description of CDP in xl-psr.markdown.
    
    Signed-off-by: He Chen <he.chen@linux.intel.com>
    Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.pod.1             |   15 +++++++++
 docs/misc/xl-psr.markdown     |   53 ++++++++++++++++++++++++++++++++
 tools/libxc/include/xenctrl.h |    7 +++-
 tools/libxc/xc_psr.c          |   17 ++++++++++-
 tools/libxl/libxl.h           |    7 ++++
 tools/libxl/libxl_psr.c       |    5 ++-
 tools/libxl/libxl_types.idl   |    3 ++
 tools/libxl/xl_cmdimpl.c      |   67 +++++++++++++++++++++++++++++++++-------
 tools/libxl/xl_cmdtable.c     |    2 +
 9 files changed, 160 insertions(+), 16 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index d0cd612..4279c7c 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1518,6 +1518,13 @@ applications. In the Xen implementation, CAT is used to control cache allocation
 on VM basis. To enforce cache on a specific domain, just set capacity bitmasks
 (CBM) for the domain.
 
+Intel Broadwell and later server platforms also offer Code/Data Prioritization
+(CDP) for cache allocations, which support specifying code or data cache for
+applications. CDP is used on a per VM basis in the Xen implementation. To
+specify code or data CBM for the domain, CDP feature must be enabled and CBM
+type options need to be specified when setting CBM, and the type options (code
+and data) are mutually exclusive.
+
 =over 4
 
 =item B<psr-cat-cbm-set> [I<OPTIONS>] I<domain-id> I<cbm>
@@ -1533,6 +1540,14 @@ B<OPTIONS>
 
 Specify the socket to process, otherwise all sockets are processed.
 
+=item B<-c>, B<--code>
+
+Set code CBM when CDP is enabled.
+
+=item B<-d>, B<--data>
+
+Set data CBM when CDP is enabled.
+
 =back
 
 =item B<psr-cat-show> [I<domain-id>]
diff --git a/docs/misc/xl-psr.markdown b/docs/misc/xl-psr.markdown
index c32e25c..c3c1e8e 100644
--- a/docs/misc/xl-psr.markdown
+++ b/docs/misc/xl-psr.markdown
@@ -127,6 +127,59 @@ Per domain CBM settings can be shown by:
 
 `xl psr-cat-show`
 
+## Code and Data Prioritization (CDP)
+
+Code and Data Prioritization (CDP) Technology is an extension of CAT, which
+is available on Intel Broadwell and later server platforms. CDP enables
+isolation and separate prioritization of code and data fetches to the L3
+cache in a software configurable manner, which can enable workload
+prioritization and tuning of cache capacity to the characteristics of the
+workload. CDP extends Cache Allocation Technology (CAT) by providing
+separate code and data masks per Class of Service (COS).
+
+CDP can be enabled by adding `psr=cdp` to Xen command line.
+
+When CDP is enabled,
+
+ * the CAT masks are re-mapped into interleaved pairs of masks for data or
+   code fetches.
+
+ * the range of COS for CAT is re-indexed, with the lower-half of the COS
+   range available for CDP.
+
+CDP allows the OS or Hypervisor to partition cache allocation in a more
+fine-grained manner. Code cache and data cache can be specified independently.
+With CDP enabled, one COS corresponds to two CBMs (code CBM & data CBM),
+since the sum of CBMs is fixed, that means the number of available COSes
+will reduce by half when CDP is on.
+
+For more detailed information please refer to Intel SDM chapter
+"Platform Shared Resource Control: Cache Allocation Technology".
+
+The xl interfaces are the same with that of CAT. The difference is that
+CBM type can be passed as option to set code CBM or data CBM.
+
+When CDP is enabled, `-c` or `--code` option is available to set code CBM
+for the domain.
+
+When CDP is enabled, `-d` or `--data` option is available to set data CBM
+for the domain.
+
+If neither `-c` nor `-d` option is specified when CDP is on, the same code
+CBM and data CBM will be set for the domain. Passing both `-c` and `-d`
+options is invalid.
+
+Example:
+
+Setting code CBM for a domain:
+`xl psr-cat-cbm-set -c <domid> <cbm>`
+
+Setting data CBM for a domain:
+`xl psr-cat-cbm-set -d <domid> <cbm>`
+
+Setting the same code and data CBM for a domain:
+`xl psr-cat-cbm-set <domid> <cbm>`
+
 ## Reference
 
 [1] Intel SDM
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 3bfa00b..2fec1fb 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2827,7 +2827,9 @@ enum xc_psr_cmt_type {
 typedef enum xc_psr_cmt_type xc_psr_cmt_type;
 
 enum xc_psr_cat_type {
-    XC_PSR_CAT_L3_CBM = 1,
+    XC_PSR_CAT_L3_CBM      = 1,
+    XC_PSR_CAT_L3_CBM_CODE = 2,
+    XC_PSR_CAT_L3_CBM_DATA = 3,
 };
 typedef enum xc_psr_cat_type xc_psr_cat_type;
 
@@ -2853,7 +2855,8 @@ int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid,
                                xc_psr_cat_type type, uint32_t target,
                                uint64_t *data);
 int xc_psr_cat_get_l3_info(xc_interface *xch, uint32_t socket,
-                           uint32_t *cos_max, uint32_t *cbm_len);
+                           uint32_t *cos_max, uint32_t *cbm_len,
+                           bool *cdp_enabled);
 #endif
 
 #endif /* XENCTRL_H */
diff --git a/tools/libxc/xc_psr.c b/tools/libxc/xc_psr.c
index d8b3a51..43b3286 100644
--- a/tools/libxc/xc_psr.c
+++ b/tools/libxc/xc_psr.c
@@ -260,6 +260,12 @@ int xc_psr_cat_set_domain_data(xc_interface *xch, uint32_t domid,
     case XC_PSR_CAT_L3_CBM:
         cmd = XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM;
         break;
+    case XC_PSR_CAT_L3_CBM_CODE:
+        cmd = XEN_DOMCTL_PSR_CAT_OP_SET_L3_CODE;
+        break;
+    case XC_PSR_CAT_L3_CBM_DATA:
+        cmd = XEN_DOMCTL_PSR_CAT_OP_SET_L3_DATA;
+        break;
     default:
         errno = EINVAL;
         return -1;
@@ -287,6 +293,12 @@ int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid,
     case XC_PSR_CAT_L3_CBM:
         cmd = XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM;
         break;
+    case XC_PSR_CAT_L3_CBM_CODE:
+        cmd = XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE;
+        break;
+    case XC_PSR_CAT_L3_CBM_DATA:
+        cmd = XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA;
+        break;
     default:
         errno = EINVAL;
         return -1;
@@ -306,7 +318,8 @@ int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid,
 }
 
 int xc_psr_cat_get_l3_info(xc_interface *xch, uint32_t socket,
-                           uint32_t *cos_max, uint32_t *cbm_len)
+                           uint32_t *cos_max, uint32_t *cbm_len,
+                           bool *cdp_enabled)
 {
     int rc;
     DECLARE_SYSCTL;
@@ -320,6 +333,8 @@ int xc_psr_cat_get_l3_info(xc_interface *xch, uint32_t socket,
     {
         *cos_max = sysctl.u.psr_cat_op.u.l3_info.cos_max;
         *cbm_len = sysctl.u.psr_cat_op.u.l3_info.cbm_len;
+        *cdp_enabled = sysctl.u.psr_cat_op.u.l3_info.flags &
+                       XEN_SYSCTL_PSR_CAT_L3_CDP;
     }
 
     return rc;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 615b1de..168fedd 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -803,6 +803,13 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
  * If this is defined, the Cache Allocation Technology feature is supported.
  */
 #define LIBXL_HAVE_PSR_CAT 1
+
+/*
+ * LIBXL_HAVE_PSR_CDP
+ *
+ * If this is defined, the Code and Data Prioritization feature is supported.
+ */
+#define LIBXL_HAVE_PSR_CDP 1
 #endif
 
 /*
diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 000d748..3d0dc61 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -87,6 +87,9 @@ static void libxl__psr_cat_log_err_msg(libxl__gc *gc, int err)
     case EEXIST:
         msg = "The same CBM is already set to this domain";
         break;
+    case ENXIO:
+        msg = "Unable to set code or data CBM when CDP is disabled";
+        break;
 
     default:
         libxl__psr_log_err_msg(gc, err);
@@ -363,7 +366,7 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
     libxl_for_each_set_bit(socketid, socketmap) {
         ptr[i].id = socketid;
         if (xc_psr_cat_get_l3_info(ctx->xch, socketid, &ptr[i].cos_max,
-                                   &ptr[i].cbm_len)) {
+                                   &ptr[i].cbm_len, &ptr[i].cdp_enabled)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index d6ef9a2..4d78f86 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -797,10 +797,13 @@ libxl_psr_cmt_type = Enumeration("psr_cmt_type", [
 libxl_psr_cbm_type = Enumeration("psr_cbm_type", [
     (0, "UNKNOWN"),
     (1, "L3_CBM"),
+    (2, "L3_CBM_CODE"),
+    (3, "L3_CBM_DATA"),
     ])
 
 libxl_psr_cat_info = Struct("psr_cat_info", [
     ("id", uint32),
     ("cos_max", uint32),
     ("cbm_len", uint32),
+    ("cdp_enabled", bool),
     ])
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 365798b..646b281 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8434,6 +8434,8 @@ static int psr_cat_hwinfo(void)
         }
         printf("%-16s: %u\n", "Socket ID", info[i].id);
         printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
+        printf("%-16s: %s\n", "CDP Status",
+               info[i].cdp_enabled ? "Enabled" : "Disabled");
         printf("%-16s: %u\n", "Maximum COS", info[i].cos_max);
         printf("%-16s: %u\n", "CBM length", info[i].cbm_len);
         printf("%-16s: %#llx\n", "Default CBM",
@@ -8445,29 +8447,47 @@ out:
     return rc;
 }
 
-static void psr_cat_print_one_domain_cbm(uint32_t domid, uint32_t socketid)
+static void psr_cat_print_one_domain_cbm_type(uint32_t domid, uint32_t socketid,
+                                              libxl_psr_cbm_type type)
 {
-    char *domain_name;
     uint64_t cbm;
 
+    if (!libxl_psr_cat_get_cbm(ctx, domid, type, socketid, &cbm))
+        printf("%#16"PRIx64, cbm);
+    else
+        printf("%16s", "error");
+}
+
+static void psr_cat_print_one_domain_cbm(uint32_t domid, uint32_t socketid,
+                                         bool cdp_enabled)
+{
+    char *domain_name;
+
     domain_name = libxl_domid_to_name(ctx, domid);
     printf("%5d%25s", domid, domain_name);
     free(domain_name);
 
-    if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_CBM,
-                               socketid, &cbm))
-         printf("%#16"PRIx64, cbm);
+    if (!cdp_enabled) {
+        psr_cat_print_one_domain_cbm_type(domid, socketid,
+                                          LIBXL_PSR_CBM_TYPE_L3_CBM);
+    } else {
+        psr_cat_print_one_domain_cbm_type(domid, socketid,
+                                          LIBXL_PSR_CBM_TYPE_L3_CBM_CODE);
+        psr_cat_print_one_domain_cbm_type(domid, socketid,
+                                          LIBXL_PSR_CBM_TYPE_L3_CBM_DATA);
+    }
 
     printf("\n");
 }
 
-static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid)
+static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid,
+                                    bool cdp_enabled)
 {
     int i, nr_domains;
     libxl_dominfo *list;
 
     if (domid != INVALID_DOMID) {
-        psr_cat_print_one_domain_cbm(domid, socketid);
+        psr_cat_print_one_domain_cbm(domid, socketid, cdp_enabled);
         return 0;
     }
 
@@ -8477,7 +8497,7 @@ static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid)
     }
 
     for (i = 0; i < nr_domains; i++)
-        psr_cat_print_one_domain_cbm(list[i].domid, socketid);
+        psr_cat_print_one_domain_cbm(list[i].domid, socketid, cdp_enabled);
     libxl_dominfo_list_free(list, nr_domains);
 
     return 0;
@@ -8498,9 +8518,12 @@ static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info)
     printf("%-16s: %u\n", "Socket ID", info->id);
     printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
     printf("%-16s: %#llx\n", "Default CBM", (1ull << info->cbm_len) - 1);
-    printf("%5s%25s%16s\n", "ID", "NAME", "CBM");
+    if (info->cdp_enabled)
+        printf("%5s%25s%16s%16s\n", "ID", "NAME", "CBM (code)", "CBM (data)");
+    else
+        printf("%5s%25s%16s\n", "ID", "NAME", "CBM");
 
-    return psr_cat_print_domain_cbm(domid, info->id);
+    return psr_cat_print_domain_cbm(domid, info->id, info->cdp_enabled);
 }
 
 static int psr_cat_show(uint32_t domid)
@@ -8529,9 +8552,10 @@ out:
 int main_psr_cat_cbm_set(int argc, char **argv)
 {
     uint32_t domid;
-    libxl_psr_cbm_type type = LIBXL_PSR_CBM_TYPE_L3_CBM;
+    libxl_psr_cbm_type type;
     uint64_t cbm;
     int ret, opt = 0;
+    int opt_data = 0, opt_code = 0;
     libxl_bitmap target_map;
     char *value;
     libxl_string_list socket_list;
@@ -8540,13 +8564,15 @@ int main_psr_cat_cbm_set(int argc, char **argv)
 
     static struct option opts[] = {
         {"socket", 1, 0, 's'},
+        {"data", 0, 0, 'd'},
+        {"code", 0, 0, 'c'},
         COMMON_LONG_OPTS
     };
 
     libxl_socket_bitmap_alloc(ctx, &target_map, 0);
     libxl_bitmap_set_none(&target_map);
 
-    SWITCH_FOREACH_OPT(opt, "s:", opts, "psr-cat-cbm-set", 2) {
+    SWITCH_FOREACH_OPT(opt, "s:cd", opts, "psr-cat-cbm-set", 2) {
     case 's':
         trim(isspace, optarg, &value);
         split_string_into_string_list(value, ",", &socket_list);
@@ -8560,6 +8586,23 @@ int main_psr_cat_cbm_set(int argc, char **argv)
         libxl_string_list_dispose(&socket_list);
         free(value);
         break;
+    case 'd':
+        opt_data = 1;
+        break;
+    case 'c':
+        opt_code = 1;
+        break;
+    }
+
+    if (opt_data && opt_code) {
+        fprintf(stderr, "Cannot handle -c and -d at the same time\n");
+        return -1;
+    } else if (opt_data) {
+        type = LIBXL_PSR_CBM_TYPE_L3_CBM_DATA;
+    } else if (opt_code) {
+        type = LIBXL_PSR_CBM_TYPE_L3_CBM_CODE;
+    } else {
+        type = LIBXL_PSR_CBM_TYPE_L3_CBM;
     }
 
     if (libxl_bitmap_is_empty(&target_map))
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 0071f12..fdc1ac6 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -543,6 +543,8 @@ struct cmd_spec cmd_table[] = {
       "Set cache capacity bitmasks(CBM) for a domain",
       "[options] <Domain> <CBM>",
       "-s <socket>       Specify the socket to process, otherwise all sockets are processed\n"
+      "-c                Set code CBM if CDP is supported\n"
+      "-d                Set data CBM if CDP is supported\n"
     },
     { "psr-cat-show",
       &main_psr_cat_show, 0, 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 Oct 29 10:11:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:11: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 1ZrkBU-0001YQ-4T; Thu, 29 Oct 2015 10:11: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 1ZrkBT-0001YF-As
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:51 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	59/FD-25435-6E0F1365; Thu, 29 Oct 2015 10:11:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446113508!35986917!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13814 invoked from network); 29 Oct 2015 10:11:49 -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;
	29 Oct 2015 10:11:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBQ-0004Zj-1e
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBP-00055U-W7
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:48 +0000
Date: Thu, 29 Oct 2015 10:11:47 +0000
Message-Id: <E1ZrkBP-00055U-W7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools & docs: add tools and docs
	support for Intel CDP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fc5b2486441359f64bf749bc6f27c38fcc8d60c4
Author:     He Chen <he.chen@linux.intel.com>
AuthorDate: Mon Oct 19 15:31:55 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:15:09 2015 +0100

    tools & docs: add tools and docs support for Intel CDP
    
    This is the xl/xc changes to support Intel Code/Data Prioritization.
    CAT xl commands to set/get CBMs are extended to support CDP.
    Add new CDP options with CAT commands in xl interface man page.
    Add description of CDP in xl-psr.markdown.
    
    Signed-off-by: He Chen <he.chen@linux.intel.com>
    Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.pod.1             |   15 +++++++++
 docs/misc/xl-psr.markdown     |   53 ++++++++++++++++++++++++++++++++
 tools/libxc/include/xenctrl.h |    7 +++-
 tools/libxc/xc_psr.c          |   17 ++++++++++-
 tools/libxl/libxl.h           |    7 ++++
 tools/libxl/libxl_psr.c       |    5 ++-
 tools/libxl/libxl_types.idl   |    3 ++
 tools/libxl/xl_cmdimpl.c      |   67 +++++++++++++++++++++++++++++++++-------
 tools/libxl/xl_cmdtable.c     |    2 +
 9 files changed, 160 insertions(+), 16 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index d0cd612..4279c7c 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1518,6 +1518,13 @@ applications. In the Xen implementation, CAT is used to control cache allocation
 on VM basis. To enforce cache on a specific domain, just set capacity bitmasks
 (CBM) for the domain.
 
+Intel Broadwell and later server platforms also offer Code/Data Prioritization
+(CDP) for cache allocations, which support specifying code or data cache for
+applications. CDP is used on a per VM basis in the Xen implementation. To
+specify code or data CBM for the domain, CDP feature must be enabled and CBM
+type options need to be specified when setting CBM, and the type options (code
+and data) are mutually exclusive.
+
 =over 4
 
 =item B<psr-cat-cbm-set> [I<OPTIONS>] I<domain-id> I<cbm>
@@ -1533,6 +1540,14 @@ B<OPTIONS>
 
 Specify the socket to process, otherwise all sockets are processed.
 
+=item B<-c>, B<--code>
+
+Set code CBM when CDP is enabled.
+
+=item B<-d>, B<--data>
+
+Set data CBM when CDP is enabled.
+
 =back
 
 =item B<psr-cat-show> [I<domain-id>]
diff --git a/docs/misc/xl-psr.markdown b/docs/misc/xl-psr.markdown
index c32e25c..c3c1e8e 100644
--- a/docs/misc/xl-psr.markdown
+++ b/docs/misc/xl-psr.markdown
@@ -127,6 +127,59 @@ Per domain CBM settings can be shown by:
 
 `xl psr-cat-show`
 
+## Code and Data Prioritization (CDP)
+
+Code and Data Prioritization (CDP) Technology is an extension of CAT, which
+is available on Intel Broadwell and later server platforms. CDP enables
+isolation and separate prioritization of code and data fetches to the L3
+cache in a software configurable manner, which can enable workload
+prioritization and tuning of cache capacity to the characteristics of the
+workload. CDP extends Cache Allocation Technology (CAT) by providing
+separate code and data masks per Class of Service (COS).
+
+CDP can be enabled by adding `psr=cdp` to Xen command line.
+
+When CDP is enabled,
+
+ * the CAT masks are re-mapped into interleaved pairs of masks for data or
+   code fetches.
+
+ * the range of COS for CAT is re-indexed, with the lower-half of the COS
+   range available for CDP.
+
+CDP allows the OS or Hypervisor to partition cache allocation in a more
+fine-grained manner. Code cache and data cache can be specified independently.
+With CDP enabled, one COS corresponds to two CBMs (code CBM & data CBM),
+since the sum of CBMs is fixed, that means the number of available COSes
+will reduce by half when CDP is on.
+
+For more detailed information please refer to Intel SDM chapter
+"Platform Shared Resource Control: Cache Allocation Technology".
+
+The xl interfaces are the same with that of CAT. The difference is that
+CBM type can be passed as option to set code CBM or data CBM.
+
+When CDP is enabled, `-c` or `--code` option is available to set code CBM
+for the domain.
+
+When CDP is enabled, `-d` or `--data` option is available to set data CBM
+for the domain.
+
+If neither `-c` nor `-d` option is specified when CDP is on, the same code
+CBM and data CBM will be set for the domain. Passing both `-c` and `-d`
+options is invalid.
+
+Example:
+
+Setting code CBM for a domain:
+`xl psr-cat-cbm-set -c <domid> <cbm>`
+
+Setting data CBM for a domain:
+`xl psr-cat-cbm-set -d <domid> <cbm>`
+
+Setting the same code and data CBM for a domain:
+`xl psr-cat-cbm-set <domid> <cbm>`
+
 ## Reference
 
 [1] Intel SDM
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 3bfa00b..2fec1fb 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2827,7 +2827,9 @@ enum xc_psr_cmt_type {
 typedef enum xc_psr_cmt_type xc_psr_cmt_type;
 
 enum xc_psr_cat_type {
-    XC_PSR_CAT_L3_CBM = 1,
+    XC_PSR_CAT_L3_CBM      = 1,
+    XC_PSR_CAT_L3_CBM_CODE = 2,
+    XC_PSR_CAT_L3_CBM_DATA = 3,
 };
 typedef enum xc_psr_cat_type xc_psr_cat_type;
 
@@ -2853,7 +2855,8 @@ int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid,
                                xc_psr_cat_type type, uint32_t target,
                                uint64_t *data);
 int xc_psr_cat_get_l3_info(xc_interface *xch, uint32_t socket,
-                           uint32_t *cos_max, uint32_t *cbm_len);
+                           uint32_t *cos_max, uint32_t *cbm_len,
+                           bool *cdp_enabled);
 #endif
 
 #endif /* XENCTRL_H */
diff --git a/tools/libxc/xc_psr.c b/tools/libxc/xc_psr.c
index d8b3a51..43b3286 100644
--- a/tools/libxc/xc_psr.c
+++ b/tools/libxc/xc_psr.c
@@ -260,6 +260,12 @@ int xc_psr_cat_set_domain_data(xc_interface *xch, uint32_t domid,
     case XC_PSR_CAT_L3_CBM:
         cmd = XEN_DOMCTL_PSR_CAT_OP_SET_L3_CBM;
         break;
+    case XC_PSR_CAT_L3_CBM_CODE:
+        cmd = XEN_DOMCTL_PSR_CAT_OP_SET_L3_CODE;
+        break;
+    case XC_PSR_CAT_L3_CBM_DATA:
+        cmd = XEN_DOMCTL_PSR_CAT_OP_SET_L3_DATA;
+        break;
     default:
         errno = EINVAL;
         return -1;
@@ -287,6 +293,12 @@ int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid,
     case XC_PSR_CAT_L3_CBM:
         cmd = XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM;
         break;
+    case XC_PSR_CAT_L3_CBM_CODE:
+        cmd = XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE;
+        break;
+    case XC_PSR_CAT_L3_CBM_DATA:
+        cmd = XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA;
+        break;
     default:
         errno = EINVAL;
         return -1;
@@ -306,7 +318,8 @@ int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid,
 }
 
 int xc_psr_cat_get_l3_info(xc_interface *xch, uint32_t socket,
-                           uint32_t *cos_max, uint32_t *cbm_len)
+                           uint32_t *cos_max, uint32_t *cbm_len,
+                           bool *cdp_enabled)
 {
     int rc;
     DECLARE_SYSCTL;
@@ -320,6 +333,8 @@ int xc_psr_cat_get_l3_info(xc_interface *xch, uint32_t socket,
     {
         *cos_max = sysctl.u.psr_cat_op.u.l3_info.cos_max;
         *cbm_len = sysctl.u.psr_cat_op.u.l3_info.cbm_len;
+        *cdp_enabled = sysctl.u.psr_cat_op.u.l3_info.flags &
+                       XEN_SYSCTL_PSR_CAT_L3_CDP;
     }
 
     return rc;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 615b1de..168fedd 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -803,6 +803,13 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
  * If this is defined, the Cache Allocation Technology feature is supported.
  */
 #define LIBXL_HAVE_PSR_CAT 1
+
+/*
+ * LIBXL_HAVE_PSR_CDP
+ *
+ * If this is defined, the Code and Data Prioritization feature is supported.
+ */
+#define LIBXL_HAVE_PSR_CDP 1
 #endif
 
 /*
diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 000d748..3d0dc61 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -87,6 +87,9 @@ static void libxl__psr_cat_log_err_msg(libxl__gc *gc, int err)
     case EEXIST:
         msg = "The same CBM is already set to this domain";
         break;
+    case ENXIO:
+        msg = "Unable to set code or data CBM when CDP is disabled";
+        break;
 
     default:
         libxl__psr_log_err_msg(gc, err);
@@ -363,7 +366,7 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
     libxl_for_each_set_bit(socketid, socketmap) {
         ptr[i].id = socketid;
         if (xc_psr_cat_get_l3_info(ctx->xch, socketid, &ptr[i].cos_max,
-                                   &ptr[i].cbm_len)) {
+                                   &ptr[i].cbm_len, &ptr[i].cdp_enabled)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index d6ef9a2..4d78f86 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -797,10 +797,13 @@ libxl_psr_cmt_type = Enumeration("psr_cmt_type", [
 libxl_psr_cbm_type = Enumeration("psr_cbm_type", [
     (0, "UNKNOWN"),
     (1, "L3_CBM"),
+    (2, "L3_CBM_CODE"),
+    (3, "L3_CBM_DATA"),
     ])
 
 libxl_psr_cat_info = Struct("psr_cat_info", [
     ("id", uint32),
     ("cos_max", uint32),
     ("cbm_len", uint32),
+    ("cdp_enabled", bool),
     ])
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 365798b..646b281 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8434,6 +8434,8 @@ static int psr_cat_hwinfo(void)
         }
         printf("%-16s: %u\n", "Socket ID", info[i].id);
         printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
+        printf("%-16s: %s\n", "CDP Status",
+               info[i].cdp_enabled ? "Enabled" : "Disabled");
         printf("%-16s: %u\n", "Maximum COS", info[i].cos_max);
         printf("%-16s: %u\n", "CBM length", info[i].cbm_len);
         printf("%-16s: %#llx\n", "Default CBM",
@@ -8445,29 +8447,47 @@ out:
     return rc;
 }
 
-static void psr_cat_print_one_domain_cbm(uint32_t domid, uint32_t socketid)
+static void psr_cat_print_one_domain_cbm_type(uint32_t domid, uint32_t socketid,
+                                              libxl_psr_cbm_type type)
 {
-    char *domain_name;
     uint64_t cbm;
 
+    if (!libxl_psr_cat_get_cbm(ctx, domid, type, socketid, &cbm))
+        printf("%#16"PRIx64, cbm);
+    else
+        printf("%16s", "error");
+}
+
+static void psr_cat_print_one_domain_cbm(uint32_t domid, uint32_t socketid,
+                                         bool cdp_enabled)
+{
+    char *domain_name;
+
     domain_name = libxl_domid_to_name(ctx, domid);
     printf("%5d%25s", domid, domain_name);
     free(domain_name);
 
-    if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_CBM,
-                               socketid, &cbm))
-         printf("%#16"PRIx64, cbm);
+    if (!cdp_enabled) {
+        psr_cat_print_one_domain_cbm_type(domid, socketid,
+                                          LIBXL_PSR_CBM_TYPE_L3_CBM);
+    } else {
+        psr_cat_print_one_domain_cbm_type(domid, socketid,
+                                          LIBXL_PSR_CBM_TYPE_L3_CBM_CODE);
+        psr_cat_print_one_domain_cbm_type(domid, socketid,
+                                          LIBXL_PSR_CBM_TYPE_L3_CBM_DATA);
+    }
 
     printf("\n");
 }
 
-static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid)
+static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid,
+                                    bool cdp_enabled)
 {
     int i, nr_domains;
     libxl_dominfo *list;
 
     if (domid != INVALID_DOMID) {
-        psr_cat_print_one_domain_cbm(domid, socketid);
+        psr_cat_print_one_domain_cbm(domid, socketid, cdp_enabled);
         return 0;
     }
 
@@ -8477,7 +8497,7 @@ static int psr_cat_print_domain_cbm(uint32_t domid, uint32_t socketid)
     }
 
     for (i = 0; i < nr_domains; i++)
-        psr_cat_print_one_domain_cbm(list[i].domid, socketid);
+        psr_cat_print_one_domain_cbm(list[i].domid, socketid, cdp_enabled);
     libxl_dominfo_list_free(list, nr_domains);
 
     return 0;
@@ -8498,9 +8518,12 @@ static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info)
     printf("%-16s: %u\n", "Socket ID", info->id);
     printf("%-16s: %uKB\n", "L3 Cache", l3_cache_size);
     printf("%-16s: %#llx\n", "Default CBM", (1ull << info->cbm_len) - 1);
-    printf("%5s%25s%16s\n", "ID", "NAME", "CBM");
+    if (info->cdp_enabled)
+        printf("%5s%25s%16s%16s\n", "ID", "NAME", "CBM (code)", "CBM (data)");
+    else
+        printf("%5s%25s%16s\n", "ID", "NAME", "CBM");
 
-    return psr_cat_print_domain_cbm(domid, info->id);
+    return psr_cat_print_domain_cbm(domid, info->id, info->cdp_enabled);
 }
 
 static int psr_cat_show(uint32_t domid)
@@ -8529,9 +8552,10 @@ out:
 int main_psr_cat_cbm_set(int argc, char **argv)
 {
     uint32_t domid;
-    libxl_psr_cbm_type type = LIBXL_PSR_CBM_TYPE_L3_CBM;
+    libxl_psr_cbm_type type;
     uint64_t cbm;
     int ret, opt = 0;
+    int opt_data = 0, opt_code = 0;
     libxl_bitmap target_map;
     char *value;
     libxl_string_list socket_list;
@@ -8540,13 +8564,15 @@ int main_psr_cat_cbm_set(int argc, char **argv)
 
     static struct option opts[] = {
         {"socket", 1, 0, 's'},
+        {"data", 0, 0, 'd'},
+        {"code", 0, 0, 'c'},
         COMMON_LONG_OPTS
     };
 
     libxl_socket_bitmap_alloc(ctx, &target_map, 0);
     libxl_bitmap_set_none(&target_map);
 
-    SWITCH_FOREACH_OPT(opt, "s:", opts, "psr-cat-cbm-set", 2) {
+    SWITCH_FOREACH_OPT(opt, "s:cd", opts, "psr-cat-cbm-set", 2) {
     case 's':
         trim(isspace, optarg, &value);
         split_string_into_string_list(value, ",", &socket_list);
@@ -8560,6 +8586,23 @@ int main_psr_cat_cbm_set(int argc, char **argv)
         libxl_string_list_dispose(&socket_list);
         free(value);
         break;
+    case 'd':
+        opt_data = 1;
+        break;
+    case 'c':
+        opt_code = 1;
+        break;
+    }
+
+    if (opt_data && opt_code) {
+        fprintf(stderr, "Cannot handle -c and -d at the same time\n");
+        return -1;
+    } else if (opt_data) {
+        type = LIBXL_PSR_CBM_TYPE_L3_CBM_DATA;
+    } else if (opt_code) {
+        type = LIBXL_PSR_CBM_TYPE_L3_CBM_CODE;
+    } else {
+        type = LIBXL_PSR_CBM_TYPE_L3_CBM;
     }
 
     if (libxl_bitmap_is_empty(&target_map))
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 0071f12..fdc1ac6 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -543,6 +543,8 @@ struct cmd_spec cmd_table[] = {
       "Set cache capacity bitmasks(CBM) for a domain",
       "[options] <Domain> <CBM>",
       "-s <socket>       Specify the socket to process, otherwise all sockets are processed\n"
+      "-c                Set code CBM if CDP is supported\n"
+      "-d                Set data CBM if CDP is supported\n"
     },
     { "psr-cat-show",
       &main_psr_cat_show, 0, 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 Oct 29 10:12:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12: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 1ZrkBf-0001aX-7I; Thu, 29 Oct 2015 10:12: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 1ZrkBd-0001a4-PT
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:02 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	41/CF-26043-0F0F1365; Thu, 29 Oct 2015 10:12:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446113518!43773695!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2095 invoked from network); 29 Oct 2015 10:11:59 -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;
	29 Oct 2015 10:11:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBa-0004Zr-AS
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBa-000561-7W
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:58 +0000
Date: Thu, 29 Oct 2015 10:11:58 +0000
Message-Id: <E1ZrkBa-000561-7W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove superpages option for pv
	domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b3c6b13e0c085ceb53210f8e682a073096b94fa
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Oct 8 17:23:47 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:18:12 2015 +0100

    libxc: remove superpages option for pv domains
    
    The pv domain builder currently supports the additional flag
    "superpages" to build a pv domain with 2MB pages. This feature isn't
    being used by any component other than the python xc bindings.
    
    Remove the flag and its support from the xc bindings and the domain
    builder
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/libxc/include/xc_dom.h      |    1 -
 tools/libxc/xc_dom_x86.c          |  273 ++++++++++++++++---------------------
 tools/python/xen/lowlevel/xc/xc.c |   10 +-
 3 files changed, 119 insertions(+), 165 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 7cb6b0c..ccc5926 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -157,7 +157,6 @@ struct xc_dom_image {
 
     xc_interface *xch;
     domid_t guest_domid;
-    int8_t superpages;
     int claim_enabled; /* 0 by default, 1 enables it */
     int shadow_enabled;
 
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 4c4182f..ed43c28 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -1043,181 +1043,140 @@ static int meminit_pv(struct xc_dom_image *dom)
             return rc;
     }
 
-    if ( dom->superpages )
+    /* try to claim pages for early warning of insufficient memory avail */
+    if ( dom->claim_enabled )
     {
-        int count = dom->total_pages >> SUPERPAGE_2MB_SHIFT;
-        xen_pfn_t extents[count];
-
-        dom->p2m_size = dom->total_pages;
-        dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
-                                      dom->p2m_size);
-        if ( dom->p2m_host == NULL )
-            return -EINVAL;
-
-        DOMPRINTF("Populating memory with %d superpages", count);
-        for ( pfn = 0; pfn < count; pfn++ )
-            extents[pfn] = pfn << SUPERPAGE_2MB_SHIFT;
-        rc = xc_domain_populate_physmap_exact(dom->xch, dom->guest_domid,
-                                               count, SUPERPAGE_2MB_SHIFT, 0,
-                                               extents);
+        rc = xc_domain_claim_pages(dom->xch, dom->guest_domid,
+                                   dom->total_pages);
         if ( rc )
             return rc;
+    }
 
-        /* Expand the returned mfn into the p2m array */
-        pfn = 0;
-        for ( i = 0; i < count; i++ )
-        {
-            mfn = extents[i];
-            for ( j = 0; j < SUPERPAGE_2MB_NR_PFNS; j++, pfn++ )
-                dom->p2m_host[pfn] = mfn + j;
-        }
+    /* Setup dummy vNUMA information if it's not provided. Note
+     * that this is a valid state if libxl doesn't provide any
+     * vNUMA information.
+     *
+     * The dummy values make libxc allocate all pages from
+     * arbitrary physical nodes. This is the expected behaviour if
+     * no vNUMA configuration is provided to libxc.
+     *
+     * Note that the following hunk is just for the convenience of
+     * allocation code. No defaulting happens in libxc.
+     */
+    if ( dom->nr_vmemranges == 0 )
+    {
+        nr_vmemranges = 1;
+        vmemranges = dummy_vmemrange;
+        vmemranges[0].start = 0;
+        vmemranges[0].end   = (uint64_t)dom->total_pages << PAGE_SHIFT;
+        vmemranges[0].flags = 0;
+        vmemranges[0].nid   = 0;
+
+        nr_vnodes = 1;
+        vnode_to_pnode = dummy_vnode_to_pnode;
+        vnode_to_pnode[0] = XC_NUMA_NO_NODE;
     }
     else
     {
-        /* try to claim pages for early warning of insufficient memory avail */
-        if ( dom->claim_enabled ) {
-            rc = xc_domain_claim_pages(dom->xch, dom->guest_domid,
-                                       dom->total_pages);
-            if ( rc )
-                return rc;
-        }
+        nr_vmemranges = dom->nr_vmemranges;
+        nr_vnodes = dom->nr_vnodes;
+        vmemranges = dom->vmemranges;
+        vnode_to_pnode = dom->vnode_to_pnode;
+    }
 
-        /* Setup dummy vNUMA information if it's not provided. Note
-         * that this is a valid state if libxl doesn't provide any
-         * vNUMA information.
-         *
-         * The dummy values make libxc allocate all pages from
-         * arbitrary physical nodes. This is the expected behaviour if
-         * no vNUMA configuration is provided to libxc.
-         *
-         * Note that the following hunk is just for the convenience of
-         * allocation code. No defaulting happens in libxc.
-         */
-        if ( dom->nr_vmemranges == 0 )
-        {
-            nr_vmemranges = 1;
-            vmemranges = dummy_vmemrange;
-            vmemranges[0].start = 0;
-            vmemranges[0].end   = (uint64_t)dom->total_pages << PAGE_SHIFT;
-            vmemranges[0].flags = 0;
-            vmemranges[0].nid   = 0;
-
-            nr_vnodes = 1;
-            vnode_to_pnode = dummy_vnode_to_pnode;
-            vnode_to_pnode[0] = XC_NUMA_NO_NODE;
-        }
-        else
-        {
-            nr_vmemranges = dom->nr_vmemranges;
-            nr_vnodes = dom->nr_vnodes;
-            vmemranges = dom->vmemranges;
-            vnode_to_pnode = dom->vnode_to_pnode;
-        }
+    total = dom->p2m_size = 0;
+    for ( i = 0; i < nr_vmemranges; i++ )
+    {
+        total += ((vmemranges[i].end - vmemranges[i].start) >> PAGE_SHIFT);
+        dom->p2m_size = max(dom->p2m_size,
+                            (xen_pfn_t)(vmemranges[i].end >> PAGE_SHIFT));
+    }
+    if ( total != dom->total_pages )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: vNUMA page count mismatch (0x%"PRIpfn" != 0x%"PRIpfn")",
+                     __func__, total, dom->total_pages);
+        return -EINVAL;
+    }
 
-        total = dom->p2m_size = 0;
-        for ( i = 0; i < nr_vmemranges; i++ )
-        {
-            total += ((vmemranges[i].end - vmemranges[i].start)
-                      >> PAGE_SHIFT);
-            dom->p2m_size =
-                dom->p2m_size > (vmemranges[i].end >> PAGE_SHIFT) ?
-                dom->p2m_size : (vmemranges[i].end >> PAGE_SHIFT);
-        }
-        if ( total != dom->total_pages )
-        {
-            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                         "%s: vNUMA page count mismatch (0x%"PRIpfn" != 0x%"PRIpfn")",
-                         __func__, total, dom->total_pages);
-            return -EINVAL;
-        }
+    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->p2m_size);
+    if ( dom->p2m_host == NULL )
+        return -EINVAL;
+    for ( pfn = 0; pfn < dom->p2m_size; pfn++ )
+        dom->p2m_host[pfn] = INVALID_P2M_ENTRY;
 
-        dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
-                                      dom->p2m_size);
-        if ( dom->p2m_host == NULL )
-            return -EINVAL;
-        for ( pfn = 0; pfn < dom->p2m_size; pfn++ )
-            dom->p2m_host[pfn] = INVALID_P2M_ENTRY;
+    /* allocate guest memory */
+    for ( i = 0; i < nr_vmemranges; i++ )
+    {
+        unsigned int memflags;
+        uint64_t pages, super_pages;
+        unsigned int pnode = vnode_to_pnode[vmemranges[i].nid];
+        xen_pfn_t extents[SUPERPAGE_BATCH_SIZE];
+        xen_pfn_t pfn_base_idx;
 
-        /* allocate guest memory */
-        for ( i = 0; i < nr_vmemranges; i++ )
-        {
-            unsigned int memflags;
-            uint64_t pages, super_pages;
-            unsigned int pnode = vnode_to_pnode[vmemranges[i].nid];
-            xen_pfn_t extents[SUPERPAGE_BATCH_SIZE];
-            xen_pfn_t pfn_base_idx;
-
-            memflags = 0;
-            if ( pnode != XC_NUMA_NO_NODE )
-                memflags |= XENMEMF_exact_node(pnode);
-
-            pages = (vmemranges[i].end - vmemranges[i].start)
-                >> PAGE_SHIFT;
-            super_pages = pages >> SUPERPAGE_2MB_SHIFT;
-            pfn_base = vmemranges[i].start >> PAGE_SHIFT;
-
-            for ( pfn = pfn_base; pfn < pfn_base+pages; pfn++ )
-                dom->p2m_host[pfn] = pfn;
-
-            pfn_base_idx = pfn_base;
-            while (super_pages) {
-                uint64_t count =
-                    min_t(uint64_t, super_pages,SUPERPAGE_BATCH_SIZE);
-                super_pages -= count;
-
-                for ( pfn = pfn_base_idx, j = 0;
-                      pfn < pfn_base_idx + (count << SUPERPAGE_2MB_SHIFT);
-                      pfn += SUPERPAGE_2MB_NR_PFNS, j++ )
-                    extents[j] = dom->p2m_host[pfn];
-                rc = xc_domain_populate_physmap(dom->xch, dom->guest_domid, count,
-                                                SUPERPAGE_2MB_SHIFT, memflags,
-                                                extents);
-                if ( rc < 0 )
-                    return rc;
-
-                /* Expand the returned mfns into the p2m array. */
-                pfn = pfn_base_idx;
-                for ( j = 0; j < rc; j++ )
-                {
-                    mfn = extents[j];
-                    for ( k = 0; k < SUPERPAGE_2MB_NR_PFNS; k++, pfn++ )
-                        dom->p2m_host[pfn] = mfn + k;
-                }
-                pfn_base_idx = pfn;
-            }
+        memflags = 0;
+        if ( pnode != XC_NUMA_NO_NODE )
+            memflags |= XENMEMF_exact_node(pnode);
 
-            for ( j = pfn_base_idx - pfn_base; j < pages; j += allocsz )
-            {
-                allocsz = pages - j;
-                if ( allocsz > 1024*1024 )
-                    allocsz = 1024*1024;
+        pages = (vmemranges[i].end - vmemranges[i].start) >> PAGE_SHIFT;
+        super_pages = pages >> SUPERPAGE_2MB_SHIFT;
+        pfn_base = vmemranges[i].start >> PAGE_SHIFT;
 
-                rc = xc_domain_populate_physmap_exact(dom->xch,
-                         dom->guest_domid, allocsz, 0, memflags,
-                         &dom->p2m_host[pfn_base+j]);
+        for ( pfn = pfn_base; pfn < pfn_base+pages; pfn++ )
+            dom->p2m_host[pfn] = pfn;
 
-                if ( rc )
-                {
-                    if ( pnode != XC_NUMA_NO_NODE )
-                        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                                     "%s: failed to allocate 0x%"PRIx64" pages (v=%d, p=%d)",
-                                     __func__, pages, i, pnode);
-                    else
-                        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                                     "%s: failed to allocate 0x%"PRIx64" pages",
-                                     __func__, pages);
-                    return rc;
-                }
+        pfn_base_idx = pfn_base;
+        while ( super_pages ) {
+            uint64_t count = min_t(uint64_t, super_pages, SUPERPAGE_BATCH_SIZE);
+            super_pages -= count;
+
+            for ( pfn = pfn_base_idx, j = 0;
+                  pfn < pfn_base_idx + (count << SUPERPAGE_2MB_SHIFT);
+                  pfn += SUPERPAGE_2MB_NR_PFNS, j++ )
+                extents[j] = dom->p2m_host[pfn];
+            rc = xc_domain_populate_physmap(dom->xch, dom->guest_domid, count,
+                                            SUPERPAGE_2MB_SHIFT, memflags,
+                                            extents);
+            if ( rc < 0 )
+                return rc;
+
+            /* Expand the returned mfns into the p2m array. */
+            pfn = pfn_base_idx;
+            for ( j = 0; j < rc; j++ )
+            {
+                mfn = extents[j];
+                for ( k = 0; k < SUPERPAGE_2MB_NR_PFNS; k++, pfn++ )
+                    dom->p2m_host[pfn] = mfn + k;
             }
-            rc = 0;
+            pfn_base_idx = pfn;
         }
 
-        /* Ensure no unclaimed pages are left unused.
-         * OK to call if hadn't done the earlier claim call. */
-        (void)xc_domain_claim_pages(dom->xch, dom->guest_domid,
-                                    0 /* cancels the claim */);
+        for ( j = pfn_base_idx - pfn_base; j < pages; j += allocsz )
+        {
+            allocsz = min_t(uint64_t, 1024 * 1024, pages - j);
+            rc = xc_domain_populate_physmap_exact(dom->xch, dom->guest_domid,
+                     allocsz, 0, memflags, &dom->p2m_host[pfn_base + j]);
+
+            if ( rc )
+            {
+                if ( pnode != XC_NUMA_NO_NODE )
+                    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                                 "%s: failed to allocate 0x%"PRIx64" pages (v=%d, p=%d)",
+                                 __func__, pages, i, pnode);
+                else
+                    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                                 "%s: failed to allocate 0x%"PRIx64" pages",
+                                 __func__, pages);
+                return rc;
+            }
+        }
+        rc = 0;
     }
 
+    /* Ensure no unclaimed pages are left unused.
+     * OK to call if hadn't done the earlier claim call. */
+    xc_domain_claim_pages(dom->xch, dom->guest_domid, 0 /* cancel claim */);
+
     return rc;
 }
 
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index b441777..26290a3 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -463,7 +463,6 @@ static PyObject *pyxc_linux_build(XcObject *self,
     char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
     int flags = 0;
     int store_evtchn, console_evtchn;
-    int superpages = 0;
     unsigned int mem_mb;
     unsigned long store_mfn = 0;
     unsigned long console_mfn = 0;
@@ -476,22 +475,19 @@ static PyObject *pyxc_linux_build(XcObject *self,
                                 "console_evtchn", "image",
                                 /* optional */
                                 "ramdisk", "cmdline", "flags",
-                                "features", "superpages", NULL };
+                                "features", NULL };
 
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssisi", kwd_list,
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis", kwd_list,
                                       &domid, &store_evtchn, &mem_mb,
                                       &console_evtchn, &image,
                                       /* optional */
-                                      &ramdisk, &cmdline, &flags,
-                                      &features, &superpages) )
+                                      &ramdisk, &cmdline, &flags, &features) )
         return NULL;
 
     xc_dom_loginit(self->xc_handle);
     if (!(dom = xc_dom_allocate(self->xc_handle, cmdline, features)))
         return pyxc_error_to_exception(self->xc_handle);
 
-    dom->superpages = superpages;
-
     if ( xc_dom_linux_build(self->xc_handle, dom, domid, mem_mb, image,
                             ramdisk, flags, store_evtchn, &store_mfn,
                             console_evtchn, &console_mfn) != 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 Oct 29 10:12:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12: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 1ZrkBf-0001aX-7I; Thu, 29 Oct 2015 10:12: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 1ZrkBd-0001a4-PT
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:02 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	41/CF-26043-0F0F1365; Thu, 29 Oct 2015 10:12:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446113518!43773695!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2095 invoked from network); 29 Oct 2015 10:11:59 -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;
	29 Oct 2015 10:11:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBa-0004Zr-AS
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBa-000561-7W
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:11:58 +0000
Date: Thu, 29 Oct 2015 10:11:58 +0000
Message-Id: <E1ZrkBa-000561-7W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove superpages option for pv
	domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b3c6b13e0c085ceb53210f8e682a073096b94fa
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Oct 8 17:23:47 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:18:12 2015 +0100

    libxc: remove superpages option for pv domains
    
    The pv domain builder currently supports the additional flag
    "superpages" to build a pv domain with 2MB pages. This feature isn't
    being used by any component other than the python xc bindings.
    
    Remove the flag and its support from the xc bindings and the domain
    builder
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/libxc/include/xc_dom.h      |    1 -
 tools/libxc/xc_dom_x86.c          |  273 ++++++++++++++++---------------------
 tools/python/xen/lowlevel/xc/xc.c |   10 +-
 3 files changed, 119 insertions(+), 165 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 7cb6b0c..ccc5926 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -157,7 +157,6 @@ struct xc_dom_image {
 
     xc_interface *xch;
     domid_t guest_domid;
-    int8_t superpages;
     int claim_enabled; /* 0 by default, 1 enables it */
     int shadow_enabled;
 
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 4c4182f..ed43c28 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -1043,181 +1043,140 @@ static int meminit_pv(struct xc_dom_image *dom)
             return rc;
     }
 
-    if ( dom->superpages )
+    /* try to claim pages for early warning of insufficient memory avail */
+    if ( dom->claim_enabled )
     {
-        int count = dom->total_pages >> SUPERPAGE_2MB_SHIFT;
-        xen_pfn_t extents[count];
-
-        dom->p2m_size = dom->total_pages;
-        dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
-                                      dom->p2m_size);
-        if ( dom->p2m_host == NULL )
-            return -EINVAL;
-
-        DOMPRINTF("Populating memory with %d superpages", count);
-        for ( pfn = 0; pfn < count; pfn++ )
-            extents[pfn] = pfn << SUPERPAGE_2MB_SHIFT;
-        rc = xc_domain_populate_physmap_exact(dom->xch, dom->guest_domid,
-                                               count, SUPERPAGE_2MB_SHIFT, 0,
-                                               extents);
+        rc = xc_domain_claim_pages(dom->xch, dom->guest_domid,
+                                   dom->total_pages);
         if ( rc )
             return rc;
+    }
 
-        /* Expand the returned mfn into the p2m array */
-        pfn = 0;
-        for ( i = 0; i < count; i++ )
-        {
-            mfn = extents[i];
-            for ( j = 0; j < SUPERPAGE_2MB_NR_PFNS; j++, pfn++ )
-                dom->p2m_host[pfn] = mfn + j;
-        }
+    /* Setup dummy vNUMA information if it's not provided. Note
+     * that this is a valid state if libxl doesn't provide any
+     * vNUMA information.
+     *
+     * The dummy values make libxc allocate all pages from
+     * arbitrary physical nodes. This is the expected behaviour if
+     * no vNUMA configuration is provided to libxc.
+     *
+     * Note that the following hunk is just for the convenience of
+     * allocation code. No defaulting happens in libxc.
+     */
+    if ( dom->nr_vmemranges == 0 )
+    {
+        nr_vmemranges = 1;
+        vmemranges = dummy_vmemrange;
+        vmemranges[0].start = 0;
+        vmemranges[0].end   = (uint64_t)dom->total_pages << PAGE_SHIFT;
+        vmemranges[0].flags = 0;
+        vmemranges[0].nid   = 0;
+
+        nr_vnodes = 1;
+        vnode_to_pnode = dummy_vnode_to_pnode;
+        vnode_to_pnode[0] = XC_NUMA_NO_NODE;
     }
     else
     {
-        /* try to claim pages for early warning of insufficient memory avail */
-        if ( dom->claim_enabled ) {
-            rc = xc_domain_claim_pages(dom->xch, dom->guest_domid,
-                                       dom->total_pages);
-            if ( rc )
-                return rc;
-        }
+        nr_vmemranges = dom->nr_vmemranges;
+        nr_vnodes = dom->nr_vnodes;
+        vmemranges = dom->vmemranges;
+        vnode_to_pnode = dom->vnode_to_pnode;
+    }
 
-        /* Setup dummy vNUMA information if it's not provided. Note
-         * that this is a valid state if libxl doesn't provide any
-         * vNUMA information.
-         *
-         * The dummy values make libxc allocate all pages from
-         * arbitrary physical nodes. This is the expected behaviour if
-         * no vNUMA configuration is provided to libxc.
-         *
-         * Note that the following hunk is just for the convenience of
-         * allocation code. No defaulting happens in libxc.
-         */
-        if ( dom->nr_vmemranges == 0 )
-        {
-            nr_vmemranges = 1;
-            vmemranges = dummy_vmemrange;
-            vmemranges[0].start = 0;
-            vmemranges[0].end   = (uint64_t)dom->total_pages << PAGE_SHIFT;
-            vmemranges[0].flags = 0;
-            vmemranges[0].nid   = 0;
-
-            nr_vnodes = 1;
-            vnode_to_pnode = dummy_vnode_to_pnode;
-            vnode_to_pnode[0] = XC_NUMA_NO_NODE;
-        }
-        else
-        {
-            nr_vmemranges = dom->nr_vmemranges;
-            nr_vnodes = dom->nr_vnodes;
-            vmemranges = dom->vmemranges;
-            vnode_to_pnode = dom->vnode_to_pnode;
-        }
+    total = dom->p2m_size = 0;
+    for ( i = 0; i < nr_vmemranges; i++ )
+    {
+        total += ((vmemranges[i].end - vmemranges[i].start) >> PAGE_SHIFT);
+        dom->p2m_size = max(dom->p2m_size,
+                            (xen_pfn_t)(vmemranges[i].end >> PAGE_SHIFT));
+    }
+    if ( total != dom->total_pages )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: vNUMA page count mismatch (0x%"PRIpfn" != 0x%"PRIpfn")",
+                     __func__, total, dom->total_pages);
+        return -EINVAL;
+    }
 
-        total = dom->p2m_size = 0;
-        for ( i = 0; i < nr_vmemranges; i++ )
-        {
-            total += ((vmemranges[i].end - vmemranges[i].start)
-                      >> PAGE_SHIFT);
-            dom->p2m_size =
-                dom->p2m_size > (vmemranges[i].end >> PAGE_SHIFT) ?
-                dom->p2m_size : (vmemranges[i].end >> PAGE_SHIFT);
-        }
-        if ( total != dom->total_pages )
-        {
-            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                         "%s: vNUMA page count mismatch (0x%"PRIpfn" != 0x%"PRIpfn")",
-                         __func__, total, dom->total_pages);
-            return -EINVAL;
-        }
+    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->p2m_size);
+    if ( dom->p2m_host == NULL )
+        return -EINVAL;
+    for ( pfn = 0; pfn < dom->p2m_size; pfn++ )
+        dom->p2m_host[pfn] = INVALID_P2M_ENTRY;
 
-        dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
-                                      dom->p2m_size);
-        if ( dom->p2m_host == NULL )
-            return -EINVAL;
-        for ( pfn = 0; pfn < dom->p2m_size; pfn++ )
-            dom->p2m_host[pfn] = INVALID_P2M_ENTRY;
+    /* allocate guest memory */
+    for ( i = 0; i < nr_vmemranges; i++ )
+    {
+        unsigned int memflags;
+        uint64_t pages, super_pages;
+        unsigned int pnode = vnode_to_pnode[vmemranges[i].nid];
+        xen_pfn_t extents[SUPERPAGE_BATCH_SIZE];
+        xen_pfn_t pfn_base_idx;
 
-        /* allocate guest memory */
-        for ( i = 0; i < nr_vmemranges; i++ )
-        {
-            unsigned int memflags;
-            uint64_t pages, super_pages;
-            unsigned int pnode = vnode_to_pnode[vmemranges[i].nid];
-            xen_pfn_t extents[SUPERPAGE_BATCH_SIZE];
-            xen_pfn_t pfn_base_idx;
-
-            memflags = 0;
-            if ( pnode != XC_NUMA_NO_NODE )
-                memflags |= XENMEMF_exact_node(pnode);
-
-            pages = (vmemranges[i].end - vmemranges[i].start)
-                >> PAGE_SHIFT;
-            super_pages = pages >> SUPERPAGE_2MB_SHIFT;
-            pfn_base = vmemranges[i].start >> PAGE_SHIFT;
-
-            for ( pfn = pfn_base; pfn < pfn_base+pages; pfn++ )
-                dom->p2m_host[pfn] = pfn;
-
-            pfn_base_idx = pfn_base;
-            while (super_pages) {
-                uint64_t count =
-                    min_t(uint64_t, super_pages,SUPERPAGE_BATCH_SIZE);
-                super_pages -= count;
-
-                for ( pfn = pfn_base_idx, j = 0;
-                      pfn < pfn_base_idx + (count << SUPERPAGE_2MB_SHIFT);
-                      pfn += SUPERPAGE_2MB_NR_PFNS, j++ )
-                    extents[j] = dom->p2m_host[pfn];
-                rc = xc_domain_populate_physmap(dom->xch, dom->guest_domid, count,
-                                                SUPERPAGE_2MB_SHIFT, memflags,
-                                                extents);
-                if ( rc < 0 )
-                    return rc;
-
-                /* Expand the returned mfns into the p2m array. */
-                pfn = pfn_base_idx;
-                for ( j = 0; j < rc; j++ )
-                {
-                    mfn = extents[j];
-                    for ( k = 0; k < SUPERPAGE_2MB_NR_PFNS; k++, pfn++ )
-                        dom->p2m_host[pfn] = mfn + k;
-                }
-                pfn_base_idx = pfn;
-            }
+        memflags = 0;
+        if ( pnode != XC_NUMA_NO_NODE )
+            memflags |= XENMEMF_exact_node(pnode);
 
-            for ( j = pfn_base_idx - pfn_base; j < pages; j += allocsz )
-            {
-                allocsz = pages - j;
-                if ( allocsz > 1024*1024 )
-                    allocsz = 1024*1024;
+        pages = (vmemranges[i].end - vmemranges[i].start) >> PAGE_SHIFT;
+        super_pages = pages >> SUPERPAGE_2MB_SHIFT;
+        pfn_base = vmemranges[i].start >> PAGE_SHIFT;
 
-                rc = xc_domain_populate_physmap_exact(dom->xch,
-                         dom->guest_domid, allocsz, 0, memflags,
-                         &dom->p2m_host[pfn_base+j]);
+        for ( pfn = pfn_base; pfn < pfn_base+pages; pfn++ )
+            dom->p2m_host[pfn] = pfn;
 
-                if ( rc )
-                {
-                    if ( pnode != XC_NUMA_NO_NODE )
-                        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                                     "%s: failed to allocate 0x%"PRIx64" pages (v=%d, p=%d)",
-                                     __func__, pages, i, pnode);
-                    else
-                        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                                     "%s: failed to allocate 0x%"PRIx64" pages",
-                                     __func__, pages);
-                    return rc;
-                }
+        pfn_base_idx = pfn_base;
+        while ( super_pages ) {
+            uint64_t count = min_t(uint64_t, super_pages, SUPERPAGE_BATCH_SIZE);
+            super_pages -= count;
+
+            for ( pfn = pfn_base_idx, j = 0;
+                  pfn < pfn_base_idx + (count << SUPERPAGE_2MB_SHIFT);
+                  pfn += SUPERPAGE_2MB_NR_PFNS, j++ )
+                extents[j] = dom->p2m_host[pfn];
+            rc = xc_domain_populate_physmap(dom->xch, dom->guest_domid, count,
+                                            SUPERPAGE_2MB_SHIFT, memflags,
+                                            extents);
+            if ( rc < 0 )
+                return rc;
+
+            /* Expand the returned mfns into the p2m array. */
+            pfn = pfn_base_idx;
+            for ( j = 0; j < rc; j++ )
+            {
+                mfn = extents[j];
+                for ( k = 0; k < SUPERPAGE_2MB_NR_PFNS; k++, pfn++ )
+                    dom->p2m_host[pfn] = mfn + k;
             }
-            rc = 0;
+            pfn_base_idx = pfn;
         }
 
-        /* Ensure no unclaimed pages are left unused.
-         * OK to call if hadn't done the earlier claim call. */
-        (void)xc_domain_claim_pages(dom->xch, dom->guest_domid,
-                                    0 /* cancels the claim */);
+        for ( j = pfn_base_idx - pfn_base; j < pages; j += allocsz )
+        {
+            allocsz = min_t(uint64_t, 1024 * 1024, pages - j);
+            rc = xc_domain_populate_physmap_exact(dom->xch, dom->guest_domid,
+                     allocsz, 0, memflags, &dom->p2m_host[pfn_base + j]);
+
+            if ( rc )
+            {
+                if ( pnode != XC_NUMA_NO_NODE )
+                    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                                 "%s: failed to allocate 0x%"PRIx64" pages (v=%d, p=%d)",
+                                 __func__, pages, i, pnode);
+                else
+                    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                                 "%s: failed to allocate 0x%"PRIx64" pages",
+                                 __func__, pages);
+                return rc;
+            }
+        }
+        rc = 0;
     }
 
+    /* Ensure no unclaimed pages are left unused.
+     * OK to call if hadn't done the earlier claim call. */
+    xc_domain_claim_pages(dom->xch, dom->guest_domid, 0 /* cancel claim */);
+
     return rc;
 }
 
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index b441777..26290a3 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -463,7 +463,6 @@ static PyObject *pyxc_linux_build(XcObject *self,
     char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
     int flags = 0;
     int store_evtchn, console_evtchn;
-    int superpages = 0;
     unsigned int mem_mb;
     unsigned long store_mfn = 0;
     unsigned long console_mfn = 0;
@@ -476,22 +475,19 @@ static PyObject *pyxc_linux_build(XcObject *self,
                                 "console_evtchn", "image",
                                 /* optional */
                                 "ramdisk", "cmdline", "flags",
-                                "features", "superpages", NULL };
+                                "features", NULL };
 
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssisi", kwd_list,
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis", kwd_list,
                                       &domid, &store_evtchn, &mem_mb,
                                       &console_evtchn, &image,
                                       /* optional */
-                                      &ramdisk, &cmdline, &flags,
-                                      &features, &superpages) )
+                                      &ramdisk, &cmdline, &flags, &features) )
         return NULL;
 
     xc_dom_loginit(self->xc_handle);
     if (!(dom = xc_dom_allocate(self->xc_handle, cmdline, features)))
         return pyxc_error_to_exception(self->xc_handle);
 
-    dom->superpages = superpages;
-
     if ( xc_dom_linux_build(self->xc_handle, dom, domid, mem_mb, image,
                             ramdisk, flags, store_evtchn, &store_mfn,
                             console_evtchn, &console_mfn) != 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 Oct 29 10:12:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12: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 1ZrkBo-0001dj-OL; Thu, 29 Oct 2015 10:12:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBn-0001d2-5H
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:11 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	B4/B4-30270-AF0F1365; Thu, 29 Oct 2015 10:12:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446113528!40648161!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21831 invoked from network); 29 Oct 2015 10:12:09 -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 Oct 2015 10:12:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBk-0004aN-O0
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBk-00057L-IF
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:08 +0000
Date: Thu, 29 Oct 2015 10:12:08 +0000
Message-Id: <E1ZrkBk-00057L-IF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/device-tree: Print the DT path on
	error in dt_for_each_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 01a8a8126d02b81bac4fe81541be0cccefc8a4c8
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 19 13:58:00 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:19:29 2015 +0100

    xen/device-tree: Print the DT path on error in dt_for_each_range
    
    With the current log is not possible for the user to understand
    properly the error:
    
    (XEN) Grant table range: 0x0000007fc00000-0x0000007fc72000
    (XEN) DT: no ranges; cannot enumerate
    (XEN) Device tree generation failed (-22).
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Could not set up DOM0 guest OS
    (XEN) ****************************************
    (XEN)
    
    The other error message within the function already print the DT path.
    Do the same here.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
 xen/common/device_tree.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 87c3f71..0ed86a7 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -880,7 +880,8 @@ int dt_for_each_range(const struct dt_device_node *dev,
     ranges = dt_get_property(dev, "ranges", &rlen);
     if ( ranges == NULL )
     {
-        printk(XENLOG_ERR "DT: no ranges; cannot enumerate\n");
+        printk(XENLOG_ERR "DT: no ranges; cannot enumerate %s\n",
+               dev->full_name);
         return -EINVAL;
     }
     if ( rlen == 0 ) /* Nothing to do */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:12:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12: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 1ZrkBo-0001dj-OL; Thu, 29 Oct 2015 10:12:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBn-0001d2-5H
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:11 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	B4/B4-30270-AF0F1365; Thu, 29 Oct 2015 10:12:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446113528!40648161!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21831 invoked from network); 29 Oct 2015 10:12:09 -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 Oct 2015 10:12:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBk-0004aN-O0
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBk-00057L-IF
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:08 +0000
Date: Thu, 29 Oct 2015 10:12:08 +0000
Message-Id: <E1ZrkBk-00057L-IF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/device-tree: Print the DT path on
	error in dt_for_each_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 01a8a8126d02b81bac4fe81541be0cccefc8a4c8
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 19 13:58:00 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 22 16:19:29 2015 +0100

    xen/device-tree: Print the DT path on error in dt_for_each_range
    
    With the current log is not possible for the user to understand
    properly the error:
    
    (XEN) Grant table range: 0x0000007fc00000-0x0000007fc72000
    (XEN) DT: no ranges; cannot enumerate
    (XEN) Device tree generation failed (-22).
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Could not set up DOM0 guest OS
    (XEN) ****************************************
    (XEN)
    
    The other error message within the function already print the DT path.
    Do the same here.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
 xen/common/device_tree.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 87c3f71..0ed86a7 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -880,7 +880,8 @@ int dt_for_each_range(const struct dt_device_node *dev,
     ranges = dt_get_property(dev, "ranges", &rlen);
     if ( ranges == NULL )
     {
-        printk(XENLOG_ERR "DT: no ranges; cannot enumerate\n");
+        printk(XENLOG_ERR "DT: no ranges; cannot enumerate %s\n",
+               dev->full_name);
         return -EINVAL;
     }
     if ( rlen == 0 ) /* Nothing to do */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:12:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12: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 1ZrkC1-0001gf-RE; Thu, 29 Oct 2015 10:12:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBz-0001g7-H6
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:23 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	52/C2-03763-601F1365; Thu, 29 Oct 2015 10:12:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1446113539!21012655!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31029 invoked from network); 29 Oct 2015 10:12: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;
	29 Oct 2015 10:12:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBv-0004aZ-23
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBu-00057u-VZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:19 +0000
Date: Thu, 29 Oct 2015 10:12:18 +0000
Message-Id: <E1ZrkBu-00057u-VZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/python: remove broken xl binding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 598e97fdd0b5af28807ec262b8285eff236abdb4
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 6 17:57:26 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:16:27 2015 +0100

    tools/python: remove broken xl binding
    
    Various people say this binding doesn't compile or doesn't work. Remove
    it for the benefit of xl feature development -- so that new features
    won't need to worry about making this broken binding happy.
    
    This isn't going to expose any user visible changes because that module
    is not built by default.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Zhigang Wang <zhigang.x.wang@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/python/setup.py             |    9 -
 tools/python/xen/lowlevel/xl/xl.c |  797 -------------------------------------
 2 files changed, 0 insertions(+), 806 deletions(-)

diff --git a/tools/python/setup.py b/tools/python/setup.py
index 5bf81be..fdba866 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -27,17 +27,8 @@ xs = Extension("xs",
                depends            = [ PATH_XENSTORE + "/libxenstore.so" ],
                sources            = [ "xen/lowlevel/xs/xs.c" ])
 
-xl = Extension("xl",
-               extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC + "/include", "xen/lowlevel/xl" ],
-               library_dirs       = [ PATH_LIBXL ],
-               libraries          = [ "xenlight" ],
-               depends            = [ PATH_LIBXL + "/libxenlight.so" ],
-               sources            = [ "xen/lowlevel/xl/xl.c", "xen/lowlevel/xl/_pyxl_types.c" ])
-
 plat = os.uname()[0]
 modules = [ xc, xs ]
-#modules.extend([ xl ])
 
 setup(name            = 'xen',
       version         = '3.0',
diff --git a/tools/python/xen/lowlevel/xl/xl.c b/tools/python/xen/lowlevel/xl/xl.c
deleted file mode 100644
index 9b33731..0000000
--- a/tools/python/xen/lowlevel/xl/xl.c
+++ /dev/null
@@ -1,797 +0,0 @@
-/******************************************************************************
- * xl.c
- *
- * Copyright (c) 2010 Citrix Ltd.
- * Author: Gianni Tedesco
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <Python.h>
-#include <stdio.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-#include <getopt.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-#include <inttypes.h>
-
-#include <libxl.h>
-#include <libxl_utils.h>
-#include <libxlutil.h>
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
-/* Needed for Python versions earlier than 2.3. */
-#ifndef PyMODINIT_FUNC
-#define PyMODINIT_FUNC DL_EXPORT(void)
-#endif
-
-#define CLS "ctx"
-
-#if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5)
-#define Py_ssize_t int
-#endif
-
-static PyObject *xl_error_obj;
-
-int genwrap__obj_init(PyObject *self, PyObject *args, PyObject *kwds)
-{
-    PyObject *key, *value;
-    Py_ssize_t pos = 0;
-
-    if ( NULL == kwds )
-        return 0;
-
-    while (PyDict_Next(kwds, &pos, &key, &value)) {
-        if ( PyObject_SetAttr(self, key, value) < 0 )
-            return -1;
-    }
-
-    return 0;
-}
-
-int genwrap__string_set(PyObject *v, char **str)
-{
-    char *tmp;
-    if ( NULL == v || Py_None == v ) {
-        free(*str);
-        *str = NULL;
-        return 0;
-    }
-    if ( !PyString_Check(v) ) {
-        PyErr_SetString(PyExc_TypeError, "Attribute expected string");
-        return -1;
-    }
-    tmp = strdup(PyString_AsString(v));
-    if ( NULL == tmp ) {
-        PyErr_SetString(PyExc_MemoryError, "Allocating string attribute");
-        return -1;
-    }
-    free(*str);
-    *str = tmp;
-    return 0;
-}
-
-PyObject *genwrap__string_get(char **str)
-{
-    if ( NULL == *str ) {
-        Py_INCREF(Py_None);
-        return Py_None;
-    }
-    return PyString_FromString(*str);
-}
-
-PyObject *genwrap__ull_get(unsigned long long val)
-{
-    return PyLong_FromUnsignedLongLong(val);
-}
-
-int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask)
-{
-    unsigned long long tmp;
-    if ( NULL == v ) {
-        *val = 0;
-        return 0;
-    }
-    if ( PyLong_Check(v) ) {
-        tmp = PyLong_AsUnsignedLongLong(v);
-    }else if ( PyInt_Check(v) ) {
-        tmp = (unsigned long long)PyInt_AsLong(v);
-    }else{
-        PyErr_SetString(PyExc_TypeError, "Attribute expected int or long");
-        return -1;
-    }
-    if ( tmp & ~mask ) {
-        PyErr_SetString(PyExc_ValueError, "Integer overflow");
-        return -1;
-    }
-    *val = tmp;
-    return 0;
-}
-
-PyObject *genwrap__ll_get(long long val)
-{
-    return PyLong_FromLongLong(val);
-}
-
-int genwrap__ll_set(PyObject *v, long long *val, long long mask)
-{
-    long long tmp;
-    if ( NULL == v ) {
-        *val = 0;
-        return 0;
-    }
-    if ( PyLong_Check(v) ) {
-        tmp = PyLong_AsLongLong(v);
-    }else{
-        tmp = (long long)PyInt_AsLong(v);
-    }
-    if ( tmp & ~mask ) {
-        PyErr_SetString(PyExc_ValueError, "Integer overflow");
-        return -1;
-    }
-    *val = tmp;
-    return 0;
-}
-
-PyObject *genwrap__defbool_get(libxl_defbool *db)
-{
-    PyObject *ret;
-    ret = libxl_defbool_val(*db) ? Py_True : Py_False;
-    Py_INCREF(ret);
-    return ret;
-}
-
-int genwrap__defbool_set(PyObject *v, libxl_defbool *db)
-{
-    bool val = !(NULL == v || Py_None == v || Py_False == v);
-    libxl_defbool_set(db, val);
-    return 0;
-}
-
-static int fixed_bytearray_set(PyObject *v, uint8_t *ptr, size_t len)
-{
-    char *tmp;
-    size_t sz;
-
-    if ( NULL == v ) {
-        memset(ptr, 0, len);
-        return 0;
-    }
-
-#ifdef PyByteArray_Check
-    if ( PyByteArray_Check(v) ) {
-        sz = PyByteArray_Size(v);
-        tmp = PyByteArray_AsString(v);
-    }else
-#endif
-    if ( PyString_Check(v) ) {
-        Py_ssize_t ssz;
-        if ( PyString_AsStringAndSize(v, &tmp, &ssz) )
-            return -1;
-        if ( ssz < 0 )
-            tmp = NULL;
-        sz = ssz;
-    }else{
-        PyErr_SetString(PyExc_TypeError, "Attribute expected bytearray or string");
-        return -1;
-    }
-
-    if ( NULL == tmp ) {
-        memset(ptr, 0, len);
-        return 0;
-    }
-    if ( sz != len ) {
-        PyErr_SetString(PyExc_ValueError,
-                        (sz < len) ? "Buffer underflow" : "Buffer overflow");
-        return -1;
-    }
-
-    memcpy(ptr, tmp, sz);
-    return 0;
-}
-
-static PyObject *fixed_bytearray_get(const uint8_t *ptr, size_t len)
-{
-#ifdef PyByteArray_Check
-    return PyByteArray_FromStringAndSize((const char *)ptr, len);
-#else
-    return PyString_FromStringAndSize((const char *)ptr, len);
-#endif
-}
-
-#include "_pyxl_types.h"
-
-int attrib__libxl_cpuid_policy_list_set(PyObject *v, libxl_cpuid_policy_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Setting cpuid_policy_list");
-    return -1;
-}
-
-int attrib__libxl_bitmap_set(PyObject *v, libxl_bitmap *pptr)
-{
-    int i;
-    long cpu;
-
-    for (i = 0; i < PyList_Size(v); i++) {
-        cpu = PyInt_AsLong(PyList_GetItem(v, i));
-        libxl_bitmap_set(pptr, cpu);
-    }
-    return 0;
-}
-
-int attrib__libxl_hwcap_set(PyObject *v, libxl_hwcap *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Setting hwcap");
-    return -1;
-}
-
-int attrib__libxl_key_value_list_set(PyObject *v, libxl_key_value_list *pptr)
-{
-    if ( *pptr ) {
-        libxl_key_value_list_dispose(pptr);
-        *pptr = NULL;
-    }
-    if ( v == Py_None )
-        return 0;
-    return -1;
-}
-
-int attrib__libxl_mac_set(PyObject *v, libxl_mac *pptr)
-{
-    return fixed_bytearray_set(v, *pptr, 6);
-}
-
-int attrib__libxl_string_list_set(PyObject *v, libxl_string_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Setting string_list");
-    return -1;
-}
-
-int attrib__libxl_uuid_set(PyObject *v, libxl_uuid *pptr)
-{
-    return fixed_bytearray_set(v, libxl_uuid_bytearray(pptr), 16);
-}
-
-int attrib__libxl_domid_set(PyObject *v, libxl_domid *domid) {
-    *domid = PyInt_AsLong(v);
-    return 0;
-}
-
-int attrib__libxl_devid_set(PyObject *v, libxl_devid *devid) {
-   *devid = PyInt_AsLong(v);
-   return 0;
-}
-
-int attrib__struct_in_addr_set(PyObject *v, struct in_addr *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Setting in_addr");
-    return -1;
-}
-
-PyObject *attrib__libxl_cpuid_policy_list_get(libxl_cpuid_policy_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting cpuid_policy_list");
-    return NULL;
-}
-
-PyObject *attrib__libxl_bitmap_get(libxl_bitmap *pptr)
-{
-    PyObject *cpulist = NULL;
-    int i;
-
-    cpulist = PyList_New(0);
-    libxl_for_each_bit(i, *pptr) {
-        if ( libxl_bitmap_test(pptr, i) ) {
-            PyObject* pyint = PyInt_FromLong(i);
-
-            PyList_Append(cpulist, pyint);
-            Py_DECREF(pyint);
-        }
-    }
-    return cpulist;
-}
-
-PyObject *attrib__libxl_hwcap_get(libxl_hwcap *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting hwcap");
-    return NULL;
-}
-
-PyObject *attrib__libxl_key_value_list_get(libxl_key_value_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting key_value_list");
-    return NULL;
-}
-
-PyObject *attrib__libxl_mac_get(libxl_mac *pptr)
-{
-    return fixed_bytearray_get(*pptr, 6);
-}
-
-PyObject *attrib__libxl_string_list_get(libxl_string_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting string_list");
-    return NULL;
-}
-
-PyObject *attrib__libxl_uuid_get(libxl_uuid *pptr)
-{
-    return fixed_bytearray_get(libxl_uuid_bytearray(pptr), 16);
-}
-
-PyObject *attrib__libxl_domid_get(libxl_domid *domid) {
-    return PyInt_FromLong(*domid);
-}
-
-PyObject *attrib__libxl_devid_get(libxl_devid *devid) {
-    return PyInt_FromLong(*devid);
-}
-
-PyObject *attrib__struct_in_addr_get(struct in_addr *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting in_addr");
-    return NULL;
-}
-
-typedef struct {
-    PyObject_HEAD;
-    libxl_ctx *ctx;
-    xentoollog_logger_stdiostream *logger;
-    xentoollog_level minmsglevel;
-} XlObject;
-
-static PyObject *pyxl_list_domains(XlObject *self)
-{
-    libxl_dominfo *cur, *info;
-    PyObject *list;
-    int nr_dom, i;
-
-    info = libxl_list_domain(self->ctx, &nr_dom);
-    if ( NULL == info )
-        return PyList_New(0);
-
-    list = PyList_New(nr_dom);
-    if ( NULL == list )
-        goto err_mem;
-
-    for(i = 0, cur = info; i < nr_dom; i++, cur++) {
-        Py_dominfo *di;
-        di = Pydominfo_New();
-        if ( NULL == di )
-            goto err_mem;
-        memcpy(&di->obj, cur, sizeof(di->obj));
-        /* SetItem steals a reference */
-        PyList_SetItem(list, i, (PyObject *)di);
-    }
-
-    free(info);
-    return list;
-err_mem:
-    Py_DECREF(list);
-    PyErr_SetString(PyExc_MemoryError, "Allocating domain list");
-    return NULL;
-}
-
-static PyObject *pyxl_domid_to_name(XlObject *self, PyObject *args)
-{
-    char *domname;
-    int domid;
-    PyObject *ret = Py_None;
-
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-
-    domname = libxl_domid_to_name(self->ctx, domid);
-    if (domname)
-        ret = PyString_FromString(domname);
-    else
-        Py_INCREF(Py_None);
-    free(domname);
-
-    return ret;
-}
-
-static PyObject *pyxl_domain_shutdown(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_shutdown(self->ctx, domid) ) {
-        PyErr_SetString(xl_error_obj, "cannot shutdown domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_reboot(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_reboot(self->ctx, domid) ) {
-        PyErr_SetString(xl_error_obj, "cannot reboot domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_destroy(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_destroy(self->ctx, domid, 0) ) {
-        PyErr_SetString(xl_error_obj, "cannot destroy domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_pause(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_pause(self->ctx, domid) ) {
-        PyErr_SetString(xl_error_obj, "cannot pause domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_unpause(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_unpause(self->ctx, domid) ) {
-        PyErr_SetString(xl_error_obj, "cannot unpause domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_rename(XlObject *self, PyObject *args)
-{
-    char *old_name = NULL, *new_name;
-    int domid;
-    if ( !PyArg_ParseTuple(args, "is|s", &domid, &new_name, &old_name) )
-        return NULL;
-    if ( libxl_domain_rename(self->ctx, domid, old_name, new_name) ) {
-        PyErr_SetString(xl_error_obj, "cannot rename domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_pci_add(XlObject *self, PyObject *args)
-{
-    Py_device_pci *pci;
-    PyObject *obj;
-    int domid;
-    if ( !PyArg_ParseTuple(args, "iO", &domid, &obj) )
-        return NULL;
-    if ( !Pydevice_pci_Check(obj) ) {
-        PyErr_SetString(PyExc_TypeError, "Xxpected xl.device_pci");
-        return NULL;
-    }
-    pci = (Py_device_pci *)obj;
-    if ( libxl_device_pci_add(self->ctx, domid, &pci->obj, 0) ) {
-        PyErr_SetString(xl_error_obj, "cannot add pci device");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_pci_del(XlObject *self, PyObject *args)
-{
-    Py_device_pci *pci;
-    PyObject *obj;
-    int domid, force = 0;
-
-    if ( !PyArg_ParseTuple(args, "iO|i", &domid, &obj, &force) )
-        return NULL;
-    if ( !Pydevice_pci_Check(obj) ) {
-        PyErr_SetString(PyExc_TypeError, "Xxpected xl.device_pci");
-        return NULL;
-    }
-    pci = (Py_device_pci *)obj;
-    if ( force ) {
-        if ( libxl_device_pci_destroy(self->ctx, domid, &pci->obj, 0) ) {
-            PyErr_SetString(xl_error_obj, "cannot remove pci device");
-            return NULL;
-        }
-    } else {
-        if ( libxl_device_pci_remove(self->ctx, domid, &pci->obj, 0) ) {
-            PyErr_SetString(xl_error_obj, "cannot remove pci device");
-            return NULL;
-        }
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_pci_parse(XlObject *self, PyObject *args)
-{
-    Py_device_pci *pci;
-    char *str;
-
-    if ( !PyArg_ParseTuple(args, "s", &str) )
-        return NULL;
-
-    pci = Pydevice_pci_New();
-    if ( NULL == pci ) {
-        PyErr_SetString(PyExc_MemoryError, "Allocating domain list");
-        return NULL;
-    }
-
-    if ( xlu_pci_parse_bdf(NULL, &pci->obj, str) ) {
-        PyErr_SetString(xl_error_obj, "cannot parse pci device spec (BDF)");
-        Py_DECREF(pci);
-        return NULL;
-    }
-
-    return (PyObject *)pci;
-}
-
-static PyObject *pyxl_pci_assignable_list(XlObject *self, PyObject *args)
-{
-    libxl_device_pci *dev;
-    PyObject *list;
-    int nr_dev, i;
-
-    dev = libxl_device_pci_assignable_list(self->ctx, &nr_dev);
-    if ( dev == NULL ) {
-        PyErr_SetString(xl_error_obj, "Cannot list assignable devices");
-        return NULL;
-    }
-
-    list = PyList_New(nr_dev);
-    if ( NULL == list )
-        return NULL;
-
-    for(i = 0; i < nr_dev; i++) {
-        Py_device_pci *pd;
-        pd = Pydevice_pci_New();
-        if ( NULL == pd )
-            goto err_mem;
-        memcpy(&pd->obj, &dev[i], sizeof(pd->obj));
-        /* SetItem steals a reference */
-        PyList_SetItem(list, i, (PyObject *)pd);
-    }
-
-    free(dev);
-    return list;
-err_mem:
-    Py_DECREF(list);
-    PyErr_SetString(PyExc_MemoryError, "Allocating PCI device list");
-    return NULL;
-}
-
-static PyObject *pyxl_pci_list(XlObject *self, PyObject *args)
-{
-    libxl_device_pci *dev;
-    PyObject *list;
-    int nr_dev, i, domid;
-
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-
-    dev = libxl_device_pci_list(self->ctx, domid, &nr_dev);
-    if ( dev == NULL ) {
-        PyErr_SetString(xl_error_obj, "Cannot list assignable devices");
-        return NULL;
-    }
-
-    list = PyList_New(nr_dev);
-    if ( NULL == list )
-        return NULL;
-
-    for(i = 0; i < nr_dev; i++) {
-        Py_device_pci *pd;
-        pd = Pydevice_pci_New();
-        if ( NULL == pd )
-            goto err_mem;
-        memcpy(&pd->obj, &dev[i], sizeof(pd->obj));
-        /* SetItem steals a reference */
-        PyList_SetItem(list, i, (PyObject *)pd);
-    }
-
-    free(dev);
-    return list;
-err_mem:
-    Py_DECREF(list);
-    PyErr_SetString(PyExc_MemoryError, "Allocating PCI device list");
-    return NULL;
-}
-
-static PyMethodDef pyxl_methods[] = {
-    {"list_domains", (PyCFunction)pyxl_list_domains, METH_NOARGS,
-         "List domains"},
-    {"domid_to_name", (PyCFunction)pyxl_domid_to_name, METH_VARARGS,
-         "Retrieve name from domain-id"},
-    {"domain_shutdown", (PyCFunction)pyxl_domain_shutdown, METH_VARARGS,
-         "Shutdown a domain"},
-    {"domain_reboot", (PyCFunction)pyxl_domain_reboot, METH_VARARGS,
-         "Reboot a domain"},
-    {"domain_destroy", (PyCFunction)pyxl_domain_destroy, METH_VARARGS,
-         "Destroy a domain"},
-    {"domain_pause", (PyCFunction)pyxl_domain_pause, METH_VARARGS,
-         "Pause a domain"},
-    {"domain_unpause", (PyCFunction)pyxl_domain_unpause, METH_VARARGS,
-         "Unpause a domain"},
-    {"domain_rename", (PyCFunction)pyxl_domain_rename, METH_VARARGS,
-         "Rename a domain"},
-    {"device_pci_add", (PyCFunction)pyxl_pci_add, METH_VARARGS,
-         "Insert a pass-through PCI device"},
-    {"device_pci_del", (PyCFunction)pyxl_pci_del, METH_VARARGS,
-         "Remove a pass-through PCI device"},
-    {"device_pci_parse_bdf", (PyCFunction)pyxl_pci_parse, METH_VARARGS,
-         "Parse pass-through PCI device spec (BDF)"},
-    {"device_pci_list", (PyCFunction)pyxl_pci_list, METH_VARARGS,
-        "List PCI devices assigned to a domain"},
-    {"device_pci_assignable_list",
-        (PyCFunction)pyxl_pci_assignable_list, METH_NOARGS,
-        "List assignable PCI devices"},
-    { NULL, NULL, 0, NULL }
-};
-
-static PyObject *PyXl_getattr(PyObject *obj, char *name)
-{
-    return Py_FindMethod(pyxl_methods, obj, name);
-}
-
-static PyObject *PyXl_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
-    XlObject *self = (XlObject *)type->tp_alloc(type, 0);
-
-    if (self == NULL)
-        return NULL;
-
-    self->ctx = NULL;
-    self->logger = NULL;
-    self->minmsglevel = XTL_PROGRESS;
-
-    return (PyObject *)self;
-}
-
-static int
-PyXl_init(XlObject *self, PyObject *args, PyObject *kwds)
-{
-    self->logger = xtl_createlogger_stdiostream(stderr, self->minmsglevel,  0);
-    if (!self->logger) {
-        PyErr_SetString(xl_error_obj, "cannot init xl logger");
-        return -1;
-    }
-
-    if ( libxl_ctx_alloc(&self->ctx, LIBXL_VERSION, 0,
-                (xentoollog_logger*)self->logger) ) {
-        PyErr_SetString(xl_error_obj, "cannot init xl context");
-        return -1;
-    }
-
-    return 0;
-}
-
-static void PyXl_dealloc(XlObject *self)
-{
-    libxl_ctx_free(self->ctx);
-    if ( self->logger )
-        xtl_logger_destroy((xentoollog_logger*)self->logger);
-
-    self->ob_type->tp_free((PyObject *)self);
-}
-
-static PyTypeObject PyXlType = {
-    PyObject_HEAD_INIT(NULL)
-    0,
-    PKG "." CLS,
-    sizeof(XlObject),
-    0,
-    (destructor)PyXl_dealloc,     /* tp_dealloc        */
-    NULL,                         /* tp_print          */
-    PyXl_getattr,                 /* tp_getattr        */
-    NULL,                         /* tp_setattr        */
-    NULL,                         /* tp_compare        */
-    NULL,                         /* tp_repr           */
-    NULL,                         /* tp_as_number      */
-    NULL,                         /* tp_as_sequence    */
-    NULL,                         /* tp_as_mapping     */
-    NULL,                         /* tp_hash           */
-    NULL,                         /* tp_call           */
-    NULL,                         /* tp_str            */
-    NULL,                         /* tp_getattro       */
-    NULL,                         /* tp_setattro       */
-    NULL,                         /* tp_as_buffer      */
-    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags          */
-    "libxenlight connection",     /* tp_doc            */
-    NULL,                         /* tp_traverse       */
-    NULL,                         /* tp_clear          */
-    NULL,                         /* tp_richcompare    */
-    0,                            /* tp_weaklistoffset */
-    NULL,                         /* tp_iter           */
-    NULL,                         /* tp_iternext       */
-    pyxl_methods,                 /* tp_methods        */
-    NULL,                         /* tp_members        */
-    NULL,                         /* tp_getset         */
-    NULL,                         /* tp_base           */
-    NULL,                         /* tp_dict           */
-    NULL,                         /* tp_descr_get      */
-    NULL,                         /* tp_descr_set      */
-    0,                            /* tp_dictoffset     */
-    (initproc)PyXl_init,          /* tp_init           */
-    NULL,                         /* tp_alloc          */
-    PyXl_new,                     /* tp_new            */
-};
-
-static PyMethodDef xl_methods[] = { { NULL } };
-
-#define  _INT_CONST(m, c) PyModule_AddIntConstant(m, #c, c)
-#define  _INT_CONST_LIBXL(m, c) PyModule_AddIntConstant(m, #c, LIBXL_ ## c)
-PyMODINIT_FUNC initxl(void)
-{
-    PyObject *m;
-
-    if (PyType_Ready(&PyXlType) < 0)
-        return;
-
-    m = Py_InitModule(PKG, xl_methods);
-
-    if (m == NULL)
-      return;
-
-    xl_error_obj = PyErr_NewException(PKG ".Error", PyExc_RuntimeError, NULL);
-
-    Py_INCREF(&PyXlType);
-    PyModule_AddObject(m, CLS, (PyObject *)&PyXlType);
-
-    Py_INCREF(xl_error_obj);
-    PyModule_AddObject(m, "Error", xl_error_obj);
-
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_POWEROFF);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_REBOOT);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SUSPEND);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_CRASH);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_WATCHDOG);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SOFT_RESET);
-
-    genwrap__init(m);
-}
-
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- * End:
- */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:12:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12: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 1ZrkC1-0001gf-RE; Thu, 29 Oct 2015 10:12:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBz-0001g7-H6
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:23 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	52/C2-03763-601F1365; Thu, 29 Oct 2015 10:12:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1446113539!21012655!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31029 invoked from network); 29 Oct 2015 10:12: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;
	29 Oct 2015 10:12:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBv-0004aZ-23
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkBu-00057u-VZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:19 +0000
Date: Thu, 29 Oct 2015 10:12:18 +0000
Message-Id: <E1ZrkBu-00057u-VZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/python: remove broken xl binding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 598e97fdd0b5af28807ec262b8285eff236abdb4
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 6 17:57:26 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:16:27 2015 +0100

    tools/python: remove broken xl binding
    
    Various people say this binding doesn't compile or doesn't work. Remove
    it for the benefit of xl feature development -- so that new features
    won't need to worry about making this broken binding happy.
    
    This isn't going to expose any user visible changes because that module
    is not built by default.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Zhigang Wang <zhigang.x.wang@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/python/setup.py             |    9 -
 tools/python/xen/lowlevel/xl/xl.c |  797 -------------------------------------
 2 files changed, 0 insertions(+), 806 deletions(-)

diff --git a/tools/python/setup.py b/tools/python/setup.py
index 5bf81be..fdba866 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -27,17 +27,8 @@ xs = Extension("xs",
                depends            = [ PATH_XENSTORE + "/libxenstore.so" ],
                sources            = [ "xen/lowlevel/xs/xs.c" ])
 
-xl = Extension("xl",
-               extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC + "/include", "xen/lowlevel/xl" ],
-               library_dirs       = [ PATH_LIBXL ],
-               libraries          = [ "xenlight" ],
-               depends            = [ PATH_LIBXL + "/libxenlight.so" ],
-               sources            = [ "xen/lowlevel/xl/xl.c", "xen/lowlevel/xl/_pyxl_types.c" ])
-
 plat = os.uname()[0]
 modules = [ xc, xs ]
-#modules.extend([ xl ])
 
 setup(name            = 'xen',
       version         = '3.0',
diff --git a/tools/python/xen/lowlevel/xl/xl.c b/tools/python/xen/lowlevel/xl/xl.c
deleted file mode 100644
index 9b33731..0000000
--- a/tools/python/xen/lowlevel/xl/xl.c
+++ /dev/null
@@ -1,797 +0,0 @@
-/******************************************************************************
- * xl.c
- *
- * Copyright (c) 2010 Citrix Ltd.
- * Author: Gianni Tedesco
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <Python.h>
-#include <stdio.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-#include <getopt.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-#include <inttypes.h>
-
-#include <libxl.h>
-#include <libxl_utils.h>
-#include <libxlutil.h>
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
-/* Needed for Python versions earlier than 2.3. */
-#ifndef PyMODINIT_FUNC
-#define PyMODINIT_FUNC DL_EXPORT(void)
-#endif
-
-#define CLS "ctx"
-
-#if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5)
-#define Py_ssize_t int
-#endif
-
-static PyObject *xl_error_obj;
-
-int genwrap__obj_init(PyObject *self, PyObject *args, PyObject *kwds)
-{
-    PyObject *key, *value;
-    Py_ssize_t pos = 0;
-
-    if ( NULL == kwds )
-        return 0;
-
-    while (PyDict_Next(kwds, &pos, &key, &value)) {
-        if ( PyObject_SetAttr(self, key, value) < 0 )
-            return -1;
-    }
-
-    return 0;
-}
-
-int genwrap__string_set(PyObject *v, char **str)
-{
-    char *tmp;
-    if ( NULL == v || Py_None == v ) {
-        free(*str);
-        *str = NULL;
-        return 0;
-    }
-    if ( !PyString_Check(v) ) {
-        PyErr_SetString(PyExc_TypeError, "Attribute expected string");
-        return -1;
-    }
-    tmp = strdup(PyString_AsString(v));
-    if ( NULL == tmp ) {
-        PyErr_SetString(PyExc_MemoryError, "Allocating string attribute");
-        return -1;
-    }
-    free(*str);
-    *str = tmp;
-    return 0;
-}
-
-PyObject *genwrap__string_get(char **str)
-{
-    if ( NULL == *str ) {
-        Py_INCREF(Py_None);
-        return Py_None;
-    }
-    return PyString_FromString(*str);
-}
-
-PyObject *genwrap__ull_get(unsigned long long val)
-{
-    return PyLong_FromUnsignedLongLong(val);
-}
-
-int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask)
-{
-    unsigned long long tmp;
-    if ( NULL == v ) {
-        *val = 0;
-        return 0;
-    }
-    if ( PyLong_Check(v) ) {
-        tmp = PyLong_AsUnsignedLongLong(v);
-    }else if ( PyInt_Check(v) ) {
-        tmp = (unsigned long long)PyInt_AsLong(v);
-    }else{
-        PyErr_SetString(PyExc_TypeError, "Attribute expected int or long");
-        return -1;
-    }
-    if ( tmp & ~mask ) {
-        PyErr_SetString(PyExc_ValueError, "Integer overflow");
-        return -1;
-    }
-    *val = tmp;
-    return 0;
-}
-
-PyObject *genwrap__ll_get(long long val)
-{
-    return PyLong_FromLongLong(val);
-}
-
-int genwrap__ll_set(PyObject *v, long long *val, long long mask)
-{
-    long long tmp;
-    if ( NULL == v ) {
-        *val = 0;
-        return 0;
-    }
-    if ( PyLong_Check(v) ) {
-        tmp = PyLong_AsLongLong(v);
-    }else{
-        tmp = (long long)PyInt_AsLong(v);
-    }
-    if ( tmp & ~mask ) {
-        PyErr_SetString(PyExc_ValueError, "Integer overflow");
-        return -1;
-    }
-    *val = tmp;
-    return 0;
-}
-
-PyObject *genwrap__defbool_get(libxl_defbool *db)
-{
-    PyObject *ret;
-    ret = libxl_defbool_val(*db) ? Py_True : Py_False;
-    Py_INCREF(ret);
-    return ret;
-}
-
-int genwrap__defbool_set(PyObject *v, libxl_defbool *db)
-{
-    bool val = !(NULL == v || Py_None == v || Py_False == v);
-    libxl_defbool_set(db, val);
-    return 0;
-}
-
-static int fixed_bytearray_set(PyObject *v, uint8_t *ptr, size_t len)
-{
-    char *tmp;
-    size_t sz;
-
-    if ( NULL == v ) {
-        memset(ptr, 0, len);
-        return 0;
-    }
-
-#ifdef PyByteArray_Check
-    if ( PyByteArray_Check(v) ) {
-        sz = PyByteArray_Size(v);
-        tmp = PyByteArray_AsString(v);
-    }else
-#endif
-    if ( PyString_Check(v) ) {
-        Py_ssize_t ssz;
-        if ( PyString_AsStringAndSize(v, &tmp, &ssz) )
-            return -1;
-        if ( ssz < 0 )
-            tmp = NULL;
-        sz = ssz;
-    }else{
-        PyErr_SetString(PyExc_TypeError, "Attribute expected bytearray or string");
-        return -1;
-    }
-
-    if ( NULL == tmp ) {
-        memset(ptr, 0, len);
-        return 0;
-    }
-    if ( sz != len ) {
-        PyErr_SetString(PyExc_ValueError,
-                        (sz < len) ? "Buffer underflow" : "Buffer overflow");
-        return -1;
-    }
-
-    memcpy(ptr, tmp, sz);
-    return 0;
-}
-
-static PyObject *fixed_bytearray_get(const uint8_t *ptr, size_t len)
-{
-#ifdef PyByteArray_Check
-    return PyByteArray_FromStringAndSize((const char *)ptr, len);
-#else
-    return PyString_FromStringAndSize((const char *)ptr, len);
-#endif
-}
-
-#include "_pyxl_types.h"
-
-int attrib__libxl_cpuid_policy_list_set(PyObject *v, libxl_cpuid_policy_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Setting cpuid_policy_list");
-    return -1;
-}
-
-int attrib__libxl_bitmap_set(PyObject *v, libxl_bitmap *pptr)
-{
-    int i;
-    long cpu;
-
-    for (i = 0; i < PyList_Size(v); i++) {
-        cpu = PyInt_AsLong(PyList_GetItem(v, i));
-        libxl_bitmap_set(pptr, cpu);
-    }
-    return 0;
-}
-
-int attrib__libxl_hwcap_set(PyObject *v, libxl_hwcap *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Setting hwcap");
-    return -1;
-}
-
-int attrib__libxl_key_value_list_set(PyObject *v, libxl_key_value_list *pptr)
-{
-    if ( *pptr ) {
-        libxl_key_value_list_dispose(pptr);
-        *pptr = NULL;
-    }
-    if ( v == Py_None )
-        return 0;
-    return -1;
-}
-
-int attrib__libxl_mac_set(PyObject *v, libxl_mac *pptr)
-{
-    return fixed_bytearray_set(v, *pptr, 6);
-}
-
-int attrib__libxl_string_list_set(PyObject *v, libxl_string_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Setting string_list");
-    return -1;
-}
-
-int attrib__libxl_uuid_set(PyObject *v, libxl_uuid *pptr)
-{
-    return fixed_bytearray_set(v, libxl_uuid_bytearray(pptr), 16);
-}
-
-int attrib__libxl_domid_set(PyObject *v, libxl_domid *domid) {
-    *domid = PyInt_AsLong(v);
-    return 0;
-}
-
-int attrib__libxl_devid_set(PyObject *v, libxl_devid *devid) {
-   *devid = PyInt_AsLong(v);
-   return 0;
-}
-
-int attrib__struct_in_addr_set(PyObject *v, struct in_addr *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Setting in_addr");
-    return -1;
-}
-
-PyObject *attrib__libxl_cpuid_policy_list_get(libxl_cpuid_policy_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting cpuid_policy_list");
-    return NULL;
-}
-
-PyObject *attrib__libxl_bitmap_get(libxl_bitmap *pptr)
-{
-    PyObject *cpulist = NULL;
-    int i;
-
-    cpulist = PyList_New(0);
-    libxl_for_each_bit(i, *pptr) {
-        if ( libxl_bitmap_test(pptr, i) ) {
-            PyObject* pyint = PyInt_FromLong(i);
-
-            PyList_Append(cpulist, pyint);
-            Py_DECREF(pyint);
-        }
-    }
-    return cpulist;
-}
-
-PyObject *attrib__libxl_hwcap_get(libxl_hwcap *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting hwcap");
-    return NULL;
-}
-
-PyObject *attrib__libxl_key_value_list_get(libxl_key_value_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting key_value_list");
-    return NULL;
-}
-
-PyObject *attrib__libxl_mac_get(libxl_mac *pptr)
-{
-    return fixed_bytearray_get(*pptr, 6);
-}
-
-PyObject *attrib__libxl_string_list_get(libxl_string_list *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting string_list");
-    return NULL;
-}
-
-PyObject *attrib__libxl_uuid_get(libxl_uuid *pptr)
-{
-    return fixed_bytearray_get(libxl_uuid_bytearray(pptr), 16);
-}
-
-PyObject *attrib__libxl_domid_get(libxl_domid *domid) {
-    return PyInt_FromLong(*domid);
-}
-
-PyObject *attrib__libxl_devid_get(libxl_devid *devid) {
-    return PyInt_FromLong(*devid);
-}
-
-PyObject *attrib__struct_in_addr_get(struct in_addr *pptr)
-{
-    PyErr_SetString(PyExc_NotImplementedError, "Getting in_addr");
-    return NULL;
-}
-
-typedef struct {
-    PyObject_HEAD;
-    libxl_ctx *ctx;
-    xentoollog_logger_stdiostream *logger;
-    xentoollog_level minmsglevel;
-} XlObject;
-
-static PyObject *pyxl_list_domains(XlObject *self)
-{
-    libxl_dominfo *cur, *info;
-    PyObject *list;
-    int nr_dom, i;
-
-    info = libxl_list_domain(self->ctx, &nr_dom);
-    if ( NULL == info )
-        return PyList_New(0);
-
-    list = PyList_New(nr_dom);
-    if ( NULL == list )
-        goto err_mem;
-
-    for(i = 0, cur = info; i < nr_dom; i++, cur++) {
-        Py_dominfo *di;
-        di = Pydominfo_New();
-        if ( NULL == di )
-            goto err_mem;
-        memcpy(&di->obj, cur, sizeof(di->obj));
-        /* SetItem steals a reference */
-        PyList_SetItem(list, i, (PyObject *)di);
-    }
-
-    free(info);
-    return list;
-err_mem:
-    Py_DECREF(list);
-    PyErr_SetString(PyExc_MemoryError, "Allocating domain list");
-    return NULL;
-}
-
-static PyObject *pyxl_domid_to_name(XlObject *self, PyObject *args)
-{
-    char *domname;
-    int domid;
-    PyObject *ret = Py_None;
-
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-
-    domname = libxl_domid_to_name(self->ctx, domid);
-    if (domname)
-        ret = PyString_FromString(domname);
-    else
-        Py_INCREF(Py_None);
-    free(domname);
-
-    return ret;
-}
-
-static PyObject *pyxl_domain_shutdown(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_shutdown(self->ctx, domid) ) {
-        PyErr_SetString(xl_error_obj, "cannot shutdown domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_reboot(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_reboot(self->ctx, domid) ) {
-        PyErr_SetString(xl_error_obj, "cannot reboot domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_destroy(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_destroy(self->ctx, domid, 0) ) {
-        PyErr_SetString(xl_error_obj, "cannot destroy domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_pause(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_pause(self->ctx, domid) ) {
-        PyErr_SetString(xl_error_obj, "cannot pause domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_unpause(XlObject *self, PyObject *args)
-{
-    int domid;
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-    if ( libxl_domain_unpause(self->ctx, domid) ) {
-        PyErr_SetString(xl_error_obj, "cannot unpause domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_domain_rename(XlObject *self, PyObject *args)
-{
-    char *old_name = NULL, *new_name;
-    int domid;
-    if ( !PyArg_ParseTuple(args, "is|s", &domid, &new_name, &old_name) )
-        return NULL;
-    if ( libxl_domain_rename(self->ctx, domid, old_name, new_name) ) {
-        PyErr_SetString(xl_error_obj, "cannot rename domain");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_pci_add(XlObject *self, PyObject *args)
-{
-    Py_device_pci *pci;
-    PyObject *obj;
-    int domid;
-    if ( !PyArg_ParseTuple(args, "iO", &domid, &obj) )
-        return NULL;
-    if ( !Pydevice_pci_Check(obj) ) {
-        PyErr_SetString(PyExc_TypeError, "Xxpected xl.device_pci");
-        return NULL;
-    }
-    pci = (Py_device_pci *)obj;
-    if ( libxl_device_pci_add(self->ctx, domid, &pci->obj, 0) ) {
-        PyErr_SetString(xl_error_obj, "cannot add pci device");
-        return NULL;
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_pci_del(XlObject *self, PyObject *args)
-{
-    Py_device_pci *pci;
-    PyObject *obj;
-    int domid, force = 0;
-
-    if ( !PyArg_ParseTuple(args, "iO|i", &domid, &obj, &force) )
-        return NULL;
-    if ( !Pydevice_pci_Check(obj) ) {
-        PyErr_SetString(PyExc_TypeError, "Xxpected xl.device_pci");
-        return NULL;
-    }
-    pci = (Py_device_pci *)obj;
-    if ( force ) {
-        if ( libxl_device_pci_destroy(self->ctx, domid, &pci->obj, 0) ) {
-            PyErr_SetString(xl_error_obj, "cannot remove pci device");
-            return NULL;
-        }
-    } else {
-        if ( libxl_device_pci_remove(self->ctx, domid, &pci->obj, 0) ) {
-            PyErr_SetString(xl_error_obj, "cannot remove pci device");
-            return NULL;
-        }
-    }
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-static PyObject *pyxl_pci_parse(XlObject *self, PyObject *args)
-{
-    Py_device_pci *pci;
-    char *str;
-
-    if ( !PyArg_ParseTuple(args, "s", &str) )
-        return NULL;
-
-    pci = Pydevice_pci_New();
-    if ( NULL == pci ) {
-        PyErr_SetString(PyExc_MemoryError, "Allocating domain list");
-        return NULL;
-    }
-
-    if ( xlu_pci_parse_bdf(NULL, &pci->obj, str) ) {
-        PyErr_SetString(xl_error_obj, "cannot parse pci device spec (BDF)");
-        Py_DECREF(pci);
-        return NULL;
-    }
-
-    return (PyObject *)pci;
-}
-
-static PyObject *pyxl_pci_assignable_list(XlObject *self, PyObject *args)
-{
-    libxl_device_pci *dev;
-    PyObject *list;
-    int nr_dev, i;
-
-    dev = libxl_device_pci_assignable_list(self->ctx, &nr_dev);
-    if ( dev == NULL ) {
-        PyErr_SetString(xl_error_obj, "Cannot list assignable devices");
-        return NULL;
-    }
-
-    list = PyList_New(nr_dev);
-    if ( NULL == list )
-        return NULL;
-
-    for(i = 0; i < nr_dev; i++) {
-        Py_device_pci *pd;
-        pd = Pydevice_pci_New();
-        if ( NULL == pd )
-            goto err_mem;
-        memcpy(&pd->obj, &dev[i], sizeof(pd->obj));
-        /* SetItem steals a reference */
-        PyList_SetItem(list, i, (PyObject *)pd);
-    }
-
-    free(dev);
-    return list;
-err_mem:
-    Py_DECREF(list);
-    PyErr_SetString(PyExc_MemoryError, "Allocating PCI device list");
-    return NULL;
-}
-
-static PyObject *pyxl_pci_list(XlObject *self, PyObject *args)
-{
-    libxl_device_pci *dev;
-    PyObject *list;
-    int nr_dev, i, domid;
-
-    if ( !PyArg_ParseTuple(args, "i", &domid) )
-        return NULL;
-
-    dev = libxl_device_pci_list(self->ctx, domid, &nr_dev);
-    if ( dev == NULL ) {
-        PyErr_SetString(xl_error_obj, "Cannot list assignable devices");
-        return NULL;
-    }
-
-    list = PyList_New(nr_dev);
-    if ( NULL == list )
-        return NULL;
-
-    for(i = 0; i < nr_dev; i++) {
-        Py_device_pci *pd;
-        pd = Pydevice_pci_New();
-        if ( NULL == pd )
-            goto err_mem;
-        memcpy(&pd->obj, &dev[i], sizeof(pd->obj));
-        /* SetItem steals a reference */
-        PyList_SetItem(list, i, (PyObject *)pd);
-    }
-
-    free(dev);
-    return list;
-err_mem:
-    Py_DECREF(list);
-    PyErr_SetString(PyExc_MemoryError, "Allocating PCI device list");
-    return NULL;
-}
-
-static PyMethodDef pyxl_methods[] = {
-    {"list_domains", (PyCFunction)pyxl_list_domains, METH_NOARGS,
-         "List domains"},
-    {"domid_to_name", (PyCFunction)pyxl_domid_to_name, METH_VARARGS,
-         "Retrieve name from domain-id"},
-    {"domain_shutdown", (PyCFunction)pyxl_domain_shutdown, METH_VARARGS,
-         "Shutdown a domain"},
-    {"domain_reboot", (PyCFunction)pyxl_domain_reboot, METH_VARARGS,
-         "Reboot a domain"},
-    {"domain_destroy", (PyCFunction)pyxl_domain_destroy, METH_VARARGS,
-         "Destroy a domain"},
-    {"domain_pause", (PyCFunction)pyxl_domain_pause, METH_VARARGS,
-         "Pause a domain"},
-    {"domain_unpause", (PyCFunction)pyxl_domain_unpause, METH_VARARGS,
-         "Unpause a domain"},
-    {"domain_rename", (PyCFunction)pyxl_domain_rename, METH_VARARGS,
-         "Rename a domain"},
-    {"device_pci_add", (PyCFunction)pyxl_pci_add, METH_VARARGS,
-         "Insert a pass-through PCI device"},
-    {"device_pci_del", (PyCFunction)pyxl_pci_del, METH_VARARGS,
-         "Remove a pass-through PCI device"},
-    {"device_pci_parse_bdf", (PyCFunction)pyxl_pci_parse, METH_VARARGS,
-         "Parse pass-through PCI device spec (BDF)"},
-    {"device_pci_list", (PyCFunction)pyxl_pci_list, METH_VARARGS,
-        "List PCI devices assigned to a domain"},
-    {"device_pci_assignable_list",
-        (PyCFunction)pyxl_pci_assignable_list, METH_NOARGS,
-        "List assignable PCI devices"},
-    { NULL, NULL, 0, NULL }
-};
-
-static PyObject *PyXl_getattr(PyObject *obj, char *name)
-{
-    return Py_FindMethod(pyxl_methods, obj, name);
-}
-
-static PyObject *PyXl_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
-    XlObject *self = (XlObject *)type->tp_alloc(type, 0);
-
-    if (self == NULL)
-        return NULL;
-
-    self->ctx = NULL;
-    self->logger = NULL;
-    self->minmsglevel = XTL_PROGRESS;
-
-    return (PyObject *)self;
-}
-
-static int
-PyXl_init(XlObject *self, PyObject *args, PyObject *kwds)
-{
-    self->logger = xtl_createlogger_stdiostream(stderr, self->minmsglevel,  0);
-    if (!self->logger) {
-        PyErr_SetString(xl_error_obj, "cannot init xl logger");
-        return -1;
-    }
-
-    if ( libxl_ctx_alloc(&self->ctx, LIBXL_VERSION, 0,
-                (xentoollog_logger*)self->logger) ) {
-        PyErr_SetString(xl_error_obj, "cannot init xl context");
-        return -1;
-    }
-
-    return 0;
-}
-
-static void PyXl_dealloc(XlObject *self)
-{
-    libxl_ctx_free(self->ctx);
-    if ( self->logger )
-        xtl_logger_destroy((xentoollog_logger*)self->logger);
-
-    self->ob_type->tp_free((PyObject *)self);
-}
-
-static PyTypeObject PyXlType = {
-    PyObject_HEAD_INIT(NULL)
-    0,
-    PKG "." CLS,
-    sizeof(XlObject),
-    0,
-    (destructor)PyXl_dealloc,     /* tp_dealloc        */
-    NULL,                         /* tp_print          */
-    PyXl_getattr,                 /* tp_getattr        */
-    NULL,                         /* tp_setattr        */
-    NULL,                         /* tp_compare        */
-    NULL,                         /* tp_repr           */
-    NULL,                         /* tp_as_number      */
-    NULL,                         /* tp_as_sequence    */
-    NULL,                         /* tp_as_mapping     */
-    NULL,                         /* tp_hash           */
-    NULL,                         /* tp_call           */
-    NULL,                         /* tp_str            */
-    NULL,                         /* tp_getattro       */
-    NULL,                         /* tp_setattro       */
-    NULL,                         /* tp_as_buffer      */
-    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags          */
-    "libxenlight connection",     /* tp_doc            */
-    NULL,                         /* tp_traverse       */
-    NULL,                         /* tp_clear          */
-    NULL,                         /* tp_richcompare    */
-    0,                            /* tp_weaklistoffset */
-    NULL,                         /* tp_iter           */
-    NULL,                         /* tp_iternext       */
-    pyxl_methods,                 /* tp_methods        */
-    NULL,                         /* tp_members        */
-    NULL,                         /* tp_getset         */
-    NULL,                         /* tp_base           */
-    NULL,                         /* tp_dict           */
-    NULL,                         /* tp_descr_get      */
-    NULL,                         /* tp_descr_set      */
-    0,                            /* tp_dictoffset     */
-    (initproc)PyXl_init,          /* tp_init           */
-    NULL,                         /* tp_alloc          */
-    PyXl_new,                     /* tp_new            */
-};
-
-static PyMethodDef xl_methods[] = { { NULL } };
-
-#define  _INT_CONST(m, c) PyModule_AddIntConstant(m, #c, c)
-#define  _INT_CONST_LIBXL(m, c) PyModule_AddIntConstant(m, #c, LIBXL_ ## c)
-PyMODINIT_FUNC initxl(void)
-{
-    PyObject *m;
-
-    if (PyType_Ready(&PyXlType) < 0)
-        return;
-
-    m = Py_InitModule(PKG, xl_methods);
-
-    if (m == NULL)
-      return;
-
-    xl_error_obj = PyErr_NewException(PKG ".Error", PyExc_RuntimeError, NULL);
-
-    Py_INCREF(&PyXlType);
-    PyModule_AddObject(m, CLS, (PyObject *)&PyXlType);
-
-    Py_INCREF(xl_error_obj);
-    PyModule_AddObject(m, "Error", xl_error_obj);
-
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_POWEROFF);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_REBOOT);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SUSPEND);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_CRASH);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_WATCHDOG);
-    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SOFT_RESET);
-
-    genwrap__init(m);
-}
-
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- * End:
- */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:12:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkC9-0001iW-U0; Thu, 29 Oct 2015 10:12: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 1ZrkC8-0001i4-Bj
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:32 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	07/FE-01143-F01F1365; Thu, 29 Oct 2015 10:12:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446113549!35987195!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21150 invoked from network); 29 Oct 2015 10:12:30 -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;
	29 Oct 2015 10:12:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkC5-0004ae-D5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkC5-00058W-B3
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:29 +0000
Date: Thu, 29 Oct 2015 10:12:29 +0000
Message-Id: <E1ZrkC5-00058W-B3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Report the correct
	GICC size to the guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ee6d574b7073b5c98fcf94d20a53197609b85e1
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:51 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:25:48 2015 +0100

    xen/arm: vgic-v2: Report the correct GICC size to the guest
    
    The GICv2 DT node is usually used by the guest to know the address/size
    of the regions (GICD, GICC...) to map into their virtual memory.
    
    While the GICv2 spec requires the size of the GICC to be 8KB, we
    correctly do an 8KB stage-2 mapping but erroneously report 256 in the
    device tree (based on GUEST_GICC_SIZE).
    
    I bet we didn't see any issue so far because all the registers except
    GICC_DIR lives in the first 256 bytes of the GICC region and all the
    guests I have seen so far are driving the GIC with GICC_CTLR.EIOmode =
    0.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fixed some typos in commit message ]
---
 xen/include/public/arch-arm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 9a96401..3c365f3 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -397,7 +397,7 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICD_BASE   0x03001000ULL
 #define GUEST_GICD_SIZE   0x00001000ULL
 #define GUEST_GICC_BASE   0x03002000ULL
-#define GUEST_GICC_SIZE   0x00000100ULL
+#define GUEST_GICC_SIZE   0x00002000ULL
 
 /* vGIC v3 mappings */
 #define GUEST_GICV3_GICD_BASE      0x03001000ULL
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:12:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkC9-0001iW-U0; Thu, 29 Oct 2015 10:12: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 1ZrkC8-0001i4-Bj
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:32 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	07/FE-01143-F01F1365; Thu, 29 Oct 2015 10:12:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446113549!35987195!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21150 invoked from network); 29 Oct 2015 10:12:30 -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;
	29 Oct 2015 10:12:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkC5-0004ae-D5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkC5-00058W-B3
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:29 +0000
Date: Thu, 29 Oct 2015 10:12:29 +0000
Message-Id: <E1ZrkC5-00058W-B3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Report the correct
	GICC size to the guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ee6d574b7073b5c98fcf94d20a53197609b85e1
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:51 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:25:48 2015 +0100

    xen/arm: vgic-v2: Report the correct GICC size to the guest
    
    The GICv2 DT node is usually used by the guest to know the address/size
    of the regions (GICD, GICC...) to map into their virtual memory.
    
    While the GICv2 spec requires the size of the GICC to be 8KB, we
    correctly do an 8KB stage-2 mapping but erroneously report 256 in the
    device tree (based on GUEST_GICC_SIZE).
    
    I bet we didn't see any issue so far because all the registers except
    GICC_DIR lives in the first 256 bytes of the GICC region and all the
    guests I have seen so far are driving the GIC with GICC_CTLR.EIOmode =
    0.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fixed some typos in commit message ]
---
 xen/include/public/arch-arm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 9a96401..3c365f3 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -397,7 +397,7 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICD_BASE   0x03001000ULL
 #define GUEST_GICD_SIZE   0x00001000ULL
 #define GUEST_GICC_BASE   0x03002000ULL
-#define GUEST_GICC_SIZE   0x00000100ULL
+#define GUEST_GICC_SIZE   0x00002000ULL
 
 /* vGIC v3 mappings */
 #define GUEST_GICV3_GICD_BASE      0x03001000ULL
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:12:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkCK-0001km-2S; Thu, 29 Oct 2015 10:12:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCI-0001kS-PW
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:43 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	70/41-04752-911F1365; Thu, 29 Oct 2015 10:12:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446113559!43773973!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9783 invoked from network); 29 Oct 2015 10:12:40 -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;
	29 Oct 2015 10:12:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCF-0004ap-NU
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCF-00059W-Le
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:39 +0000
Date: Thu, 29 Oct 2015 10:12:39 +0000
Message-Id: <E1ZrkCF-00059W-Le@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic: Check the size of the
	CPU and vCPU interface retrieved from DT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 61edf8a6f837b45572704aceca7c71d67858c062
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:52 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:27:06 2015 +0100

    xen/arm: gic: Check the size of the CPU and vCPU interface retrieved from DT
    
    The size of the CPU interface will be used in a follow-up patch to map the
    region in Xen memory.
    
    Based on GICv2 spec, the CPU interface should at least be 8KB, although
    most of the platform we are supporting use incorrectly the GICv1 size
    (i.e 4KB) in their DT. Only warn and update the size to avoid any
    breakage on these platforms.
    
    Furthermore, Xen is relying on the fact that the Virtual CPU interface
    is at least 8KB. As in reality the Virtual CPU interface matches the CPU
    interface, check that the 2 interfaces have the same size.
    
    For GICv3, vGICv2 is only available for guest. So we only need to check
    that the GICV is at least 8KB.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- typos ]
---
 xen/arch/arm/gic-v2.c |   31 +++++++++++++++++++++++++++----
 xen/arch/arm/gic-v3.c |   19 +++++++++++++++++--
 2 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 5841e59..2b18c8c 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -617,14 +617,16 @@ static hw_irq_controller gicv2_guest_irq_type = {
 static int __init gicv2_init(void)
 {
     int res;
-    paddr_t hbase, dbase, cbase, vbase;
+    paddr_t hbase, dbase;
+    paddr_t cbase, csize;
+    paddr_t vbase, vsize;
     const struct dt_device_node *node = gicv2_info.node;
 
     res = dt_device_get_address(node, 0, &dbase, NULL);
     if ( res )
         panic("GICv2: Cannot find a valid address for the distributor");
 
-    res = dt_device_get_address(node, 1, &cbase, NULL);
+    res = dt_device_get_address(node, 1, &cbase, &csize);
     if ( res )
         panic("GICv2: Cannot find a valid address for the CPU");
 
@@ -632,7 +634,7 @@ static int __init gicv2_init(void)
     if ( res )
         panic("GICv2: Cannot find a valid address for the hypervisor");
 
-    res = dt_device_get_address(node, 3, &vbase, NULL);
+    res = dt_device_get_address(node, 3, &vbase, &vsize);
     if ( res )
         panic("GICv2: Cannot find a valid address for the virtual CPU");
 
@@ -641,7 +643,28 @@ static int __init gicv2_init(void)
         panic("GICv2: Cannot find the maintenance IRQ");
     gicv2_info.maintenance_irq = res;
 
-    /* TODO: Add check on distributor, cpu size */
+    /* TODO: Add check on distributor */
+
+    /*
+     * The GICv2 CPU interface should at least be 8KB. Although, most of the DT
+     * don't correctly set it and use the GICv1 CPU interface size (i.e 4KB).
+     * Warn and then fixup.
+     */
+    if ( csize < SZ_8K )
+    {
+        printk(XENLOG_WARNING "GICv2: WARNING: "
+               "The GICC size is too small: %#"PRIx64" expected %#x\n",
+               csize, SZ_8K);
+        csize = SZ_8K;
+    }
+
+    /*
+     * Check if the CPU interface and virtual CPU interface have the
+     * same size.
+     */
+    if ( csize != vsize )
+        panic("GICv2: Sizes of GICC (%#"PRIpaddr") and GICV (%#"PRIpaddr") don't match\n",
+               csize, vsize);
 
     printk("GICv2 initialization:\n"
               "        gic_dist_addr=%"PRIpaddr"\n"
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 957c6e0..9833a8d 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1143,7 +1143,8 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
                                  paddr_t dbase)
 {
     int res;
-    paddr_t cbase, vbase;
+    paddr_t cbase;
+    paddr_t vbase, vsize;
 
     /*
      * For GICv3 supporting GICv2, GICC and GICV base address will be
@@ -1155,10 +1156,24 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
         return;
 
     res = dt_device_get_address(node, 1 + gicv3.rdist_count + 2,
-                                &vbase, NULL);
+                                &vbase, &vsize);
     if ( res )
         return;
 
+    /*
+     * We emulate a vGICv2 using a GIC CPU interface of GUEST_GICC_SIZE.
+     * So only support GICv2 on GICv3 when the virtual CPU interface is
+     * at least GUEST_GICC_SIZE.
+     */
+    if ( vsize < GUEST_GICC_SIZE )
+    {
+        printk(XENLOG_WARNING
+               "GICv3: WARNING: Not enabling support for GICv2 compat mode.\n"
+               "Size of GICV (%#"PRIpaddr") must at least be %#llx.\n",
+               vsize, GUEST_GICC_SIZE);
+        return;
+    }
+
     printk("GICv3 compatible with GICv2 cbase %#"PRIpaddr" vbase %#"PRIpaddr"\n",
            cbase, vbase);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:12:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkCK-0001km-2S; Thu, 29 Oct 2015 10:12:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCI-0001kS-PW
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:43 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	70/41-04752-911F1365; Thu, 29 Oct 2015 10:12:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446113559!43773973!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9783 invoked from network); 29 Oct 2015 10:12:40 -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;
	29 Oct 2015 10:12:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCF-0004ap-NU
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCF-00059W-Le
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:39 +0000
Date: Thu, 29 Oct 2015 10:12:39 +0000
Message-Id: <E1ZrkCF-00059W-Le@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic: Check the size of the
	CPU and vCPU interface retrieved from DT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 61edf8a6f837b45572704aceca7c71d67858c062
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:52 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:27:06 2015 +0100

    xen/arm: gic: Check the size of the CPU and vCPU interface retrieved from DT
    
    The size of the CPU interface will be used in a follow-up patch to map the
    region in Xen memory.
    
    Based on GICv2 spec, the CPU interface should at least be 8KB, although
    most of the platform we are supporting use incorrectly the GICv1 size
    (i.e 4KB) in their DT. Only warn and update the size to avoid any
    breakage on these platforms.
    
    Furthermore, Xen is relying on the fact that the Virtual CPU interface
    is at least 8KB. As in reality the Virtual CPU interface matches the CPU
    interface, check that the 2 interfaces have the same size.
    
    For GICv3, vGICv2 is only available for guest. So we only need to check
    that the GICV is at least 8KB.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- typos ]
---
 xen/arch/arm/gic-v2.c |   31 +++++++++++++++++++++++++++----
 xen/arch/arm/gic-v3.c |   19 +++++++++++++++++--
 2 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 5841e59..2b18c8c 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -617,14 +617,16 @@ static hw_irq_controller gicv2_guest_irq_type = {
 static int __init gicv2_init(void)
 {
     int res;
-    paddr_t hbase, dbase, cbase, vbase;
+    paddr_t hbase, dbase;
+    paddr_t cbase, csize;
+    paddr_t vbase, vsize;
     const struct dt_device_node *node = gicv2_info.node;
 
     res = dt_device_get_address(node, 0, &dbase, NULL);
     if ( res )
         panic("GICv2: Cannot find a valid address for the distributor");
 
-    res = dt_device_get_address(node, 1, &cbase, NULL);
+    res = dt_device_get_address(node, 1, &cbase, &csize);
     if ( res )
         panic("GICv2: Cannot find a valid address for the CPU");
 
@@ -632,7 +634,7 @@ static int __init gicv2_init(void)
     if ( res )
         panic("GICv2: Cannot find a valid address for the hypervisor");
 
-    res = dt_device_get_address(node, 3, &vbase, NULL);
+    res = dt_device_get_address(node, 3, &vbase, &vsize);
     if ( res )
         panic("GICv2: Cannot find a valid address for the virtual CPU");
 
@@ -641,7 +643,28 @@ static int __init gicv2_init(void)
         panic("GICv2: Cannot find the maintenance IRQ");
     gicv2_info.maintenance_irq = res;
 
-    /* TODO: Add check on distributor, cpu size */
+    /* TODO: Add check on distributor */
+
+    /*
+     * The GICv2 CPU interface should at least be 8KB. Although, most of the DT
+     * don't correctly set it and use the GICv1 CPU interface size (i.e 4KB).
+     * Warn and then fixup.
+     */
+    if ( csize < SZ_8K )
+    {
+        printk(XENLOG_WARNING "GICv2: WARNING: "
+               "The GICC size is too small: %#"PRIx64" expected %#x\n",
+               csize, SZ_8K);
+        csize = SZ_8K;
+    }
+
+    /*
+     * Check if the CPU interface and virtual CPU interface have the
+     * same size.
+     */
+    if ( csize != vsize )
+        panic("GICv2: Sizes of GICC (%#"PRIpaddr") and GICV (%#"PRIpaddr") don't match\n",
+               csize, vsize);
 
     printk("GICv2 initialization:\n"
               "        gic_dist_addr=%"PRIpaddr"\n"
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 957c6e0..9833a8d 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1143,7 +1143,8 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
                                  paddr_t dbase)
 {
     int res;
-    paddr_t cbase, vbase;
+    paddr_t cbase;
+    paddr_t vbase, vsize;
 
     /*
      * For GICv3 supporting GICv2, GICC and GICV base address will be
@@ -1155,10 +1156,24 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
         return;
 
     res = dt_device_get_address(node, 1 + gicv3.rdist_count + 2,
-                                &vbase, NULL);
+                                &vbase, &vsize);
     if ( res )
         return;
 
+    /*
+     * We emulate a vGICv2 using a GIC CPU interface of GUEST_GICC_SIZE.
+     * So only support GICv2 on GICv3 when the virtual CPU interface is
+     * at least GUEST_GICC_SIZE.
+     */
+    if ( vsize < GUEST_GICC_SIZE )
+    {
+        printk(XENLOG_WARNING
+               "GICv3: WARNING: Not enabling support for GICv2 compat mode.\n"
+               "Size of GICV (%#"PRIpaddr") must at least be %#llx.\n",
+               vsize, GUEST_GICC_SIZE);
+        return;
+    }
+
     printk("GICv3 compatible with GICv2 cbase %#"PRIpaddr" vbase %#"PRIpaddr"\n",
            cbase, vbase);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:12:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12: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 1ZrkCU-0001ms-5G; Thu, 29 Oct 2015 10:12:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCT-0001mc-Gi
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:53 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	DF/90-29649-421F1365; Thu, 29 Oct 2015 10:12:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1446113570!25125298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15243 invoked from network); 29 Oct 2015 10:12:51 -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 Oct 2015 10:12:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCQ-0004ax-27
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCP-0005A1-Ve
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:49 +0000
Date: Thu, 29 Oct 2015 10:12:49 +0000
Message-Id: <E1ZrkCP-0005A1-Ve@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic-v2: Automatically detect
	aliased GIC400
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21550029f709072aacf3b90edd574e7d3021b400
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:53 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:28:09 2015 +0100

    xen/arm: gic-v2: Automatically detect aliased GIC400
    
    We are currently using a per-platform quirk to know if the 2 4KB region of
    the GIC CPU interface are each aligned to 64KB. Although, it may be
    possible to have different layout on a same platform (depending on the
    firmware version).
    
    Rather than having a quirk it's possible to detect by reading the GIC
    memory. This patch is based from the Linux commit "irqchip/GIC: Add workaround
    for aliased GIC400" [1].
    
    Take the opportunity to clean up the GICv2 of code which was only
    required because of the quirk.
    
    Note that none of the platform using the gic-hip04 were actually using
    the quirk, so the code has been dropped. I will let the maintainers
    decide whether it's relevant or not to add proper detection for aliased
    GIC for this hardware.
    
    [1] commit 12e14066f4835f5ee1ca795f0309415b54c067a9
        Author: Marc Zyngier <marc.zyngier@arm.com>
        Date:   Sun Sep 13 12:14:31 2015 +0100
    
        irqchip/GIC: Add workaround for aliased GIC400
    
        The GICv2 architecture mandates that the two 4kB GIC regions are
        contiguous, and on two separate physical pages (so that access to
        the second page can be trapped by a hypervisor). This doesn't work
        very well when PAGE_SIZE is 64kB.
    
        A relatively common hack^Wway to work around this is to alias each
        4kB region over its own 64kB page. Of course in this case, the base
        address you want to use is not really the begining of the region,
        but base + 60kB (so that you get a contiguous 8kB region over two
        distinct pages).
    
        Normally, this would be described in DT with a new property, but
        some HW is already out there, and the firmware makes sure that
        it will override whatever you put in the GIC node. Duh. And of course,
        said firmware source code is not available, despite being based
        on u-boot.
    
        The workaround is to detect the case where the CPU interface size
        is set to 128kB, and verify the aliasing by checking that the ID
        register for GIC400 (which is the only GIC wired this way so far)
        is the same at base and base + 0xF000. In this case, we update
        the GIC base address and let it roll.
    
        And if you feel slightly sick by looking at this, rest assured that
        I do too...
    
        Reported-by: Julien Grall <julien.grall@citrix.com>
        Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
        Cc: linux-arm-kernel@lists.infradead.org
        Cc: Stuart Yoder <stuart.yoder@freescale.com>
        Cc: Pavel Fedin <p.fedin@samsung.com>
        Cc: Jason Cooper <jason@lakedaemon.net>
        Link: http://lkml.kernel.org/r/1442142873-20213-2-git-send-email-marc.zyngier@arm.com
        Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic-hip04.c             |   12 ++----
 xen/arch/arm/gic-v2.c                |   59 ++++++++++++++++++++++++---------
 xen/arch/arm/gic-v3.c                |    6 ++--
 xen/arch/arm/platforms/xgene-storm.c |    6 ---
 xen/arch/arm/vgic-v2.c               |   49 ++++++++++++++++++----------
 xen/include/asm-arm/gic.h            |    1 +
 xen/include/asm-arm/platform.h       |    6 ---
 xen/include/asm-arm/vgic.h           |    3 +-
 8 files changed, 84 insertions(+), 58 deletions(-)

diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c
index e8cdcd4..310f35a 100644
--- a/xen/arch/arm/gic-hip04.c
+++ b/xen/arch/arm/gic-hip04.c
@@ -631,14 +631,14 @@ static hw_irq_controller hip04gic_guest_irq_type = {
 static int __init hip04gic_init(void)
 {
     int res;
-    paddr_t hbase, dbase, cbase, vbase;
+    paddr_t hbase, dbase, cbase, csize, vbase;
     const struct dt_device_node *node = gicv2_info.node;
 
     res = dt_device_get_address(node, 0, &dbase, NULL);
     if ( res )
         panic("GIC-HIP04: Cannot find a valid address for the distributor");
 
-    res = dt_device_get_address(node, 1, &cbase, NULL);
+    res = dt_device_get_address(node, 1, &cbase, &csize);
     if ( res )
         panic("GIC-HIP04: Cannot find a valid address for the CPU");
 
@@ -675,11 +675,7 @@ static int __init hip04gic_init(void)
         panic("GIC-HIP04: Failed to ioremap for GIC distributor\n");
 
     gicv2.map_cbase[0] = ioremap_nocache(cbase, PAGE_SIZE);
-
-    if ( platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        gicv2.map_cbase[1] = ioremap_nocache(cbase + SZ_64K, PAGE_SIZE);
-    else
-        gicv2.map_cbase[1] = ioremap_nocache(cbase + PAGE_SIZE, PAGE_SIZE);
+    gicv2.map_cbase[1] = ioremap_nocache(cbase + PAGE_SIZE, PAGE_SIZE);
 
     if ( !gicv2.map_cbase[0] || !gicv2.map_cbase[1] )
         panic("GIC-HIP04: Failed to ioremap for GIC CPU interface\n");
@@ -688,7 +684,7 @@ static int __init hip04gic_init(void)
     if ( !gicv2.map_hbase )
         panic("GIC-HIP04: Failed to ioremap for GIC Virtual interface\n");
 
-    vgic_v2_setup_hw(dbase, cbase, vbase);
+    vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0);
 
     /* Global settings: interrupt distributor */
     spin_lock_init(&gicv2.lock);
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 2b18c8c..01e36b5 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -65,7 +65,7 @@
 /* Global state */
 static struct {
     void __iomem * map_dbase; /* IO mapped Address of distributor registers */
-    void __iomem * map_cbase[2]; /* IO mapped Address of CPU interface registers */
+    void __iomem * map_cbase; /* IO mapped Address of CPU interface registers */
     void __iomem * map_hbase; /* IO Address of virtual interface registers */
     spinlock_t lock;
 } gicv2;
@@ -98,16 +98,12 @@ static inline uint32_t readl_gicd(unsigned int offset)
 
 static inline void writel_gicc(uint32_t val, unsigned int offset)
 {
-    unsigned int page = offset >> PAGE_SHIFT;
-    offset &= ~PAGE_MASK;
-    writel_relaxed(val, gicv2.map_cbase[page] + offset);
+    writel_relaxed(val, gicv2.map_cbase + offset);
 }
 
 static inline uint32_t readl_gicc(unsigned int offset)
 {
-    unsigned int page = offset >> PAGE_SHIFT;
-    offset &= ~PAGE_MASK;
-    return readl_relaxed(gicv2.map_cbase[page] + offset);
+    return readl_relaxed(gicv2.map_cbase + offset);
 }
 
 static inline void writel_gich(uint32_t val, unsigned int offset)
@@ -614,12 +610,31 @@ static hw_irq_controller gicv2_guest_irq_type = {
     .set_affinity = gicv2_irq_set_affinity,
 };
 
+static bool_t gicv2_is_aliased(paddr_t cbase, paddr_t csize)
+{
+    uint32_t val_low, val_high;
+
+    if ( csize != SZ_128K )
+        return false;
+
+    /*
+     * Verify that we have the first 4kB of a GIC400
+     * aliased over the first 64kB by checking the
+     * GICC_IIDR register on both ends.
+     */
+    val_low = readl_gicc(GICC_IIDR);
+    val_high = readl_gicc(GICC_IIDR + 0xf000);
+
+    return ((val_low & 0xfff0fff) == 0x0202043B && val_low == val_high);
+}
+
 static int __init gicv2_init(void)
 {
     int res;
     paddr_t hbase, dbase;
     paddr_t cbase, csize;
     paddr_t vbase, vsize;
+    uint32_t aliased_offset = 0;
     const struct dt_device_node *node = gicv2_info.node;
 
     res = dt_device_get_address(node, 0, &dbase, NULL);
@@ -683,21 +698,33 @@ static int __init gicv2_init(void)
     if ( !gicv2.map_dbase )
         panic("GICv2: Failed to ioremap for GIC distributor\n");
 
-    gicv2.map_cbase[0] = ioremap_nocache(cbase, PAGE_SIZE);
-
-    if ( platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        gicv2.map_cbase[1] = ioremap_nocache(cbase + SZ_64K, PAGE_SIZE);
-    else
-        gicv2.map_cbase[1] = ioremap_nocache(cbase + PAGE_SIZE, PAGE_SIZE);
-
-    if ( !gicv2.map_cbase[0] || !gicv2.map_cbase[1] )
+    gicv2.map_cbase = ioremap_nocache(cbase, csize);
+    if ( !gicv2.map_cbase )
         panic("GICv2: Failed to ioremap for GIC CPU interface\n");
 
+    if ( gicv2_is_aliased(cbase, csize) )
+    {
+        /*
+         * Move the base up by 60kB, so that we have a 8kB contiguous
+         * region, which allows us to use GICC_DIR at its
+         * normal offset.
+         * Note the variable cbase is not updated as we need the original
+         * value for the vGICv2 emulation.
+         */
+        aliased_offset = 0xf000;
+
+        gicv2.map_cbase += aliased_offset;
+
+        printk(XENLOG_WARNING
+               "GICv2: Adjusting CPU interface base to %#"PRIx64"\n",
+               cbase + aliased_offset);
+    }
+
     gicv2.map_hbase = ioremap_nocache(hbase, PAGE_SIZE);
     if ( !gicv2.map_hbase )
         panic("GICv2: Failed to ioremap for GIC Virtual interface\n");
 
-    vgic_v2_setup_hw(dbase, cbase, vbase);
+    vgic_v2_setup_hw(dbase, cbase, csize, vbase, aliased_offset);
 
     /* Global settings: interrupt distributor */
     spin_lock_init(&gicv2.lock);
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 9833a8d..4fe0c37 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1143,7 +1143,7 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
                                  paddr_t dbase)
 {
     int res;
-    paddr_t cbase;
+    paddr_t cbase, csize;
     paddr_t vbase, vsize;
 
     /*
@@ -1151,7 +1151,7 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
      * provided.
      */
     res = dt_device_get_address(node, 1 + gicv3.rdist_count,
-                                &cbase, NULL);
+                                &cbase, &csize);
     if ( res )
         return;
 
@@ -1177,7 +1177,7 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
     printk("GICv3 compatible with GICv2 cbase %#"PRIpaddr" vbase %#"PRIpaddr"\n",
            cbase, vbase);
 
-    vgic_v2_setup_hw(dbase, cbase, vbase);
+    vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0);
 }
 
 /* Set up the GIC */
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 8b05ed5..70cb655 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -68,11 +68,6 @@ static void __init xgene_check_pirq_eoi(void)
               "Please upgrade your firmware to the latest version");
 }
 
-static uint32_t xgene_storm_quirks(void)
-{
-    return PLATFORM_QUIRK_GIC_64K_STRIDE;
-}
-
 static void xgene_storm_reset(void)
 {
     void __iomem *addr;
@@ -122,7 +117,6 @@ PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .init = xgene_storm_init,
     .reset = xgene_storm_reset,
-    .quirks = xgene_storm_quirks,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 2d63e12..f7d784b 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -36,18 +36,25 @@ static struct {
     bool_t enabled;
     /* Distributor interface address */
     paddr_t dbase;
-    /* CPU interface address */
+    /* CPU interface address & size */
     paddr_t cbase;
+    paddr_t csize;
     /* Virtual CPU interface address */
     paddr_t vbase;
+
+    /* Offset to add to get an 8kB contiguous region if GIC is aliased */
+    uint32_t aliased_offset;
 } vgic_v2_hw;
 
-void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t vbase)
+void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
+                      paddr_t vbase, uint32_t aliased_offset)
 {
     vgic_v2_hw.enabled = 1;
     vgic_v2_hw.dbase = dbase;
     vgic_v2_hw.cbase = cbase;
+    vgic_v2_hw.csize = csize;
     vgic_v2_hw.vbase = vbase;
+    vgic_v2_hw.aliased_offset = aliased_offset;
 }
 
 static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
@@ -524,7 +531,8 @@ static int vgic_v2_vcpu_init(struct vcpu *v)
 static int vgic_v2_domain_init(struct domain *d)
 {
     int i, ret;
-    paddr_t cbase;
+    paddr_t cbase, csize;
+    paddr_t vbase;
 
     /*
      * The hardware domain gets the hardware address.
@@ -533,33 +541,38 @@ static int vgic_v2_domain_init(struct domain *d)
     if ( is_hardware_domain(d) )
     {
         d->arch.vgic.dbase = vgic_v2_hw.dbase;
+        /*
+         * For the hardware domain, we always map the whole HW CPU
+         * interface region in order to match the device tree (the "reg"
+         * properties is copied as it is).
+         * Note that we assume the size of the CPU interface is always
+         * aligned to PAGE_SIZE.
+         */
         cbase = vgic_v2_hw.cbase;
+        csize = vgic_v2_hw.csize;
+        vbase = vgic_v2_hw.vbase;
     }
     else
     {
         d->arch.vgic.dbase = GUEST_GICD_BASE;
+        /*
+         * The CPU interface exposed to the guest is always 8kB. We may
+         * need to add an offset to the virtual CPU interface base
+         * address when in the GIC is aliased to get a 8kB contiguous
+         * region.
+         */
+        BUILD_BUG_ON(GUEST_GICC_SIZE != SZ_8K);
         cbase = GUEST_GICC_BASE;
+        csize = GUEST_GICC_SIZE;
+        vbase = vgic_v2_hw.vbase + vgic_v2_hw.aliased_offset;
     }
 
     /*
      * Map the gic virtual cpu interface in the gic cpu interface
      * region of the guest.
-     *
-     * The second page is always mapped at +4K irrespective of the
-     * GIC_64K_STRIDE quirk. The DTB passed to the guest reflects this.
      */
-    ret = map_mmio_regions(d, paddr_to_pfn(cbase), 1,
-                           paddr_to_pfn(vgic_v2_hw.vbase));
-    if ( ret )
-        return ret;
-
-    if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
-                               1, paddr_to_pfn(vgic_v2_hw.vbase + PAGE_SIZE));
-    else
-        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
-                               1, paddr_to_pfn(vgic_v2_hw.vbase + SZ_64K));
-
+    ret = map_mmio_regions(d, paddr_to_pfn(cbase), csize / PAGE_SIZE,
+                           paddr_to_pfn(vbase));
     if ( ret )
         return ret;
 
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 6d53f97..0116481 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -76,6 +76,7 @@
 #define GICC_HPPIR      (0x0018)
 #define GICC_APR        (0x00D0)
 #define GICC_NSAPR      (0x00E0)
+#define GICC_IIDR       (0x00FC)
 #define GICC_DIR        (0x1000)
 
 #define GICH_HCR        (0x00)
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index b8fc5ac..5e462ac 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -39,12 +39,6 @@ struct platform_desc {
     const struct dt_device_match *blacklist_dev;
 };
 
-/*
- * Quirk for platforms where the 4K GIC register ranges are placed at
- * 64K stride.
- */
-#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 0)
-
 void __init platform_init(void);
 int __init platform_init_time(void);
 int __init platform_specific_mapping(struct domain *d);
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index ba74d0f..cb51a9e 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -248,7 +248,8 @@ static inline int vgic_allocate_spi(struct domain *d)
 
 extern void vgic_free_virq(struct domain *d, unsigned int virq);
 
-void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t vbase);
+void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
+                      paddr_t vbase, uint32_t aliased_offset);
 
 #ifdef HAS_GICV3
 struct rdist_region;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:12:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:12: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 1ZrkCU-0001ms-5G; Thu, 29 Oct 2015 10:12:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCT-0001mc-Gi
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:53 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	DF/90-29649-421F1365; Thu, 29 Oct 2015 10:12:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1446113570!25125298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15243 invoked from network); 29 Oct 2015 10:12:51 -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 Oct 2015 10:12:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCQ-0004ax-27
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCP-0005A1-Ve
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:12:49 +0000
Date: Thu, 29 Oct 2015 10:12:49 +0000
Message-Id: <E1ZrkCP-0005A1-Ve@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic-v2: Automatically detect
	aliased GIC400
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21550029f709072aacf3b90edd574e7d3021b400
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:53 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:28:09 2015 +0100

    xen/arm: gic-v2: Automatically detect aliased GIC400
    
    We are currently using a per-platform quirk to know if the 2 4KB region of
    the GIC CPU interface are each aligned to 64KB. Although, it may be
    possible to have different layout on a same platform (depending on the
    firmware version).
    
    Rather than having a quirk it's possible to detect by reading the GIC
    memory. This patch is based from the Linux commit "irqchip/GIC: Add workaround
    for aliased GIC400" [1].
    
    Take the opportunity to clean up the GICv2 of code which was only
    required because of the quirk.
    
    Note that none of the platform using the gic-hip04 were actually using
    the quirk, so the code has been dropped. I will let the maintainers
    decide whether it's relevant or not to add proper detection for aliased
    GIC for this hardware.
    
    [1] commit 12e14066f4835f5ee1ca795f0309415b54c067a9
        Author: Marc Zyngier <marc.zyngier@arm.com>
        Date:   Sun Sep 13 12:14:31 2015 +0100
    
        irqchip/GIC: Add workaround for aliased GIC400
    
        The GICv2 architecture mandates that the two 4kB GIC regions are
        contiguous, and on two separate physical pages (so that access to
        the second page can be trapped by a hypervisor). This doesn't work
        very well when PAGE_SIZE is 64kB.
    
        A relatively common hack^Wway to work around this is to alias each
        4kB region over its own 64kB page. Of course in this case, the base
        address you want to use is not really the begining of the region,
        but base + 60kB (so that you get a contiguous 8kB region over two
        distinct pages).
    
        Normally, this would be described in DT with a new property, but
        some HW is already out there, and the firmware makes sure that
        it will override whatever you put in the GIC node. Duh. And of course,
        said firmware source code is not available, despite being based
        on u-boot.
    
        The workaround is to detect the case where the CPU interface size
        is set to 128kB, and verify the aliasing by checking that the ID
        register for GIC400 (which is the only GIC wired this way so far)
        is the same at base and base + 0xF000. In this case, we update
        the GIC base address and let it roll.
    
        And if you feel slightly sick by looking at this, rest assured that
        I do too...
    
        Reported-by: Julien Grall <julien.grall@citrix.com>
        Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
        Cc: linux-arm-kernel@lists.infradead.org
        Cc: Stuart Yoder <stuart.yoder@freescale.com>
        Cc: Pavel Fedin <p.fedin@samsung.com>
        Cc: Jason Cooper <jason@lakedaemon.net>
        Link: http://lkml.kernel.org/r/1442142873-20213-2-git-send-email-marc.zyngier@arm.com
        Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic-hip04.c             |   12 ++----
 xen/arch/arm/gic-v2.c                |   59 ++++++++++++++++++++++++---------
 xen/arch/arm/gic-v3.c                |    6 ++--
 xen/arch/arm/platforms/xgene-storm.c |    6 ---
 xen/arch/arm/vgic-v2.c               |   49 ++++++++++++++++++----------
 xen/include/asm-arm/gic.h            |    1 +
 xen/include/asm-arm/platform.h       |    6 ---
 xen/include/asm-arm/vgic.h           |    3 +-
 8 files changed, 84 insertions(+), 58 deletions(-)

diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c
index e8cdcd4..310f35a 100644
--- a/xen/arch/arm/gic-hip04.c
+++ b/xen/arch/arm/gic-hip04.c
@@ -631,14 +631,14 @@ static hw_irq_controller hip04gic_guest_irq_type = {
 static int __init hip04gic_init(void)
 {
     int res;
-    paddr_t hbase, dbase, cbase, vbase;
+    paddr_t hbase, dbase, cbase, csize, vbase;
     const struct dt_device_node *node = gicv2_info.node;
 
     res = dt_device_get_address(node, 0, &dbase, NULL);
     if ( res )
         panic("GIC-HIP04: Cannot find a valid address for the distributor");
 
-    res = dt_device_get_address(node, 1, &cbase, NULL);
+    res = dt_device_get_address(node, 1, &cbase, &csize);
     if ( res )
         panic("GIC-HIP04: Cannot find a valid address for the CPU");
 
@@ -675,11 +675,7 @@ static int __init hip04gic_init(void)
         panic("GIC-HIP04: Failed to ioremap for GIC distributor\n");
 
     gicv2.map_cbase[0] = ioremap_nocache(cbase, PAGE_SIZE);
-
-    if ( platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        gicv2.map_cbase[1] = ioremap_nocache(cbase + SZ_64K, PAGE_SIZE);
-    else
-        gicv2.map_cbase[1] = ioremap_nocache(cbase + PAGE_SIZE, PAGE_SIZE);
+    gicv2.map_cbase[1] = ioremap_nocache(cbase + PAGE_SIZE, PAGE_SIZE);
 
     if ( !gicv2.map_cbase[0] || !gicv2.map_cbase[1] )
         panic("GIC-HIP04: Failed to ioremap for GIC CPU interface\n");
@@ -688,7 +684,7 @@ static int __init hip04gic_init(void)
     if ( !gicv2.map_hbase )
         panic("GIC-HIP04: Failed to ioremap for GIC Virtual interface\n");
 
-    vgic_v2_setup_hw(dbase, cbase, vbase);
+    vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0);
 
     /* Global settings: interrupt distributor */
     spin_lock_init(&gicv2.lock);
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 2b18c8c..01e36b5 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -65,7 +65,7 @@
 /* Global state */
 static struct {
     void __iomem * map_dbase; /* IO mapped Address of distributor registers */
-    void __iomem * map_cbase[2]; /* IO mapped Address of CPU interface registers */
+    void __iomem * map_cbase; /* IO mapped Address of CPU interface registers */
     void __iomem * map_hbase; /* IO Address of virtual interface registers */
     spinlock_t lock;
 } gicv2;
@@ -98,16 +98,12 @@ static inline uint32_t readl_gicd(unsigned int offset)
 
 static inline void writel_gicc(uint32_t val, unsigned int offset)
 {
-    unsigned int page = offset >> PAGE_SHIFT;
-    offset &= ~PAGE_MASK;
-    writel_relaxed(val, gicv2.map_cbase[page] + offset);
+    writel_relaxed(val, gicv2.map_cbase + offset);
 }
 
 static inline uint32_t readl_gicc(unsigned int offset)
 {
-    unsigned int page = offset >> PAGE_SHIFT;
-    offset &= ~PAGE_MASK;
-    return readl_relaxed(gicv2.map_cbase[page] + offset);
+    return readl_relaxed(gicv2.map_cbase + offset);
 }
 
 static inline void writel_gich(uint32_t val, unsigned int offset)
@@ -614,12 +610,31 @@ static hw_irq_controller gicv2_guest_irq_type = {
     .set_affinity = gicv2_irq_set_affinity,
 };
 
+static bool_t gicv2_is_aliased(paddr_t cbase, paddr_t csize)
+{
+    uint32_t val_low, val_high;
+
+    if ( csize != SZ_128K )
+        return false;
+
+    /*
+     * Verify that we have the first 4kB of a GIC400
+     * aliased over the first 64kB by checking the
+     * GICC_IIDR register on both ends.
+     */
+    val_low = readl_gicc(GICC_IIDR);
+    val_high = readl_gicc(GICC_IIDR + 0xf000);
+
+    return ((val_low & 0xfff0fff) == 0x0202043B && val_low == val_high);
+}
+
 static int __init gicv2_init(void)
 {
     int res;
     paddr_t hbase, dbase;
     paddr_t cbase, csize;
     paddr_t vbase, vsize;
+    uint32_t aliased_offset = 0;
     const struct dt_device_node *node = gicv2_info.node;
 
     res = dt_device_get_address(node, 0, &dbase, NULL);
@@ -683,21 +698,33 @@ static int __init gicv2_init(void)
     if ( !gicv2.map_dbase )
         panic("GICv2: Failed to ioremap for GIC distributor\n");
 
-    gicv2.map_cbase[0] = ioremap_nocache(cbase, PAGE_SIZE);
-
-    if ( platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        gicv2.map_cbase[1] = ioremap_nocache(cbase + SZ_64K, PAGE_SIZE);
-    else
-        gicv2.map_cbase[1] = ioremap_nocache(cbase + PAGE_SIZE, PAGE_SIZE);
-
-    if ( !gicv2.map_cbase[0] || !gicv2.map_cbase[1] )
+    gicv2.map_cbase = ioremap_nocache(cbase, csize);
+    if ( !gicv2.map_cbase )
         panic("GICv2: Failed to ioremap for GIC CPU interface\n");
 
+    if ( gicv2_is_aliased(cbase, csize) )
+    {
+        /*
+         * Move the base up by 60kB, so that we have a 8kB contiguous
+         * region, which allows us to use GICC_DIR at its
+         * normal offset.
+         * Note the variable cbase is not updated as we need the original
+         * value for the vGICv2 emulation.
+         */
+        aliased_offset = 0xf000;
+
+        gicv2.map_cbase += aliased_offset;
+
+        printk(XENLOG_WARNING
+               "GICv2: Adjusting CPU interface base to %#"PRIx64"\n",
+               cbase + aliased_offset);
+    }
+
     gicv2.map_hbase = ioremap_nocache(hbase, PAGE_SIZE);
     if ( !gicv2.map_hbase )
         panic("GICv2: Failed to ioremap for GIC Virtual interface\n");
 
-    vgic_v2_setup_hw(dbase, cbase, vbase);
+    vgic_v2_setup_hw(dbase, cbase, csize, vbase, aliased_offset);
 
     /* Global settings: interrupt distributor */
     spin_lock_init(&gicv2.lock);
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 9833a8d..4fe0c37 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1143,7 +1143,7 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
                                  paddr_t dbase)
 {
     int res;
-    paddr_t cbase;
+    paddr_t cbase, csize;
     paddr_t vbase, vsize;
 
     /*
@@ -1151,7 +1151,7 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
      * provided.
      */
     res = dt_device_get_address(node, 1 + gicv3.rdist_count,
-                                &cbase, NULL);
+                                &cbase, &csize);
     if ( res )
         return;
 
@@ -1177,7 +1177,7 @@ static void __init gicv3_init_v2(const struct dt_device_node *node,
     printk("GICv3 compatible with GICv2 cbase %#"PRIpaddr" vbase %#"PRIpaddr"\n",
            cbase, vbase);
 
-    vgic_v2_setup_hw(dbase, cbase, vbase);
+    vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0);
 }
 
 /* Set up the GIC */
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 8b05ed5..70cb655 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -68,11 +68,6 @@ static void __init xgene_check_pirq_eoi(void)
               "Please upgrade your firmware to the latest version");
 }
 
-static uint32_t xgene_storm_quirks(void)
-{
-    return PLATFORM_QUIRK_GIC_64K_STRIDE;
-}
-
 static void xgene_storm_reset(void)
 {
     void __iomem *addr;
@@ -122,7 +117,6 @@ PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .init = xgene_storm_init,
     .reset = xgene_storm_reset,
-    .quirks = xgene_storm_quirks,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 2d63e12..f7d784b 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -36,18 +36,25 @@ static struct {
     bool_t enabled;
     /* Distributor interface address */
     paddr_t dbase;
-    /* CPU interface address */
+    /* CPU interface address & size */
     paddr_t cbase;
+    paddr_t csize;
     /* Virtual CPU interface address */
     paddr_t vbase;
+
+    /* Offset to add to get an 8kB contiguous region if GIC is aliased */
+    uint32_t aliased_offset;
 } vgic_v2_hw;
 
-void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t vbase)
+void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
+                      paddr_t vbase, uint32_t aliased_offset)
 {
     vgic_v2_hw.enabled = 1;
     vgic_v2_hw.dbase = dbase;
     vgic_v2_hw.cbase = cbase;
+    vgic_v2_hw.csize = csize;
     vgic_v2_hw.vbase = vbase;
+    vgic_v2_hw.aliased_offset = aliased_offset;
 }
 
 static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
@@ -524,7 +531,8 @@ static int vgic_v2_vcpu_init(struct vcpu *v)
 static int vgic_v2_domain_init(struct domain *d)
 {
     int i, ret;
-    paddr_t cbase;
+    paddr_t cbase, csize;
+    paddr_t vbase;
 
     /*
      * The hardware domain gets the hardware address.
@@ -533,33 +541,38 @@ static int vgic_v2_domain_init(struct domain *d)
     if ( is_hardware_domain(d) )
     {
         d->arch.vgic.dbase = vgic_v2_hw.dbase;
+        /*
+         * For the hardware domain, we always map the whole HW CPU
+         * interface region in order to match the device tree (the "reg"
+         * properties is copied as it is).
+         * Note that we assume the size of the CPU interface is always
+         * aligned to PAGE_SIZE.
+         */
         cbase = vgic_v2_hw.cbase;
+        csize = vgic_v2_hw.csize;
+        vbase = vgic_v2_hw.vbase;
     }
     else
     {
         d->arch.vgic.dbase = GUEST_GICD_BASE;
+        /*
+         * The CPU interface exposed to the guest is always 8kB. We may
+         * need to add an offset to the virtual CPU interface base
+         * address when in the GIC is aliased to get a 8kB contiguous
+         * region.
+         */
+        BUILD_BUG_ON(GUEST_GICC_SIZE != SZ_8K);
         cbase = GUEST_GICC_BASE;
+        csize = GUEST_GICC_SIZE;
+        vbase = vgic_v2_hw.vbase + vgic_v2_hw.aliased_offset;
     }
 
     /*
      * Map the gic virtual cpu interface in the gic cpu interface
      * region of the guest.
-     *
-     * The second page is always mapped at +4K irrespective of the
-     * GIC_64K_STRIDE quirk. The DTB passed to the guest reflects this.
      */
-    ret = map_mmio_regions(d, paddr_to_pfn(cbase), 1,
-                           paddr_to_pfn(vgic_v2_hw.vbase));
-    if ( ret )
-        return ret;
-
-    if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
-                               1, paddr_to_pfn(vgic_v2_hw.vbase + PAGE_SIZE));
-    else
-        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
-                               1, paddr_to_pfn(vgic_v2_hw.vbase + SZ_64K));
-
+    ret = map_mmio_regions(d, paddr_to_pfn(cbase), csize / PAGE_SIZE,
+                           paddr_to_pfn(vbase));
     if ( ret )
         return ret;
 
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 6d53f97..0116481 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -76,6 +76,7 @@
 #define GICC_HPPIR      (0x0018)
 #define GICC_APR        (0x00D0)
 #define GICC_NSAPR      (0x00E0)
+#define GICC_IIDR       (0x00FC)
 #define GICC_DIR        (0x1000)
 
 #define GICH_HCR        (0x00)
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index b8fc5ac..5e462ac 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -39,12 +39,6 @@ struct platform_desc {
     const struct dt_device_match *blacklist_dev;
 };
 
-/*
- * Quirk for platforms where the 4K GIC register ranges are placed at
- * 64K stride.
- */
-#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 0)
-
 void __init platform_init(void);
 int __init platform_init_time(void);
 int __init platform_specific_mapping(struct domain *d);
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index ba74d0f..cb51a9e 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -248,7 +248,8 @@ static inline int vgic_allocate_spi(struct domain *d)
 
 extern void vgic_free_virq(struct domain *d, unsigned int virq);
 
-void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t vbase);
+void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
+                      paddr_t vbase, uint32_t aliased_offset);
 
 #ifdef HAS_GICV3
 struct rdist_region;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:13:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkCf-0001oh-86; Thu, 29 Oct 2015 10:13:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCe-0001oW-NN
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:04 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	E2/D4-03763-031F1365; Thu, 29 Oct 2015 10:13:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446113580!56661300!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2410 invoked from network); 29 Oct 2015 10:13:01 -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 Oct 2015 10:13:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCa-0004b8-D3
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCa-0005Ac-9t
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:00 +0000
Date: Thu, 29 Oct 2015 10:13:00 +0000
Message-Id: <E1ZrkCa-0005Ac-9t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: platform: Drop the quirks
	callback
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 14fa16961b03a23e9b883e5f0ed06b6837a489d8
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:54 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:28:26 2015 +0100

    xen/arm: platform: Drop the quirks callback
    
    All the quirks have been replaced by proper detection. Lets drop the
    callback and hope that no one will need new quirks.
    
    At the same time, remove the definition of platform_dom0_evtchn_ppi
    which is not used any more.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- typos ]
---
 xen/arch/arm/platform.c        |   10 ----------
 xen/include/asm-arm/platform.h |    8 --------
 2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 0af6d57..b0bfaa9 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -127,16 +127,6 @@ void platform_poweroff(void)
         platform->poweroff();
 }
 
-bool_t platform_has_quirk(uint32_t quirk)
-{
-    uint32_t quirks = 0;
-
-    if ( platform && platform->quirks )
-        quirks = platform->quirks();
-
-    return !!(quirks & quirk);
-}
-
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node)
 {
     const struct dt_device_match *blacklist = NULL;
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index 5e462ac..f97315d 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -27,12 +27,6 @@ struct platform_desc {
     /* Platform power-off */
     void (*poweroff)(void);
     /*
-     * Platform quirks
-     * Defined has a function because a platform can support multiple
-     * board with different quirk on each
-     */
-    uint32_t (*quirks)(void);
-    /*
      * Platform blacklist devices
      * List of devices which must not pass-through to a guest
      */
@@ -48,9 +42,7 @@ int platform_cpu_up(int cpu);
 #endif
 void platform_reset(void);
 void platform_poweroff(void);
-bool_t platform_has_quirk(uint32_t quirk);
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
-unsigned int platform_dom0_evtchn_ppi(void);
 
 #define PLATFORM_START(_name, _namestr)                         \
 static const struct platform_desc  __plat_desc_##_name __used   \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:13:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrkCf-0001oh-86; Thu, 29 Oct 2015 10:13:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCe-0001oW-NN
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:04 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	E2/D4-03763-031F1365; Thu, 29 Oct 2015 10:13:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446113580!56661300!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2410 invoked from network); 29 Oct 2015 10:13:01 -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 Oct 2015 10:13:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCa-0004b8-D3
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCa-0005Ac-9t
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:00 +0000
Date: Thu, 29 Oct 2015 10:13:00 +0000
Message-Id: <E1ZrkCa-0005Ac-9t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: platform: Drop the quirks
	callback
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 14fa16961b03a23e9b883e5f0ed06b6837a489d8
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:54 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:28:26 2015 +0100

    xen/arm: platform: Drop the quirks callback
    
    All the quirks have been replaced by proper detection. Lets drop the
    callback and hope that no one will need new quirks.
    
    At the same time, remove the definition of platform_dom0_evtchn_ppi
    which is not used any more.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- typos ]
---
 xen/arch/arm/platform.c        |   10 ----------
 xen/include/asm-arm/platform.h |    8 --------
 2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 0af6d57..b0bfaa9 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -127,16 +127,6 @@ void platform_poweroff(void)
         platform->poweroff();
 }
 
-bool_t platform_has_quirk(uint32_t quirk)
-{
-    uint32_t quirks = 0;
-
-    if ( platform && platform->quirks )
-        quirks = platform->quirks();
-
-    return !!(quirks & quirk);
-}
-
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node)
 {
     const struct dt_device_match *blacklist = NULL;
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index 5e462ac..f97315d 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -27,12 +27,6 @@ struct platform_desc {
     /* Platform power-off */
     void (*poweroff)(void);
     /*
-     * Platform quirks
-     * Defined has a function because a platform can support multiple
-     * board with different quirk on each
-     */
-    uint32_t (*quirks)(void);
-    /*
      * Platform blacklist devices
      * List of devices which must not pass-through to a guest
      */
@@ -48,9 +42,7 @@ int platform_cpu_up(int cpu);
 #endif
 void platform_reset(void);
 void platform_poweroff(void);
-bool_t platform_has_quirk(uint32_t quirk);
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
-unsigned int platform_dom0_evtchn_ppi(void);
 
 #define PLATFORM_START(_name, _namestr)                         \
 static const struct platform_desc  __plat_desc_##_name __used   \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:13:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkCq-0001ql-Ac; Thu, 29 Oct 2015 10:13:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCp-0001qX-FB
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:15 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	47/92-12831-A31F1365; Thu, 29 Oct 2015 10:13:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1446113591!9564065!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 19399 invoked from network); 29 Oct 2015 10:13:12 -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;
	29 Oct 2015 10:13:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCk-0004bf-VR
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCk-0005CB-LO
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:10 +0000
Date: Thu, 29 Oct 2015 10:13:10 +0000
Message-Id: <E1ZrkCk-0005CB-LO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add support of PSCI v1.0 for
	the host
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2831f2099b6175384817d7afd952f7918998b39a
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 12 16:39:11 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:31:36 2015 +0100

    xen/arm: Add support of PSCI v1.0 for the host
    
    From Xen's point of view, PSCI v0.2 and PSCI v1.0 are very similar. All
    the PSCI calls used within Xen (PSCI_VERSION, CPU_ON, SYSTEM_OFF and
    SYSTEM_RESET) behave exactly the same.
    
    Furthermore, based on the spec (5.3.1 DEN0022C), any 1.y version must be
    compatible with 1.x when y > x for any functions existing in 1.x.
    
    So check the presence of the new compatible string [1] and allow Xen to
    boot on any platform using PSCI 1.x.
    
    [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/374547.html
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/psci.c        |   17 +++++++++++++----
 xen/include/asm-arm/psci.h |   13 +++++++++++++
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 172c6e7..44ccc2f 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -109,10 +109,16 @@ int __init psci_init_0_1(void)
 
 int __init psci_init_0_2(void)
 {
+    static const struct dt_device_match psci_ids[] __initconst =
+    {
+        DT_MATCH_COMPATIBLE("arm,psci-0.2"),
+        DT_MATCH_COMPATIBLE("arm,psci-1.0"),
+        { /* sentinel */ },
+    };
     int ret;
     const struct dt_device_node *psci;
 
-    psci = dt_find_compatible_node(NULL, NULL, "arm,psci-0.2");
+    psci = dt_find_matching_node(NULL, psci_ids);
     if ( !psci )
         return -EOPNOTSUPP;
 
@@ -122,15 +128,18 @@ int __init psci_init_0_2(void)
 
     psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);
 
-    if ( psci_ver != XEN_PSCI_V_0_2 )
+    /* For the moment, we only support PSCI 0.2 and PSCI 1.x */
+    if ( psci_ver != PSCI_VERSION(0, 2) && PSCI_VERSION_MAJOR(psci_ver != 1) )
     {
-        printk("Error: PSCI version %#x is not supported.\n", psci_ver);
+        printk("Error: Unrecognized PSCI version %u.%u\n",
+               PSCI_VERSION_MAJOR(psci_ver), PSCI_VERSION_MINOR(psci_ver));
         return -EOPNOTSUPP;
     }
 
     psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(CPU_ON);
 
-    printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
+    printk(XENLOG_INFO "Using PSCI-%u.%u for SMP bringup\n",
+           PSCI_VERSION_MAJOR(psci_ver), PSCI_VERSION_MINOR(psci_ver));
 
     return 0;
 }
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 5d17ee3..d8a109f 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -87,6 +87,19 @@ void do_psci_0_2_system_reset(void);
 #define PSCI_0_2_POWER_STATE_TYPE_MASK      \
                     (0x1 << PSCI_0_2_POWER_STATE_TYPE_SHIFT)
 
+/* PSCI version decoding (independent of PSCI version) */
+#define PSCI_VERSION_MAJOR_SHIFT            16
+#define PSCI_VERSION_MINOR_MASK             \
+        ((1U << PSCI_VERSION_MAJOR_SHIFT) - 1)
+#define PSCI_VERSION_MAJOR_MASK             ~PSCI_VERSION_MINOR_MASK
+#define PSCI_VERSION_MAJOR(ver)             \
+        (((ver) & PSCI_VERSION_MAJOR_MASK) >> PSCI_VERSION_MAJOR_SHIFT)
+#define PSCI_VERSION_MINOR(ver)             \
+        ((ver) & PSCI_VERSION_MINOR_MASK)
+
+#define PSCI_VERSION(major, minor)          \
+    (((major) << PSCI_VERSION_MAJOR_SHIFT) | (minor))
+
 #endif /* __ASM_PSCI_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:13:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkCq-0001ql-Ac; Thu, 29 Oct 2015 10:13:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCp-0001qX-FB
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:15 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	47/92-12831-A31F1365; Thu, 29 Oct 2015 10:13:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1446113591!9564065!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 19399 invoked from network); 29 Oct 2015 10:13:12 -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;
	29 Oct 2015 10:13:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCk-0004bf-VR
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCk-0005CB-LO
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:10 +0000
Date: Thu, 29 Oct 2015 10:13:10 +0000
Message-Id: <E1ZrkCk-0005CB-LO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add support of PSCI v1.0 for
	the host
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2831f2099b6175384817d7afd952f7918998b39a
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 12 16:39:11 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:31:36 2015 +0100

    xen/arm: Add support of PSCI v1.0 for the host
    
    From Xen's point of view, PSCI v0.2 and PSCI v1.0 are very similar. All
    the PSCI calls used within Xen (PSCI_VERSION, CPU_ON, SYSTEM_OFF and
    SYSTEM_RESET) behave exactly the same.
    
    Furthermore, based on the spec (5.3.1 DEN0022C), any 1.y version must be
    compatible with 1.x when y > x for any functions existing in 1.x.
    
    So check the presence of the new compatible string [1] and allow Xen to
    boot on any platform using PSCI 1.x.
    
    [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/374547.html
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/psci.c        |   17 +++++++++++++----
 xen/include/asm-arm/psci.h |   13 +++++++++++++
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 172c6e7..44ccc2f 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -109,10 +109,16 @@ int __init psci_init_0_1(void)
 
 int __init psci_init_0_2(void)
 {
+    static const struct dt_device_match psci_ids[] __initconst =
+    {
+        DT_MATCH_COMPATIBLE("arm,psci-0.2"),
+        DT_MATCH_COMPATIBLE("arm,psci-1.0"),
+        { /* sentinel */ },
+    };
     int ret;
     const struct dt_device_node *psci;
 
-    psci = dt_find_compatible_node(NULL, NULL, "arm,psci-0.2");
+    psci = dt_find_matching_node(NULL, psci_ids);
     if ( !psci )
         return -EOPNOTSUPP;
 
@@ -122,15 +128,18 @@ int __init psci_init_0_2(void)
 
     psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);
 
-    if ( psci_ver != XEN_PSCI_V_0_2 )
+    /* For the moment, we only support PSCI 0.2 and PSCI 1.x */
+    if ( psci_ver != PSCI_VERSION(0, 2) && PSCI_VERSION_MAJOR(psci_ver != 1) )
     {
-        printk("Error: PSCI version %#x is not supported.\n", psci_ver);
+        printk("Error: Unrecognized PSCI version %u.%u\n",
+               PSCI_VERSION_MAJOR(psci_ver), PSCI_VERSION_MINOR(psci_ver));
         return -EOPNOTSUPP;
     }
 
     psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(CPU_ON);
 
-    printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
+    printk(XENLOG_INFO "Using PSCI-%u.%u for SMP bringup\n",
+           PSCI_VERSION_MAJOR(psci_ver), PSCI_VERSION_MINOR(psci_ver));
 
     return 0;
 }
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 5d17ee3..d8a109f 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -87,6 +87,19 @@ void do_psci_0_2_system_reset(void);
 #define PSCI_0_2_POWER_STATE_TYPE_MASK      \
                     (0x1 << PSCI_0_2_POWER_STATE_TYPE_SHIFT)
 
+/* PSCI version decoding (independent of PSCI version) */
+#define PSCI_VERSION_MAJOR_SHIFT            16
+#define PSCI_VERSION_MINOR_MASK             \
+        ((1U << PSCI_VERSION_MAJOR_SHIFT) - 1)
+#define PSCI_VERSION_MAJOR_MASK             ~PSCI_VERSION_MINOR_MASK
+#define PSCI_VERSION_MAJOR(ver)             \
+        (((ver) & PSCI_VERSION_MAJOR_MASK) >> PSCI_VERSION_MAJOR_SHIFT)
+#define PSCI_VERSION_MINOR(ver)             \
+        ((ver) & PSCI_VERSION_MINOR_MASK)
+
+#define PSCI_VERSION(major, minor)          \
+    (((major) << PSCI_VERSION_MAJOR_SHIFT) | (minor))
+
 #endif /* __ASM_PSCI_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:13:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkCz-0001sv-F3; Thu, 29 Oct 2015 10:13: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 1ZrkCx-0001sZ-Vv
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:24 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	3E/1A-31450-341F1365; Thu, 29 Oct 2015 10:13:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1446113601!9564126!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21182 invoked from network); 29 Oct 2015 10:13:22 -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;
	29 Oct 2015 10:13:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCv-0004br-Aa
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCv-0005D1-8C
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:21 +0000
Date: Thu, 29 Oct 2015 10:13:21 +0000
Message-Id: <E1ZrkCv-0005D1-8C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Replace XEN_PSCI_* by
	PSCI_VERSION(major, minor)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63ad168925a3f6190db393dc38835fedb1b791e3
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 12 16:39:12 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:32:00 2015 +0100

    xen/arm: Replace XEN_PSCI_* by PSCI_VERSION(major, minor)
    
    It will avoid to introduce a new XEN_PSCI_* define every time we support
    a new version of PSCI in Xen.
    
    Also fix the coding style in modified place.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/psci.c        |    6 +++---
 xen/arch/arm/vpsci.c       |   15 ++++++++-------
 xen/include/asm-arm/psci.h |    4 ----
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 44ccc2f..d800cb6 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -46,13 +46,13 @@ int call_psci_cpu_on(int cpu)
 
 void call_psci_system_off(void)
 {
-    if ( psci_ver > XEN_PSCI_V_0_1 )
+    if ( psci_ver > PSCI_VERSION(0, 1) )
         call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
 }
 
 void call_psci_system_reset(void)
 {
-    if ( psci_ver > XEN_PSCI_V_0_1 )
+    if ( psci_ver > PSCI_VERSION(0, 1) )
         call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
 }
 
@@ -100,7 +100,7 @@ int __init psci_init_0_1(void)
         return -ENOENT;
     }
 
-    psci_ver = XEN_PSCI_V_0_1;
+    psci_ver = PSCI_VERSION(0, 1);
 
     printk(XENLOG_INFO "Using PSCI-0.1 for SMP bringup\n");
 
diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
index aebe1e2..0e024f7 100644
--- a/xen/arch/arm/vpsci.c
+++ b/xen/arch/arm/vpsci.c
@@ -41,8 +41,8 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
     if ( is_64bit_domain(d) && is_thumb )
         return PSCI_INVALID_PARAMETERS;
 
-    if( ( ver == XEN_PSCI_V_0_2 ) &&
-            ( !test_bit(_VPF_down, &v->pause_flags) ) )
+    if ( (ver == PSCI_VERSION(0, 2)) &&
+            !test_bit(_VPF_down, &v->pause_flags) )
         return PSCI_ALREADY_ON;
 
     if ( (ctxt = alloc_vcpu_guest_context()) == NULL )
@@ -59,14 +59,14 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
     if ( is_32bit_domain(d) )
     {
         ctxt->user_regs.cpsr = PSR_GUEST32_INIT;
-        if( ver == XEN_PSCI_V_0_2 )
+        if ( ver == PSCI_VERSION(0, 2) )
             ctxt->user_regs.r0_usr = context_id;
     }
 #ifdef CONFIG_ARM_64
     else
     {
         ctxt->user_regs.cpsr = PSR_GUEST64_INIT;
-        if( ver == XEN_PSCI_V_0_2 )
+        if ( ver == PSCI_VERSION(0, 2) )
             ctxt->user_regs.x0 = context_id;
     }
 #endif
@@ -94,7 +94,7 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
 
 int32_t do_psci_cpu_on(uint32_t vcpuid, register_t entry_point)
 {
-    return do_common_cpu_on(vcpuid,entry_point,0,XEN_PSCI_V_0_1);
+    return do_common_cpu_on(vcpuid, entry_point, 0 , PSCI_VERSION(0, 1));
 }
 
 int32_t do_psci_cpu_off(uint32_t power_state)
@@ -107,7 +107,7 @@ int32_t do_psci_cpu_off(uint32_t power_state)
 
 uint32_t do_psci_0_2_version(void)
 {
-    return XEN_PSCI_V_0_2;
+    return PSCI_VERSION(0, 2);
 }
 
 register_t do_psci_0_2_cpu_suspend(uint32_t power_state, register_t entry_point,
@@ -132,7 +132,8 @@ int32_t do_psci_0_2_cpu_off(void)
 int32_t do_psci_0_2_cpu_on(register_t target_cpu, register_t entry_point,
                        register_t context_id)
 {
-    return do_common_cpu_on(target_cpu,entry_point,context_id,XEN_PSCI_V_0_2);
+    return do_common_cpu_on(target_cpu, entry_point, context_id,
+                            PSCI_VERSION(0, 2));
 }
 
 static const unsigned long target_affinity_mask[] = {
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index d8a109f..be2458a 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -41,10 +41,6 @@ register_t do_psci_0_2_migrate_info_up_cpu(void);
 void do_psci_0_2_system_off(void);
 void do_psci_0_2_system_reset(void);
 
-/* PSCI version */
-#define XEN_PSCI_V_0_1 1
-#define XEN_PSCI_V_0_2 2
-
 /* PSCI v0.2 interface */
 #define PSCI_0_2_FN_BASE        0x84000000
 #define PSCI_0_2_FN(n)          (PSCI_0_2_FN_BASE + (n))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:13:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkCz-0001sv-F3; Thu, 29 Oct 2015 10:13: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 1ZrkCx-0001sZ-Vv
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:24 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	3E/1A-31450-341F1365; Thu, 29 Oct 2015 10:13:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1446113601!9564126!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21182 invoked from network); 29 Oct 2015 10:13:22 -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;
	29 Oct 2015 10:13:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCv-0004br-Aa
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkCv-0005D1-8C
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:21 +0000
Date: Thu, 29 Oct 2015 10:13:21 +0000
Message-Id: <E1ZrkCv-0005D1-8C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Replace XEN_PSCI_* by
	PSCI_VERSION(major, minor)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63ad168925a3f6190db393dc38835fedb1b791e3
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 12 16:39:12 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:32:00 2015 +0100

    xen/arm: Replace XEN_PSCI_* by PSCI_VERSION(major, minor)
    
    It will avoid to introduce a new XEN_PSCI_* define every time we support
    a new version of PSCI in Xen.
    
    Also fix the coding style in modified place.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/psci.c        |    6 +++---
 xen/arch/arm/vpsci.c       |   15 ++++++++-------
 xen/include/asm-arm/psci.h |    4 ----
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 44ccc2f..d800cb6 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -46,13 +46,13 @@ int call_psci_cpu_on(int cpu)
 
 void call_psci_system_off(void)
 {
-    if ( psci_ver > XEN_PSCI_V_0_1 )
+    if ( psci_ver > PSCI_VERSION(0, 1) )
         call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
 }
 
 void call_psci_system_reset(void)
 {
-    if ( psci_ver > XEN_PSCI_V_0_1 )
+    if ( psci_ver > PSCI_VERSION(0, 1) )
         call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
 }
 
@@ -100,7 +100,7 @@ int __init psci_init_0_1(void)
         return -ENOENT;
     }
 
-    psci_ver = XEN_PSCI_V_0_1;
+    psci_ver = PSCI_VERSION(0, 1);
 
     printk(XENLOG_INFO "Using PSCI-0.1 for SMP bringup\n");
 
diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
index aebe1e2..0e024f7 100644
--- a/xen/arch/arm/vpsci.c
+++ b/xen/arch/arm/vpsci.c
@@ -41,8 +41,8 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
     if ( is_64bit_domain(d) && is_thumb )
         return PSCI_INVALID_PARAMETERS;
 
-    if( ( ver == XEN_PSCI_V_0_2 ) &&
-            ( !test_bit(_VPF_down, &v->pause_flags) ) )
+    if ( (ver == PSCI_VERSION(0, 2)) &&
+            !test_bit(_VPF_down, &v->pause_flags) )
         return PSCI_ALREADY_ON;
 
     if ( (ctxt = alloc_vcpu_guest_context()) == NULL )
@@ -59,14 +59,14 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
     if ( is_32bit_domain(d) )
     {
         ctxt->user_regs.cpsr = PSR_GUEST32_INIT;
-        if( ver == XEN_PSCI_V_0_2 )
+        if ( ver == PSCI_VERSION(0, 2) )
             ctxt->user_regs.r0_usr = context_id;
     }
 #ifdef CONFIG_ARM_64
     else
     {
         ctxt->user_regs.cpsr = PSR_GUEST64_INIT;
-        if( ver == XEN_PSCI_V_0_2 )
+        if ( ver == PSCI_VERSION(0, 2) )
             ctxt->user_regs.x0 = context_id;
     }
 #endif
@@ -94,7 +94,7 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
 
 int32_t do_psci_cpu_on(uint32_t vcpuid, register_t entry_point)
 {
-    return do_common_cpu_on(vcpuid,entry_point,0,XEN_PSCI_V_0_1);
+    return do_common_cpu_on(vcpuid, entry_point, 0 , PSCI_VERSION(0, 1));
 }
 
 int32_t do_psci_cpu_off(uint32_t power_state)
@@ -107,7 +107,7 @@ int32_t do_psci_cpu_off(uint32_t power_state)
 
 uint32_t do_psci_0_2_version(void)
 {
-    return XEN_PSCI_V_0_2;
+    return PSCI_VERSION(0, 2);
 }
 
 register_t do_psci_0_2_cpu_suspend(uint32_t power_state, register_t entry_point,
@@ -132,7 +132,8 @@ int32_t do_psci_0_2_cpu_off(void)
 int32_t do_psci_0_2_cpu_on(register_t target_cpu, register_t entry_point,
                        register_t context_id)
 {
-    return do_common_cpu_on(target_cpu,entry_point,context_id,XEN_PSCI_V_0_2);
+    return do_common_cpu_on(target_cpu, entry_point, context_id,
+                            PSCI_VERSION(0, 2));
 }
 
 static const unsigned long target_affinity_mask[] = {
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index d8a109f..be2458a 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -41,10 +41,6 @@ register_t do_psci_0_2_migrate_info_up_cpu(void);
 void do_psci_0_2_system_off(void);
 void do_psci_0_2_system_reset(void);
 
-/* PSCI version */
-#define XEN_PSCI_V_0_1 1
-#define XEN_PSCI_V_0_2 2
-
 /* PSCI v0.2 interface */
 #define PSCI_0_2_FN_BASE        0x84000000
 #define PSCI_0_2_FN(n)          (PSCI_0_2_FN_BASE + (n))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:13:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkDA-0001uc-Ha; Thu, 29 Oct 2015 10:13:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkD9-0001uS-Kk
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:35 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	39/24-14900-E41F1365; Thu, 29 Oct 2015 10:13:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446113611!56661544!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10693 invoked from network); 29 Oct 2015 10:13:32 -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 Oct 2015 10:13:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkD5-0004bw-JC
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkD5-0005E3-I4
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:31 +0000
Date: Thu, 29 Oct 2015 10:13:31 +0000
Message-Id: <E1ZrkD5-0005E3-I4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Do not call assert() in signal
	handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd84a2baadd4a5767d2568b1c01b055328cc84db
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 22 16:39:12 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:32:45 2015 +0100

    libxl: Do not call assert() in signal handlers
    
    assert is not async-signal-safe.
    
    In practice the effect of calling assert there is that if the
    assertion fails we might get a secondary crash, or other undesirable
    behaviour from stdio (which is how assert usually reports failures).
    
    Mention in a comment in libxl__self_pipe_wakeup that it has to be
    async-signal-safe.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.c       |    3 ++-
 tools/libxl/libxl_fork.c        |    2 +-
 tools/libxl/libxl_save_helper.c |    7 +++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 7d549ad..0df6d6c 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1564,6 +1564,7 @@ int libxl__pipe_nonblock(libxl_ctx *ctx, int fds[2])
 
 int libxl__self_pipe_wakeup(int fd)
 {
+    /* Called from signal handlers, so needs to be async-signal-safe */
     static const char buf[1] = "";
 
     for (;;) {
@@ -1572,7 +1573,7 @@ int libxl__self_pipe_wakeup(int fd)
         assert(r==-1);
         if (errno == EINTR) continue;
         if (errno == EWOULDBLOCK) return 0;
-        assert(errno);
+        if (!errno) abort();
         return errno;
     }
 }
diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c
index 024c1e2..eea3d5d 100644
--- a/tools/libxl/libxl_fork.c
+++ b/tools/libxl/libxl_fork.c
@@ -239,7 +239,7 @@ static void sigchld_handler(int signo)
 
     LIBXL_LIST_FOREACH(notify, &sigchld_users, sigchld_users_entry) {
         int e = libxl__self_pipe_wakeup(notify->sigchld_selfpipe[1]);
-        assert(!e); /* errors are probably EBADF, very bad */
+        if (e) abort(); /* errors are probably EBADF, very bad */
     }
 
     r = pthread_mutex_unlock(&sigchld_defer_mutex);
diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index 57ae978..39038f9 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -148,8 +148,11 @@ static void save_signal_handler(int num)
     int esave = errno;
 
     int r = dup2(unwriteable_fd, io_fd);
-    assert(r == io_fd); /* if not we can't write an xtl message because we
-                         * might end up interleaving on our control stream */
+    if (r != io_fd)
+        /* we can't write an xtl message because we might end up
+         * interleaving on our control stream; we can't use stdio
+         * because it's not async-signal-safe */
+        abort();
 
     errno = esave;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:13:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkDA-0001uc-Ha; Thu, 29 Oct 2015 10:13:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkD9-0001uS-Kk
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:35 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	39/24-14900-E41F1365; Thu, 29 Oct 2015 10:13:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446113611!56661544!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10693 invoked from network); 29 Oct 2015 10:13:32 -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 Oct 2015 10:13:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkD5-0004bw-JC
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkD5-0005E3-I4
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:31 +0000
Date: Thu, 29 Oct 2015 10:13:31 +0000
Message-Id: <E1ZrkD5-0005E3-I4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Do not call assert() in signal
	handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd84a2baadd4a5767d2568b1c01b055328cc84db
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 22 16:39:12 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 23 14:32:45 2015 +0100

    libxl: Do not call assert() in signal handlers
    
    assert is not async-signal-safe.
    
    In practice the effect of calling assert there is that if the
    assertion fails we might get a secondary crash, or other undesirable
    behaviour from stdio (which is how assert usually reports failures).
    
    Mention in a comment in libxl__self_pipe_wakeup that it has to be
    async-signal-safe.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.c       |    3 ++-
 tools/libxl/libxl_fork.c        |    2 +-
 tools/libxl/libxl_save_helper.c |    7 +++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 7d549ad..0df6d6c 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1564,6 +1564,7 @@ int libxl__pipe_nonblock(libxl_ctx *ctx, int fds[2])
 
 int libxl__self_pipe_wakeup(int fd)
 {
+    /* Called from signal handlers, so needs to be async-signal-safe */
     static const char buf[1] = "";
 
     for (;;) {
@@ -1572,7 +1573,7 @@ int libxl__self_pipe_wakeup(int fd)
         assert(r==-1);
         if (errno == EINTR) continue;
         if (errno == EWOULDBLOCK) return 0;
-        assert(errno);
+        if (!errno) abort();
         return errno;
     }
 }
diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c
index 024c1e2..eea3d5d 100644
--- a/tools/libxl/libxl_fork.c
+++ b/tools/libxl/libxl_fork.c
@@ -239,7 +239,7 @@ static void sigchld_handler(int signo)
 
     LIBXL_LIST_FOREACH(notify, &sigchld_users, sigchld_users_entry) {
         int e = libxl__self_pipe_wakeup(notify->sigchld_selfpipe[1]);
-        assert(!e); /* errors are probably EBADF, very bad */
+        if (e) abort(); /* errors are probably EBADF, very bad */
     }
 
     r = pthread_mutex_unlock(&sigchld_defer_mutex);
diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index 57ae978..39038f9 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -148,8 +148,11 @@ static void save_signal_handler(int num)
     int esave = errno;
 
     int r = dup2(unwriteable_fd, io_fd);
-    assert(r == io_fd); /* if not we can't write an xtl message because we
-                         * might end up interleaving on our control stream */
+    if (r != io_fd)
+        /* we can't write an xtl message because we might end up
+         * interleaving on our control stream; we can't use stdio
+         * because it's not async-signal-safe */
+        abort();
 
     errno = esave;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:13:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkDJ-0001wH-KA; Thu, 29 Oct 2015 10:13: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 1ZrkDI-0001w4-3Z
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:44 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	FC/A7-24494-751F1365; Thu, 29 Oct 2015 10:13:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446113622!16165662!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23231 invoked from network); 29 Oct 2015 10:13:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 10:13:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDF-0004c8-Rl
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDF-0005Em-Q4
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:41 +0000
Date: Thu, 29 Oct 2015 10:13:41 +0000
Message-Id: <E1ZrkDF-0005Em-Q4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: don't build core parking 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 e896ad9a9164a432538789fa2993a1084fd0a387
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 26 13:56:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 13:56:39 2015 +0100

    arm: don't build core parking code
    
    It's wired up on x86 only.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/Rules.mk |    1 +
 xen/common/Makefile   |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 4a04a8a..42de328 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -13,6 +13,7 @@ HAS_EHCI := y
 HAS_KEXEC := y
 HAS_GDBSX := y
 HAS_PDX := y
+HAS_CORE_PARKING := y
 xenoprof := y
 
 CFLAGS += -I$(BASEDIR)/include 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index b290c16..a7829db 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -1,5 +1,5 @@
 obj-y += bitmap.o
-obj-y += core_parking.o
+obj-$(HAS_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
 obj-y += cpupool.o
 obj-$(HAS_DEVICE_TREE) += device_tree.o
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:13:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkDJ-0001wH-KA; Thu, 29 Oct 2015 10:13: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 1ZrkDI-0001w4-3Z
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:44 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	FC/A7-24494-751F1365; Thu, 29 Oct 2015 10:13:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446113622!16165662!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23231 invoked from network); 29 Oct 2015 10:13:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 10:13:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDF-0004c8-Rl
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDF-0005Em-Q4
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:41 +0000
Date: Thu, 29 Oct 2015 10:13:41 +0000
Message-Id: <E1ZrkDF-0005Em-Q4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: don't build core parking 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 e896ad9a9164a432538789fa2993a1084fd0a387
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 26 13:56:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 13:56:39 2015 +0100

    arm: don't build core parking code
    
    It's wired up on x86 only.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/Rules.mk |    1 +
 xen/common/Makefile   |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 4a04a8a..42de328 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -13,6 +13,7 @@ HAS_EHCI := y
 HAS_KEXEC := y
 HAS_GDBSX := y
 HAS_PDX := y
+HAS_CORE_PARKING := y
 xenoprof := y
 
 CFLAGS += -I$(BASEDIR)/include 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index b290c16..a7829db 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -1,5 +1,5 @@
 obj-y += bitmap.o
-obj-y += core_parking.o
+obj-$(HAS_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
 obj-y += cpupool.o
 obj-$(HAS_DEVICE_TREE) += device_tree.o
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:13:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkDU-0001yA-Mc; Thu, 29 Oct 2015 10:13:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDT-0001xw-Ow
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:55 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	2F/F3-25435-261F1365; Thu, 29 Oct 2015 10:13:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446113632!62514859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1573 invoked from network); 29 Oct 2015 10:13: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;
	29 Oct 2015 10:13:54 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDQ-0004cG-86
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDQ-0005FE-5t
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:52 +0000
Date: Thu, 29 Oct 2015 10:13:52 +0000
Message-Id: <E1ZrkDQ-0005FE-5t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: pod: use the correct memory
	flags for alloc_domheap_page{, s}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 69176a4b9c27796bb4cde1e13f28f5eace425400
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 26 13:58:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 13:58:35 2015 +0100

    x86/mm: pod: use the correct memory flags for alloc_domheap_page{,s}
    
    The last parameter of alloc_domheap_page{s,} contain the memory flags and
    not the order of the allocation.
    
    Use 0 for the call in p2m_pod_set_cache_target as it was before
    1069d63c5ef2510d08b83b2171af660e5bb18c63 "x86/mm/p2m: use defines for
    page sizes". Note that PAGE_ORDER_4K is also equal to 0 so the behavior
    stays the same.
    
    For the call in p2m_pod_offline_or_broken_replace we want to allocate
    the new page on the same numa node as the previous page. So retrieve the
    numa node and pass it in the memory flags.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Tested-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 901da37..acd85ea 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -222,7 +222,7 @@ p2m_pod_set_cache_target(struct p2m_domain *p2m, unsigned long pod_target, int p
         else
             order = PAGE_ORDER_4K;
     retry:
-        page = alloc_domheap_pages(d, order, PAGE_ORDER_4K);
+        page = alloc_domheap_pages(d, order, 0);
         if ( unlikely(page == NULL) )
         {
             if ( order == PAGE_ORDER_2M )
@@ -471,13 +471,14 @@ p2m_pod_offline_or_broken_replace(struct page_info *p)
 {
     struct domain *d;
     struct p2m_domain *p2m;
+    nodeid_t node = phys_to_nid(page_to_maddr(p));
 
     if ( !(d = page_get_owner(p)) || !(p2m = p2m_get_hostp2m(d)) )
         return;
 
     free_domheap_page(p);
 
-    p = alloc_domheap_page(d, PAGE_ORDER_4K);
+    p = alloc_domheap_page(d, MEMF_node(node));
     if ( unlikely(!p) )
         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 Oct 29 10:13:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:13: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 1ZrkDU-0001yA-Mc; Thu, 29 Oct 2015 10:13:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDT-0001xw-Ow
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:55 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	2F/F3-25435-261F1365; Thu, 29 Oct 2015 10:13:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446113632!62514859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1573 invoked from network); 29 Oct 2015 10:13: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;
	29 Oct 2015 10:13:54 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDQ-0004cG-86
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDQ-0005FE-5t
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:13:52 +0000
Date: Thu, 29 Oct 2015 10:13:52 +0000
Message-Id: <E1ZrkDQ-0005FE-5t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: pod: use the correct memory
	flags for alloc_domheap_page{, s}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 69176a4b9c27796bb4cde1e13f28f5eace425400
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 26 13:58:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 13:58:35 2015 +0100

    x86/mm: pod: use the correct memory flags for alloc_domheap_page{,s}
    
    The last parameter of alloc_domheap_page{s,} contain the memory flags and
    not the order of the allocation.
    
    Use 0 for the call in p2m_pod_set_cache_target as it was before
    1069d63c5ef2510d08b83b2171af660e5bb18c63 "x86/mm/p2m: use defines for
    page sizes". Note that PAGE_ORDER_4K is also equal to 0 so the behavior
    stays the same.
    
    For the call in p2m_pod_offline_or_broken_replace we want to allocate
    the new page on the same numa node as the previous page. So retrieve the
    numa node and pass it in the memory flags.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Tested-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 901da37..acd85ea 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -222,7 +222,7 @@ p2m_pod_set_cache_target(struct p2m_domain *p2m, unsigned long pod_target, int p
         else
             order = PAGE_ORDER_4K;
     retry:
-        page = alloc_domheap_pages(d, order, PAGE_ORDER_4K);
+        page = alloc_domheap_pages(d, order, 0);
         if ( unlikely(page == NULL) )
         {
             if ( order == PAGE_ORDER_2M )
@@ -471,13 +471,14 @@ p2m_pod_offline_or_broken_replace(struct page_info *p)
 {
     struct domain *d;
     struct p2m_domain *p2m;
+    nodeid_t node = phys_to_nid(page_to_maddr(p));
 
     if ( !(d = page_get_owner(p)) || !(p2m = p2m_get_hostp2m(d)) )
         return;
 
     free_domheap_page(p);
 
-    p = alloc_domheap_page(d, PAGE_ORDER_4K);
+    p = alloc_domheap_page(d, MEMF_node(node));
     if ( unlikely(!p) )
         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 Oct 29 10:14:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkDh-000202-PL; Thu, 29 Oct 2015 10:14:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDf-0001zn-LV
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:08 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	7A/B3-12889-E61F1365; Thu, 29 Oct 2015 10:14:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1446113642!62485582!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 6922 invoked from network); 29 Oct 2015 10:14:04 -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;
	29 Oct 2015 10:14:04 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDa-0004cq-Jc
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDa-0005Fr-FQ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:02 +0000
Date: Thu, 29 Oct 2015 10:14:02 +0000
Message-Id: <E1ZrkDa-0005Fr-FQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: helpers for cpu feature
	manipulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7729eed1a51b417c029a32d1e6b94eb0751d1643
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 26 14:01:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 14:01:50 2015 +0100

    x86: helpers for cpu feature manipulation
    
    Expose them to assembly code, and replace open-coded versions.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/boot/head.S         |    2 +-
 xen/arch/x86/boot/trampoline.S   |    2 +-
 xen/arch/x86/cpu/common.c        |    4 +-
 xen/arch/x86/efi/efi-boot.h      |    2 +-
 xen/arch/x86/hvm/hvm.c           |   10 ++--
 xen/arch/x86/traps.c             |    2 +-
 xen/arch/x86/xstate.c            |    4 +-
 xen/include/asm-x86/amd.h        |   89 ++++++++++++++++++-------------------
 xen/include/asm-x86/asm_defns.h  |    2 +-
 xen/include/asm-x86/cpufeature.h |    7 +++-
 10 files changed, 63 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index f63b349..ac4962b 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -142,7 +142,7 @@ __start:
         mov     %edx,sym_phys(boot_cpu_data)+CPUINFO_FEATURE_OFFSET(X86_FEATURE_LM)
 
         /* Check for availability of long mode. */
-        bt      $X86_FEATURE_LM & 0x1f,%edx
+        bt      $cpufeat_bit(X86_FEATURE_LM),%edx
         jnc     bad_cpu
 
         /* Stash TSC to calculate a good approximation of time-since-boot */
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 8b0d9c1..c8f32cd 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -89,7 +89,7 @@ trampoline_protmode_entry:
         movl    $MSR_EFER,%ecx
         rdmsr
         or      $EFER_LME|EFER_SCE,%eax   /* Long Mode + SYSCALL/SYSRET */
-        bt      $X86_FEATURE_NX % 32,%edi /* No Execute? */
+        bt      $cpufeat_bit(X86_FEATURE_NX),%edi /* No Execute? */
         jnc     1f
         btsl    $_EFER_NX,%eax  /* No Execute     */
 1:      wrmsr
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index f256444..a5caa84 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -202,7 +202,7 @@ static void __init early_cpu_detect(void)
 	c->x86_mask = tfms & 15;
 	cap0 &= ~cleared_caps[0];
 	cap4 &= ~cleared_caps[4];
-	if (cap0 & (1<<19))
+	if (cap0 & cpufeat_mask(X86_FEATURE_CLFLSH))
 		c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
 	/* Leaf 0x1 capabilities filled in early for Xen. */
 	c->x86_capability[0] = cap0;
@@ -263,7 +263,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	if ( c->cpuid_level >= 0x00000007 ) {
 		u32 dummy;
 		cpuid_count(0x00000007, 0, &dummy, &ebx, &dummy, &dummy);
-		c->x86_capability[X86_FEATURE_FSGSBASE / 32] = ebx;
+		c->x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)] = ebx;
 	}
 }
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 4c7f383..d8ca862 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -225,7 +225,7 @@ static void __init noreturn efi_arch_post_exit_boot(void)
     asm volatile("pushq $0\n\tpopfq");
     rdmsrl(MSR_EFER, efer);
     efer |= EFER_SCE;
-    if ( cpuid_ext_features & (1 << (X86_FEATURE_NX & 0x1f)) )
+    if ( cpuid_ext_features & cpufeat_mask(X86_FEATURE_NX) )
         efer |= EFER_NX;
     wrmsrl(MSR_EFER, efer);
     write_cr0(X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP |
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3fa2280..965bfbf 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1850,8 +1850,8 @@ static const char * hvm_efer_valid(const struct vcpu *v, uint64_t value,
     }
     else
     {
-        ext1_edx = boot_cpu_data.x86_capability[X86_FEATURE_LM / 32];
-        ext1_ecx = boot_cpu_data.x86_capability[X86_FEATURE_SVM / 32];
+        ext1_edx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_LM)];
+        ext1_ecx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_SVM)];
     }
 
     /*
@@ -1917,9 +1917,9 @@ static unsigned long hvm_cr4_guest_reserved_bits(const struct vcpu *v,
     }
     else
     {
-        leaf1_edx = boot_cpu_data.x86_capability[X86_FEATURE_VME / 32];
-        leaf1_ecx = boot_cpu_data.x86_capability[X86_FEATURE_PCID / 32];
-        leaf7_0_ebx = boot_cpu_data.x86_capability[X86_FEATURE_FSGSBASE / 32];
+        leaf1_edx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_VME)];
+        leaf1_ecx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_PCID)];
+        leaf7_0_ebx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)];
     }
 
     return ~(unsigned long)
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8093535..b32f696 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -935,7 +935,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
             goto unsupported;
         if ( regs->_ecx == 1 )
         {
-            a &= boot_cpu_data.x86_capability[X86_FEATURE_XSAVEOPT / 32];
+            a &= boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)];
             if ( !cpu_has_xsaves )
                 b = c = d = 0;
         }
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 9ddff90..c6238d9 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -326,9 +326,9 @@ void xstate_init(struct cpuinfo_x86 *c)
     eax &= (cpufeat_mask(X86_FEATURE_XSAVEOPT) |
             cpufeat_mask(X86_FEATURE_XSAVEC));
 
-    c->x86_capability[X86_FEATURE_XSAVEOPT / 32] = eax;
+    c->x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)] = eax;
 
-    BUG_ON(eax != boot_cpu_data.x86_capability[X86_FEATURE_XSAVEOPT / 32]);
+    BUG_ON(eax != boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)]);
 }
 
 static bool_t valid_xcr0(u64 xcr0)
diff --git a/xen/include/asm-x86/amd.h b/xen/include/asm-x86/amd.h
index 87b6e3e..bb23bea 100644
--- a/xen/include/asm-x86/amd.h
+++ b/xen/include/asm-x86/amd.h
@@ -9,95 +9,92 @@
 
 /* CPUID masked for use by AMD-V Extended Migration */
 
-#define X86_FEATURE_BITPOS(_feature_) ((_feature_) % 32)
-#define __bit(_x_) (1U << X86_FEATURE_BITPOS(_x_))
-
 /* Family 0Fh, Revision C */
 #define AMD_FEATURES_K8_REV_C_ECX  0
-#define AMD_FEATURES_K8_REV_C_EDX (					\
-	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
-	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
-	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
-	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
-	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
-	__bit(X86_FEATURE_SEP)      | __bit(X86_FEATURE_MTRR)  |	\
-	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   | 	\
-	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
-	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_CLFLSH)|	\
-	__bit(X86_FEATURE_MMX)      | __bit(X86_FEATURE_FXSR)  | 	\
-	__bit(X86_FEATURE_XMM)      | __bit(X86_FEATURE_XMM2))
-#define AMD_EXTFEATURES_K8_REV_C_ECX  0 
-#define AMD_EXTFEATURES_K8_REV_C_EDX  (					\
-	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
-	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
-	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
-	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
-	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
-	__bit(X86_FEATURE_SYSCALL)  | __bit(X86_FEATURE_MTRR)  |	\
-	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   |	\
-	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
-	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_NX)    |	\
-	__bit(X86_FEATURE_MMXEXT)   | __bit(X86_FEATURE_MMX)   |	\
-	__bit(X86_FEATURE_FXSR)     | __bit(X86_FEATURE_LM)    |	\
-	__bit(X86_FEATURE_3DNOWEXT) | __bit(X86_FEATURE_3DNOW))
+#define AMD_FEATURES_K8_REV_C_EDX (					    \
+	cpufeat_mask(X86_FEATURE_FPU)   | cpufeat_mask(X86_FEATURE_VME)   | \
+	cpufeat_mask(X86_FEATURE_DE)    | cpufeat_mask(X86_FEATURE_PSE)   | \
+	cpufeat_mask(X86_FEATURE_TSC)   | cpufeat_mask(X86_FEATURE_MSR)   | \
+	cpufeat_mask(X86_FEATURE_PAE)   | cpufeat_mask(X86_FEATURE_MCE)   | \
+	cpufeat_mask(X86_FEATURE_CX8)   | cpufeat_mask(X86_FEATURE_APIC)  | \
+	cpufeat_mask(X86_FEATURE_SEP)   | cpufeat_mask(X86_FEATURE_MTRR)  | \
+	cpufeat_mask(X86_FEATURE_PGE)   | cpufeat_mask(X86_FEATURE_MCA)   | \
+	cpufeat_mask(X86_FEATURE_CMOV)  | cpufeat_mask(X86_FEATURE_PAT)   | \
+	cpufeat_mask(X86_FEATURE_PSE36) | cpufeat_mask(X86_FEATURE_CLFLSH)| \
+	cpufeat_mask(X86_FEATURE_MMX)   | cpufeat_mask(X86_FEATURE_FXSR)  | \
+	cpufeat_mask(X86_FEATURE_XMM)   | cpufeat_mask(X86_FEATURE_XMM2))
+#define AMD_EXTFEATURES_K8_REV_C_ECX  0
+#define AMD_EXTFEATURES_K8_REV_C_EDX  (					       \
+	cpufeat_mask(X86_FEATURE_FPU)	   | cpufeat_mask(X86_FEATURE_VME)   | \
+	cpufeat_mask(X86_FEATURE_DE)	   | cpufeat_mask(X86_FEATURE_PSE)   | \
+	cpufeat_mask(X86_FEATURE_TSC)	   | cpufeat_mask(X86_FEATURE_MSR)   | \
+	cpufeat_mask(X86_FEATURE_PAE)	   | cpufeat_mask(X86_FEATURE_MCE)   | \
+	cpufeat_mask(X86_FEATURE_CX8)	   | cpufeat_mask(X86_FEATURE_APIC)  | \
+	cpufeat_mask(X86_FEATURE_SYSCALL)  | cpufeat_mask(X86_FEATURE_MTRR)  | \
+	cpufeat_mask(X86_FEATURE_PGE)	   | cpufeat_mask(X86_FEATURE_MCA)   | \
+	cpufeat_mask(X86_FEATURE_CMOV)	   | cpufeat_mask(X86_FEATURE_PAT)   | \
+	cpufeat_mask(X86_FEATURE_PSE36)	   | cpufeat_mask(X86_FEATURE_NX)    | \
+	cpufeat_mask(X86_FEATURE_MMXEXT)   | cpufeat_mask(X86_FEATURE_MMX)   | \
+	cpufeat_mask(X86_FEATURE_FXSR)	   | cpufeat_mask(X86_FEATURE_LM)    | \
+	cpufeat_mask(X86_FEATURE_3DNOWEXT) | cpufeat_mask(X86_FEATURE_3DNOW))
 
 /* Family 0Fh, Revision D */
 #define AMD_FEATURES_K8_REV_D_ECX         AMD_FEATURES_K8_REV_C_ECX
 #define AMD_FEATURES_K8_REV_D_EDX         AMD_FEATURES_K8_REV_C_EDX
 #define AMD_EXTFEATURES_K8_REV_D_ECX     (AMD_EXTFEATURES_K8_REV_C_ECX |\
-	__bit(X86_FEATURE_LAHF_LM))
+	cpufeat_mask(X86_FEATURE_LAHF_LM))
 #define AMD_EXTFEATURES_K8_REV_D_EDX     (AMD_EXTFEATURES_K8_REV_C_EDX |\
-	__bit(X86_FEATURE_FFXSR))
+	cpufeat_mask(X86_FEATURE_FFXSR))
 
 /* Family 0Fh, Revision E */
 #define AMD_FEATURES_K8_REV_E_ECX        (AMD_FEATURES_K8_REV_D_ECX |	\
-	__bit(X86_FEATURE_XMM3))
+	cpufeat_mask(X86_FEATURE_XMM3))
 #define AMD_FEATURES_K8_REV_E_EDX        (AMD_FEATURES_K8_REV_D_EDX | 	\
-	__bit(X86_FEATURE_HT))
+	cpufeat_mask(X86_FEATURE_HT))
 #define AMD_EXTFEATURES_K8_REV_E_ECX     (AMD_EXTFEATURES_K8_REV_D_ECX |\
-	__bit(X86_FEATURE_CMP_LEGACY)) 
+	cpufeat_mask(X86_FEATURE_CMP_LEGACY))
 #define AMD_EXTFEATURES_K8_REV_E_EDX      AMD_EXTFEATURES_K8_REV_D_EDX
 
 /* Family 0Fh, Revision F */
 #define AMD_FEATURES_K8_REV_F_ECX        (AMD_FEATURES_K8_REV_E_ECX | 	\
-	__bit(X86_FEATURE_CX16))
+	cpufeat_mask(X86_FEATURE_CX16))
 #define AMD_FEATURES_K8_REV_F_EDX         AMD_FEATURES_K8_REV_E_EDX
 #define AMD_EXTFEATURES_K8_REV_F_ECX     (AMD_EXTFEATURES_K8_REV_E_ECX |\
-	__bit(X86_FEATURE_SVM) | __bit(X86_FEATURE_EXTAPIC) |	        \
-	__bit(X86_FEATURE_CR8_LEGACY))
+	cpufeat_mask(X86_FEATURE_SVM) | cpufeat_mask(X86_FEATURE_EXTAPIC) | \
+	cpufeat_mask(X86_FEATURE_CR8_LEGACY))
 #define AMD_EXTFEATURES_K8_REV_F_EDX     (AMD_EXTFEATURES_K8_REV_E_EDX |\
-	__bit(X86_FEATURE_RDTSCP))
+	cpufeat_mask(X86_FEATURE_RDTSCP))
 
 /* Family 0Fh, Revision G */
 #define AMD_FEATURES_K8_REV_G_ECX         AMD_FEATURES_K8_REV_F_ECX
 #define AMD_FEATURES_K8_REV_G_EDX         AMD_FEATURES_K8_REV_F_EDX
 #define AMD_EXTFEATURES_K8_REV_G_ECX     (AMD_EXTFEATURES_K8_REV_F_ECX |\
-	__bit(X86_FEATURE_3DNOWPREFETCH))
+	cpufeat_mask(X86_FEATURE_3DNOWPREFETCH))
 #define AMD_EXTFEATURES_K8_REV_G_EDX      AMD_EXTFEATURES_K8_REV_F_EDX
 
 /* Family 10h, Revision B */
 #define AMD_FEATURES_FAM10h_REV_B_ECX    (AMD_FEATURES_K8_REV_F_ECX | 	\
-	__bit(X86_FEATURE_POPCNT) | __bit(X86_FEATURE_MWAIT))
+	cpufeat_mask(X86_FEATURE_POPCNT) | cpufeat_mask(X86_FEATURE_MWAIT))
 #define AMD_FEATURES_FAM10h_REV_B_EDX     AMD_FEATURES_K8_REV_F_EDX
 #define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
-	__bit(X86_FEATURE_ABM) | __bit(X86_FEATURE_SSE4A) | 		\
-	__bit(X86_FEATURE_MISALIGNSSE) | __bit(X86_FEATURE_OSVW) | 	\
-	__bit(X86_FEATURE_IBS))
+	cpufeat_mask(X86_FEATURE_ABM) | cpufeat_mask(X86_FEATURE_SSE4A) | \
+	cpufeat_mask(X86_FEATURE_MISALIGNSSE) | cpufeat_mask(X86_FEATURE_OSVW) |\
+	cpufeat_mask(X86_FEATURE_IBS))
 #define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\
-	__bit(X86_FEATURE_PAGE1GB))
+	cpufeat_mask(X86_FEATURE_PAGE1GB))
 
 /* Family 10h, Revision C */
 #define AMD_FEATURES_FAM10h_REV_C_ECX     AMD_FEATURES_FAM10h_REV_B_ECX
 #define AMD_FEATURES_FAM10h_REV_C_EDX     AMD_FEATURES_FAM10h_REV_B_EDX
 #define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\
-	__bit(X86_FEATURE_SKINIT) | __bit(X86_FEATURE_WDT))
+	cpufeat_mask(X86_FEATURE_SKINIT) | cpufeat_mask(X86_FEATURE_WDT))
 #define AMD_EXTFEATURES_FAM10h_REV_C_EDX  AMD_EXTFEATURES_FAM10h_REV_B_EDX
 
 /* Family 11h, Revision B */
 #define AMD_FEATURES_FAM11h_REV_B_ECX     AMD_FEATURES_K8_REV_G_ECX
 #define AMD_FEATURES_FAM11h_REV_B_EDX     AMD_FEATURES_K8_REV_G_EDX
 #define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\
-	__bit(X86_FEATURE_SKINIT))
+	cpufeat_mask(X86_FEATURE_SKINIT))
 #define AMD_EXTFEATURES_FAM11h_REV_B_EDX  AMD_EXTFEATURES_K8_REV_G_EDX
 
 /* AMD errata checking
diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index 7c8c2c0..d750f03 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -137,7 +137,7 @@ void ret_from_intr(void);
 #endif
 
 #define CPUINFO_FEATURE_OFFSET(feature)           \
-        ((((feature) >> 3) & ~3) + CPUINFO_features)
+    (CPUINFO_features + (cpufeat_word(feature) * 4))
 
 #else
 
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index e94b04d..e823954 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -9,6 +9,8 @@
 #define __ASM_I386_CPUFEATURE_H
 #endif
 
+#include <xen/const.h>
+
 #define NCAPINTS	8	/* N 32-bit words worth of info */
 
 /* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */
@@ -160,12 +162,15 @@
 #define X86_FEATURE_ADX		(7*32+19) /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
 
+#define cpufeat_word(idx)	((idx) / 32)
+#define cpufeat_bit(idx)	((idx) % 32)
+#define cpufeat_mask(idx)	(_AC(1, U) << cpufeat_bit(idx))
+
 #if !defined(__ASSEMBLY__) && !defined(X86_FEATURES_ONLY)
 #include <xen/bitops.h>
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)
-#define cpufeat_mask(idx)       (1u << ((idx) & 31))
 
 #define CPUID_MWAIT_LEAF                5
 #define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:14:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkDh-000202-PL; Thu, 29 Oct 2015 10:14:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDf-0001zn-LV
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:08 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	7A/B3-12889-E61F1365; Thu, 29 Oct 2015 10:14:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1446113642!62485582!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 6922 invoked from network); 29 Oct 2015 10:14:04 -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;
	29 Oct 2015 10:14:04 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDa-0004cq-Jc
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDa-0005Fr-FQ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:02 +0000
Date: Thu, 29 Oct 2015 10:14:02 +0000
Message-Id: <E1ZrkDa-0005Fr-FQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: helpers for cpu feature
	manipulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7729eed1a51b417c029a32d1e6b94eb0751d1643
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 26 14:01:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 14:01:50 2015 +0100

    x86: helpers for cpu feature manipulation
    
    Expose them to assembly code, and replace open-coded versions.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/boot/head.S         |    2 +-
 xen/arch/x86/boot/trampoline.S   |    2 +-
 xen/arch/x86/cpu/common.c        |    4 +-
 xen/arch/x86/efi/efi-boot.h      |    2 +-
 xen/arch/x86/hvm/hvm.c           |   10 ++--
 xen/arch/x86/traps.c             |    2 +-
 xen/arch/x86/xstate.c            |    4 +-
 xen/include/asm-x86/amd.h        |   89 ++++++++++++++++++-------------------
 xen/include/asm-x86/asm_defns.h  |    2 +-
 xen/include/asm-x86/cpufeature.h |    7 +++-
 10 files changed, 63 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index f63b349..ac4962b 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -142,7 +142,7 @@ __start:
         mov     %edx,sym_phys(boot_cpu_data)+CPUINFO_FEATURE_OFFSET(X86_FEATURE_LM)
 
         /* Check for availability of long mode. */
-        bt      $X86_FEATURE_LM & 0x1f,%edx
+        bt      $cpufeat_bit(X86_FEATURE_LM),%edx
         jnc     bad_cpu
 
         /* Stash TSC to calculate a good approximation of time-since-boot */
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 8b0d9c1..c8f32cd 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -89,7 +89,7 @@ trampoline_protmode_entry:
         movl    $MSR_EFER,%ecx
         rdmsr
         or      $EFER_LME|EFER_SCE,%eax   /* Long Mode + SYSCALL/SYSRET */
-        bt      $X86_FEATURE_NX % 32,%edi /* No Execute? */
+        bt      $cpufeat_bit(X86_FEATURE_NX),%edi /* No Execute? */
         jnc     1f
         btsl    $_EFER_NX,%eax  /* No Execute     */
 1:      wrmsr
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index f256444..a5caa84 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -202,7 +202,7 @@ static void __init early_cpu_detect(void)
 	c->x86_mask = tfms & 15;
 	cap0 &= ~cleared_caps[0];
 	cap4 &= ~cleared_caps[4];
-	if (cap0 & (1<<19))
+	if (cap0 & cpufeat_mask(X86_FEATURE_CLFLSH))
 		c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
 	/* Leaf 0x1 capabilities filled in early for Xen. */
 	c->x86_capability[0] = cap0;
@@ -263,7 +263,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	if ( c->cpuid_level >= 0x00000007 ) {
 		u32 dummy;
 		cpuid_count(0x00000007, 0, &dummy, &ebx, &dummy, &dummy);
-		c->x86_capability[X86_FEATURE_FSGSBASE / 32] = ebx;
+		c->x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)] = ebx;
 	}
 }
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 4c7f383..d8ca862 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -225,7 +225,7 @@ static void __init noreturn efi_arch_post_exit_boot(void)
     asm volatile("pushq $0\n\tpopfq");
     rdmsrl(MSR_EFER, efer);
     efer |= EFER_SCE;
-    if ( cpuid_ext_features & (1 << (X86_FEATURE_NX & 0x1f)) )
+    if ( cpuid_ext_features & cpufeat_mask(X86_FEATURE_NX) )
         efer |= EFER_NX;
     wrmsrl(MSR_EFER, efer);
     write_cr0(X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP |
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3fa2280..965bfbf 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1850,8 +1850,8 @@ static const char * hvm_efer_valid(const struct vcpu *v, uint64_t value,
     }
     else
     {
-        ext1_edx = boot_cpu_data.x86_capability[X86_FEATURE_LM / 32];
-        ext1_ecx = boot_cpu_data.x86_capability[X86_FEATURE_SVM / 32];
+        ext1_edx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_LM)];
+        ext1_ecx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_SVM)];
     }
 
     /*
@@ -1917,9 +1917,9 @@ static unsigned long hvm_cr4_guest_reserved_bits(const struct vcpu *v,
     }
     else
     {
-        leaf1_edx = boot_cpu_data.x86_capability[X86_FEATURE_VME / 32];
-        leaf1_ecx = boot_cpu_data.x86_capability[X86_FEATURE_PCID / 32];
-        leaf7_0_ebx = boot_cpu_data.x86_capability[X86_FEATURE_FSGSBASE / 32];
+        leaf1_edx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_VME)];
+        leaf1_ecx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_PCID)];
+        leaf7_0_ebx = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)];
     }
 
     return ~(unsigned long)
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8093535..b32f696 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -935,7 +935,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
             goto unsupported;
         if ( regs->_ecx == 1 )
         {
-            a &= boot_cpu_data.x86_capability[X86_FEATURE_XSAVEOPT / 32];
+            a &= boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)];
             if ( !cpu_has_xsaves )
                 b = c = d = 0;
         }
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 9ddff90..c6238d9 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -326,9 +326,9 @@ void xstate_init(struct cpuinfo_x86 *c)
     eax &= (cpufeat_mask(X86_FEATURE_XSAVEOPT) |
             cpufeat_mask(X86_FEATURE_XSAVEC));
 
-    c->x86_capability[X86_FEATURE_XSAVEOPT / 32] = eax;
+    c->x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)] = eax;
 
-    BUG_ON(eax != boot_cpu_data.x86_capability[X86_FEATURE_XSAVEOPT / 32]);
+    BUG_ON(eax != boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)]);
 }
 
 static bool_t valid_xcr0(u64 xcr0)
diff --git a/xen/include/asm-x86/amd.h b/xen/include/asm-x86/amd.h
index 87b6e3e..bb23bea 100644
--- a/xen/include/asm-x86/amd.h
+++ b/xen/include/asm-x86/amd.h
@@ -9,95 +9,92 @@
 
 /* CPUID masked for use by AMD-V Extended Migration */
 
-#define X86_FEATURE_BITPOS(_feature_) ((_feature_) % 32)
-#define __bit(_x_) (1U << X86_FEATURE_BITPOS(_x_))
-
 /* Family 0Fh, Revision C */
 #define AMD_FEATURES_K8_REV_C_ECX  0
-#define AMD_FEATURES_K8_REV_C_EDX (					\
-	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
-	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
-	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
-	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
-	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
-	__bit(X86_FEATURE_SEP)      | __bit(X86_FEATURE_MTRR)  |	\
-	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   | 	\
-	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
-	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_CLFLSH)|	\
-	__bit(X86_FEATURE_MMX)      | __bit(X86_FEATURE_FXSR)  | 	\
-	__bit(X86_FEATURE_XMM)      | __bit(X86_FEATURE_XMM2))
-#define AMD_EXTFEATURES_K8_REV_C_ECX  0 
-#define AMD_EXTFEATURES_K8_REV_C_EDX  (					\
-	__bit(X86_FEATURE_FPU)      | __bit(X86_FEATURE_VME)   |	\
-	__bit(X86_FEATURE_DE)       | __bit(X86_FEATURE_PSE)   |	\
-	__bit(X86_FEATURE_TSC)      | __bit(X86_FEATURE_MSR)   |	\
-	__bit(X86_FEATURE_PAE)      | __bit(X86_FEATURE_MCE)   |	\
-	__bit(X86_FEATURE_CX8)      | __bit(X86_FEATURE_APIC)  |	\
-	__bit(X86_FEATURE_SYSCALL)  | __bit(X86_FEATURE_MTRR)  |	\
-	__bit(X86_FEATURE_PGE)      | __bit(X86_FEATURE_MCA)   |	\
-	__bit(X86_FEATURE_CMOV)     | __bit(X86_FEATURE_PAT)   |	\
-	__bit(X86_FEATURE_PSE36)    | __bit(X86_FEATURE_NX)    |	\
-	__bit(X86_FEATURE_MMXEXT)   | __bit(X86_FEATURE_MMX)   |	\
-	__bit(X86_FEATURE_FXSR)     | __bit(X86_FEATURE_LM)    |	\
-	__bit(X86_FEATURE_3DNOWEXT) | __bit(X86_FEATURE_3DNOW))
+#define AMD_FEATURES_K8_REV_C_EDX (					    \
+	cpufeat_mask(X86_FEATURE_FPU)   | cpufeat_mask(X86_FEATURE_VME)   | \
+	cpufeat_mask(X86_FEATURE_DE)    | cpufeat_mask(X86_FEATURE_PSE)   | \
+	cpufeat_mask(X86_FEATURE_TSC)   | cpufeat_mask(X86_FEATURE_MSR)   | \
+	cpufeat_mask(X86_FEATURE_PAE)   | cpufeat_mask(X86_FEATURE_MCE)   | \
+	cpufeat_mask(X86_FEATURE_CX8)   | cpufeat_mask(X86_FEATURE_APIC)  | \
+	cpufeat_mask(X86_FEATURE_SEP)   | cpufeat_mask(X86_FEATURE_MTRR)  | \
+	cpufeat_mask(X86_FEATURE_PGE)   | cpufeat_mask(X86_FEATURE_MCA)   | \
+	cpufeat_mask(X86_FEATURE_CMOV)  | cpufeat_mask(X86_FEATURE_PAT)   | \
+	cpufeat_mask(X86_FEATURE_PSE36) | cpufeat_mask(X86_FEATURE_CLFLSH)| \
+	cpufeat_mask(X86_FEATURE_MMX)   | cpufeat_mask(X86_FEATURE_FXSR)  | \
+	cpufeat_mask(X86_FEATURE_XMM)   | cpufeat_mask(X86_FEATURE_XMM2))
+#define AMD_EXTFEATURES_K8_REV_C_ECX  0
+#define AMD_EXTFEATURES_K8_REV_C_EDX  (					       \
+	cpufeat_mask(X86_FEATURE_FPU)	   | cpufeat_mask(X86_FEATURE_VME)   | \
+	cpufeat_mask(X86_FEATURE_DE)	   | cpufeat_mask(X86_FEATURE_PSE)   | \
+	cpufeat_mask(X86_FEATURE_TSC)	   | cpufeat_mask(X86_FEATURE_MSR)   | \
+	cpufeat_mask(X86_FEATURE_PAE)	   | cpufeat_mask(X86_FEATURE_MCE)   | \
+	cpufeat_mask(X86_FEATURE_CX8)	   | cpufeat_mask(X86_FEATURE_APIC)  | \
+	cpufeat_mask(X86_FEATURE_SYSCALL)  | cpufeat_mask(X86_FEATURE_MTRR)  | \
+	cpufeat_mask(X86_FEATURE_PGE)	   | cpufeat_mask(X86_FEATURE_MCA)   | \
+	cpufeat_mask(X86_FEATURE_CMOV)	   | cpufeat_mask(X86_FEATURE_PAT)   | \
+	cpufeat_mask(X86_FEATURE_PSE36)	   | cpufeat_mask(X86_FEATURE_NX)    | \
+	cpufeat_mask(X86_FEATURE_MMXEXT)   | cpufeat_mask(X86_FEATURE_MMX)   | \
+	cpufeat_mask(X86_FEATURE_FXSR)	   | cpufeat_mask(X86_FEATURE_LM)    | \
+	cpufeat_mask(X86_FEATURE_3DNOWEXT) | cpufeat_mask(X86_FEATURE_3DNOW))
 
 /* Family 0Fh, Revision D */
 #define AMD_FEATURES_K8_REV_D_ECX         AMD_FEATURES_K8_REV_C_ECX
 #define AMD_FEATURES_K8_REV_D_EDX         AMD_FEATURES_K8_REV_C_EDX
 #define AMD_EXTFEATURES_K8_REV_D_ECX     (AMD_EXTFEATURES_K8_REV_C_ECX |\
-	__bit(X86_FEATURE_LAHF_LM))
+	cpufeat_mask(X86_FEATURE_LAHF_LM))
 #define AMD_EXTFEATURES_K8_REV_D_EDX     (AMD_EXTFEATURES_K8_REV_C_EDX |\
-	__bit(X86_FEATURE_FFXSR))
+	cpufeat_mask(X86_FEATURE_FFXSR))
 
 /* Family 0Fh, Revision E */
 #define AMD_FEATURES_K8_REV_E_ECX        (AMD_FEATURES_K8_REV_D_ECX |	\
-	__bit(X86_FEATURE_XMM3))
+	cpufeat_mask(X86_FEATURE_XMM3))
 #define AMD_FEATURES_K8_REV_E_EDX        (AMD_FEATURES_K8_REV_D_EDX | 	\
-	__bit(X86_FEATURE_HT))
+	cpufeat_mask(X86_FEATURE_HT))
 #define AMD_EXTFEATURES_K8_REV_E_ECX     (AMD_EXTFEATURES_K8_REV_D_ECX |\
-	__bit(X86_FEATURE_CMP_LEGACY)) 
+	cpufeat_mask(X86_FEATURE_CMP_LEGACY))
 #define AMD_EXTFEATURES_K8_REV_E_EDX      AMD_EXTFEATURES_K8_REV_D_EDX
 
 /* Family 0Fh, Revision F */
 #define AMD_FEATURES_K8_REV_F_ECX        (AMD_FEATURES_K8_REV_E_ECX | 	\
-	__bit(X86_FEATURE_CX16))
+	cpufeat_mask(X86_FEATURE_CX16))
 #define AMD_FEATURES_K8_REV_F_EDX         AMD_FEATURES_K8_REV_E_EDX
 #define AMD_EXTFEATURES_K8_REV_F_ECX     (AMD_EXTFEATURES_K8_REV_E_ECX |\
-	__bit(X86_FEATURE_SVM) | __bit(X86_FEATURE_EXTAPIC) |	        \
-	__bit(X86_FEATURE_CR8_LEGACY))
+	cpufeat_mask(X86_FEATURE_SVM) | cpufeat_mask(X86_FEATURE_EXTAPIC) | \
+	cpufeat_mask(X86_FEATURE_CR8_LEGACY))
 #define AMD_EXTFEATURES_K8_REV_F_EDX     (AMD_EXTFEATURES_K8_REV_E_EDX |\
-	__bit(X86_FEATURE_RDTSCP))
+	cpufeat_mask(X86_FEATURE_RDTSCP))
 
 /* Family 0Fh, Revision G */
 #define AMD_FEATURES_K8_REV_G_ECX         AMD_FEATURES_K8_REV_F_ECX
 #define AMD_FEATURES_K8_REV_G_EDX         AMD_FEATURES_K8_REV_F_EDX
 #define AMD_EXTFEATURES_K8_REV_G_ECX     (AMD_EXTFEATURES_K8_REV_F_ECX |\
-	__bit(X86_FEATURE_3DNOWPREFETCH))
+	cpufeat_mask(X86_FEATURE_3DNOWPREFETCH))
 #define AMD_EXTFEATURES_K8_REV_G_EDX      AMD_EXTFEATURES_K8_REV_F_EDX
 
 /* Family 10h, Revision B */
 #define AMD_FEATURES_FAM10h_REV_B_ECX    (AMD_FEATURES_K8_REV_F_ECX | 	\
-	__bit(X86_FEATURE_POPCNT) | __bit(X86_FEATURE_MWAIT))
+	cpufeat_mask(X86_FEATURE_POPCNT) | cpufeat_mask(X86_FEATURE_MWAIT))
 #define AMD_FEATURES_FAM10h_REV_B_EDX     AMD_FEATURES_K8_REV_F_EDX
 #define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
-	__bit(X86_FEATURE_ABM) | __bit(X86_FEATURE_SSE4A) | 		\
-	__bit(X86_FEATURE_MISALIGNSSE) | __bit(X86_FEATURE_OSVW) | 	\
-	__bit(X86_FEATURE_IBS))
+	cpufeat_mask(X86_FEATURE_ABM) | cpufeat_mask(X86_FEATURE_SSE4A) | \
+	cpufeat_mask(X86_FEATURE_MISALIGNSSE) | cpufeat_mask(X86_FEATURE_OSVW) |\
+	cpufeat_mask(X86_FEATURE_IBS))
 #define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\
-	__bit(X86_FEATURE_PAGE1GB))
+	cpufeat_mask(X86_FEATURE_PAGE1GB))
 
 /* Family 10h, Revision C */
 #define AMD_FEATURES_FAM10h_REV_C_ECX     AMD_FEATURES_FAM10h_REV_B_ECX
 #define AMD_FEATURES_FAM10h_REV_C_EDX     AMD_FEATURES_FAM10h_REV_B_EDX
 #define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\
-	__bit(X86_FEATURE_SKINIT) | __bit(X86_FEATURE_WDT))
+	cpufeat_mask(X86_FEATURE_SKINIT) | cpufeat_mask(X86_FEATURE_WDT))
 #define AMD_EXTFEATURES_FAM10h_REV_C_EDX  AMD_EXTFEATURES_FAM10h_REV_B_EDX
 
 /* Family 11h, Revision B */
 #define AMD_FEATURES_FAM11h_REV_B_ECX     AMD_FEATURES_K8_REV_G_ECX
 #define AMD_FEATURES_FAM11h_REV_B_EDX     AMD_FEATURES_K8_REV_G_EDX
 #define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\
-	__bit(X86_FEATURE_SKINIT))
+	cpufeat_mask(X86_FEATURE_SKINIT))
 #define AMD_EXTFEATURES_FAM11h_REV_B_EDX  AMD_EXTFEATURES_K8_REV_G_EDX
 
 /* AMD errata checking
diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index 7c8c2c0..d750f03 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -137,7 +137,7 @@ void ret_from_intr(void);
 #endif
 
 #define CPUINFO_FEATURE_OFFSET(feature)           \
-        ((((feature) >> 3) & ~3) + CPUINFO_features)
+    (CPUINFO_features + (cpufeat_word(feature) * 4))
 
 #else
 
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index e94b04d..e823954 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -9,6 +9,8 @@
 #define __ASM_I386_CPUFEATURE_H
 #endif
 
+#include <xen/const.h>
+
 #define NCAPINTS	8	/* N 32-bit words worth of info */
 
 /* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */
@@ -160,12 +162,15 @@
 #define X86_FEATURE_ADX		(7*32+19) /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
 
+#define cpufeat_word(idx)	((idx) / 32)
+#define cpufeat_bit(idx)	((idx) % 32)
+#define cpufeat_mask(idx)	(_AC(1, U) << cpufeat_bit(idx))
+
 #if !defined(__ASSEMBLY__) && !defined(X86_FEATURES_ONLY)
 #include <xen/bitops.h>
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)
-#define cpufeat_mask(idx)       (1u << ((idx) & 31))
 
 #define CPUID_MWAIT_LEAF                5
 #define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:14:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkDv-000229-UB; Thu, 29 Oct 2015 10:14: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 1ZrkDu-00021z-8y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:22 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	D1/98-02804-D71F1365; Thu, 29 Oct 2015 10:14:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446113653!56661859!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 21300 invoked from network); 29 Oct 2015 10:14:14 -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 Oct 2015 10:14:14 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDk-0004cu-US
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDk-0005Gq-T5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:12 +0000
Date: Thu, 29 Oct 2015 10:14:12 +0000
Message-Id: <E1ZrkDk-0005Gq-T5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove assumptions about the
	layout of x86_capabilities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8ba3a9e444c6943199130eea32904bc245a6d27
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 26 14:02:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 14:02:30 2015 +0100

    x86: remove assumptions about the layout of x86_capabilities
    
    Future work will rearange it, invalidating these assumptions.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c           |    2 +-
 xen/arch/x86/cpu/centaur.c       |    6 ++----
 xen/arch/x86/cpu/common.c        |   18 ++++++++++--------
 xen/arch/x86/efi/efi-boot.h      |    3 ++-
 xen/arch/x86/mpparse.c           |    6 ++++--
 xen/include/asm-x86/cpufeature.h |    1 +
 6 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index fd57370..74a0152 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -444,7 +444,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 
 	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
 	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
-	__clear_bit(0*32+31, c->x86_capability);
+	__clear_bit(X86_FEATURE_3DNOW_ALT, c->x86_capability);
 	
 	if (c->x86 == 0xf && c->x86_model < 0x14
 	    && cpu_has(c, X86_FEATURE_LAHF_LM)) {
diff --git a/xen/arch/x86/cpu/centaur.c b/xen/arch/x86/cpu/centaur.c
index 66b1995..c0ac117 100644
--- a/xen/arch/x86/cpu/centaur.c
+++ b/xen/arch/x86/cpu/centaur.c
@@ -39,10 +39,8 @@ static void init_c3(struct cpuinfo_x86 *c)
 			printk(KERN_INFO "CPU: Enabled h/w RNG\n");
 		}
 
-		/* store Centaur Extended Feature Flags as
-		 * word 5 of the CPU capability bit array
-		 */
-		c->x86_capability[5] = cpuid_edx(0xC0000001);
+		c->x86_capability[cpufeat_word(X86_FEATURE_XSTORE)]
+                    = cpuid_edx(0xC0000001);
 	}
 
 	if (c->x86 == 0x6 && c->x86_model >= 0xf) {
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index a5caa84..653b052 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -200,13 +200,13 @@ static void __init early_cpu_detect(void)
 	if (c->x86 >= 0x6)
 		c->x86_model += ((tfms >> 16) & 0xF) << 4;
 	c->x86_mask = tfms & 15;
-	cap0 &= ~cleared_caps[0];
-	cap4 &= ~cleared_caps[4];
+	cap0 &= ~cleared_caps[cpufeat_word(X86_FEATURE_FPU)];
+	cap4 &= ~cleared_caps[cpufeat_word(X86_FEATURE_XMM3)];
 	if (cap0 & cpufeat_mask(X86_FEATURE_CLFLSH))
 		c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
 	/* Leaf 0x1 capabilities filled in early for Xen. */
-	c->x86_capability[0] = cap0;
-	c->x86_capability[4] = cap4;
+	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = cap0;
+	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = cap4;
 }
 
 static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
@@ -225,8 +225,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	
 	/* Intel-defined flags: level 0x00000001 */
 	cpuid(0x00000001, &tfms, &ebx, &excap, &capability);
-	c->x86_capability[0] = capability;
-	c->x86_capability[4] = excap;
+	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = capability;
+	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = excap;
 	c->x86 = (tfms >> 8) & 15;
 	c->x86_model = (tfms >> 4) & 15;
 	if (c->x86 == 0xf)
@@ -247,8 +247,10 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	c->extended_cpuid_level = cpuid_eax(0x80000000);
 	if ( (c->extended_cpuid_level & 0xffff0000) == 0x80000000 ) {
 		if ( c->extended_cpuid_level >= 0x80000001 ) {
-			c->x86_capability[1] = cpuid_edx(0x80000001);
-			c->x86_capability[6] = cpuid_ecx(0x80000001);
+			c->x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]
+				= cpuid_edx(0x80000001);
+			c->x86_capability[cpufeat_word(X86_FEATURE_LAHF_LM)]
+				= cpuid_ecx(0x80000001);
 		}
 		if ( c->extended_cpuid_level >= 0x80000004 )
 			get_model_name(c); /* Default name */
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index d8ca862..6dbb14d 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -608,7 +608,8 @@ static void __init efi_arch_cpu(void)
     if ( cpuid_eax(0x80000000) > 0x80000000 )
     {
         cpuid_ext_features = cpuid_edx(0x80000001);
-        boot_cpu_data.x86_capability[1] = cpuid_ext_features;
+        boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]
+            = cpuid_ext_features;
     }
 }
 
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 8609f4a..dc74e37 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -495,7 +495,8 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
 	processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) |
 				   (boot_cpu_data.x86_model << 4) |
 				   boot_cpu_data.x86_mask;
-	processor.mpc_featureflag = boot_cpu_data.x86_capability[0];
+	processor.mpc_featureflag =
+            boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_FPU)];
 	processor.mpc_reserved[0] = 0;
 	processor.mpc_reserved[1] = 0;
 	for (i = 0; i < 2; i++) {
@@ -799,7 +800,8 @@ int __devinit mp_register_lapic (
 	processor.mpc_cpuflag |= (boot_cpu ? CPU_BOOTPROCESSOR : 0);
 	processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | 
 		(boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
-	processor.mpc_featureflag = boot_cpu_data.x86_capability[0];
+	processor.mpc_featureflag
+            = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_FPU)];
 	processor.mpc_reserved[0] = 0;
 	processor.mpc_reserved[1] = 0;
 
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index e823954..af127cf 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -45,6 +45,7 @@
 #define X86_FEATURE_ACC		(0*32+29) /* Automatic clock control */
 #define X86_FEATURE_IA64	(0*32+30) /* IA-64 processor */
 #define X86_FEATURE_PBE		(0*32+31) /* Pending Break Enable */
+#define X86_FEATURE_3DNOW_ALT	(0*32+31) /* AMD nonstandard 3DNow (Aliases PBE) */
 
 /* AMD-defined CPU features, CPUID level 0x80000001, word 1 */
 /* Don't duplicate feature flags which are redundant with Intel! */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:14:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkDv-000229-UB; Thu, 29 Oct 2015 10:14: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 1ZrkDu-00021z-8y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:22 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	D1/98-02804-D71F1365; Thu, 29 Oct 2015 10:14:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446113653!56661859!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 21300 invoked from network); 29 Oct 2015 10:14:14 -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 Oct 2015 10:14:14 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDk-0004cu-US
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDk-0005Gq-T5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:12 +0000
Date: Thu, 29 Oct 2015 10:14:12 +0000
Message-Id: <E1ZrkDk-0005Gq-T5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove assumptions about the
	layout of x86_capabilities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8ba3a9e444c6943199130eea32904bc245a6d27
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 26 14:02:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 14:02:30 2015 +0100

    x86: remove assumptions about the layout of x86_capabilities
    
    Future work will rearange it, invalidating these assumptions.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c           |    2 +-
 xen/arch/x86/cpu/centaur.c       |    6 ++----
 xen/arch/x86/cpu/common.c        |   18 ++++++++++--------
 xen/arch/x86/efi/efi-boot.h      |    3 ++-
 xen/arch/x86/mpparse.c           |    6 ++++--
 xen/include/asm-x86/cpufeature.h |    1 +
 6 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index fd57370..74a0152 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -444,7 +444,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 
 	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
 	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
-	__clear_bit(0*32+31, c->x86_capability);
+	__clear_bit(X86_FEATURE_3DNOW_ALT, c->x86_capability);
 	
 	if (c->x86 == 0xf && c->x86_model < 0x14
 	    && cpu_has(c, X86_FEATURE_LAHF_LM)) {
diff --git a/xen/arch/x86/cpu/centaur.c b/xen/arch/x86/cpu/centaur.c
index 66b1995..c0ac117 100644
--- a/xen/arch/x86/cpu/centaur.c
+++ b/xen/arch/x86/cpu/centaur.c
@@ -39,10 +39,8 @@ static void init_c3(struct cpuinfo_x86 *c)
 			printk(KERN_INFO "CPU: Enabled h/w RNG\n");
 		}
 
-		/* store Centaur Extended Feature Flags as
-		 * word 5 of the CPU capability bit array
-		 */
-		c->x86_capability[5] = cpuid_edx(0xC0000001);
+		c->x86_capability[cpufeat_word(X86_FEATURE_XSTORE)]
+                    = cpuid_edx(0xC0000001);
 	}
 
 	if (c->x86 == 0x6 && c->x86_model >= 0xf) {
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index a5caa84..653b052 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -200,13 +200,13 @@ static void __init early_cpu_detect(void)
 	if (c->x86 >= 0x6)
 		c->x86_model += ((tfms >> 16) & 0xF) << 4;
 	c->x86_mask = tfms & 15;
-	cap0 &= ~cleared_caps[0];
-	cap4 &= ~cleared_caps[4];
+	cap0 &= ~cleared_caps[cpufeat_word(X86_FEATURE_FPU)];
+	cap4 &= ~cleared_caps[cpufeat_word(X86_FEATURE_XMM3)];
 	if (cap0 & cpufeat_mask(X86_FEATURE_CLFLSH))
 		c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
 	/* Leaf 0x1 capabilities filled in early for Xen. */
-	c->x86_capability[0] = cap0;
-	c->x86_capability[4] = cap4;
+	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = cap0;
+	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = cap4;
 }
 
 static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
@@ -225,8 +225,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	
 	/* Intel-defined flags: level 0x00000001 */
 	cpuid(0x00000001, &tfms, &ebx, &excap, &capability);
-	c->x86_capability[0] = capability;
-	c->x86_capability[4] = excap;
+	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = capability;
+	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = excap;
 	c->x86 = (tfms >> 8) & 15;
 	c->x86_model = (tfms >> 4) & 15;
 	if (c->x86 == 0xf)
@@ -247,8 +247,10 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	c->extended_cpuid_level = cpuid_eax(0x80000000);
 	if ( (c->extended_cpuid_level & 0xffff0000) == 0x80000000 ) {
 		if ( c->extended_cpuid_level >= 0x80000001 ) {
-			c->x86_capability[1] = cpuid_edx(0x80000001);
-			c->x86_capability[6] = cpuid_ecx(0x80000001);
+			c->x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]
+				= cpuid_edx(0x80000001);
+			c->x86_capability[cpufeat_word(X86_FEATURE_LAHF_LM)]
+				= cpuid_ecx(0x80000001);
 		}
 		if ( c->extended_cpuid_level >= 0x80000004 )
 			get_model_name(c); /* Default name */
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index d8ca862..6dbb14d 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -608,7 +608,8 @@ static void __init efi_arch_cpu(void)
     if ( cpuid_eax(0x80000000) > 0x80000000 )
     {
         cpuid_ext_features = cpuid_edx(0x80000001);
-        boot_cpu_data.x86_capability[1] = cpuid_ext_features;
+        boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]
+            = cpuid_ext_features;
     }
 }
 
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 8609f4a..dc74e37 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -495,7 +495,8 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
 	processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) |
 				   (boot_cpu_data.x86_model << 4) |
 				   boot_cpu_data.x86_mask;
-	processor.mpc_featureflag = boot_cpu_data.x86_capability[0];
+	processor.mpc_featureflag =
+            boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_FPU)];
 	processor.mpc_reserved[0] = 0;
 	processor.mpc_reserved[1] = 0;
 	for (i = 0; i < 2; i++) {
@@ -799,7 +800,8 @@ int __devinit mp_register_lapic (
 	processor.mpc_cpuflag |= (boot_cpu ? CPU_BOOTPROCESSOR : 0);
 	processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | 
 		(boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
-	processor.mpc_featureflag = boot_cpu_data.x86_capability[0];
+	processor.mpc_featureflag
+            = boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_FPU)];
 	processor.mpc_reserved[0] = 0;
 	processor.mpc_reserved[1] = 0;
 
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index e823954..af127cf 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -45,6 +45,7 @@
 #define X86_FEATURE_ACC		(0*32+29) /* Automatic clock control */
 #define X86_FEATURE_IA64	(0*32+30) /* IA-64 processor */
 #define X86_FEATURE_PBE		(0*32+31) /* Pending Break Enable */
+#define X86_FEATURE_3DNOW_ALT	(0*32+31) /* AMD nonstandard 3DNow (Aliases PBE) */
 
 /* AMD-defined CPU features, CPUID level 0x80000001, word 1 */
 /* Don't duplicate feature flags which are redundant with Intel! */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:14:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkE0-000232-0F; Thu, 29 Oct 2015 10:14:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDy-00022i-5K
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:26 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	46/F9-01421-181F1365; Thu, 29 Oct 2015 10:14:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446113663!57772438!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18621 invoked from network); 29 Oct 2015 10:14:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 10:14:24 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDv-0004d3-8l
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDv-0005HG-6X
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:23 +0000
Date: Thu, 29 Oct 2015 10:14:23 +0000
Message-Id: <E1ZrkDv-0005HG-6X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: correct page dirty marking in
	hvm_map_guest_frame_rw()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c23c760a8ef4cec4aaef11575b85fd17e82986c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:42:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:42:04 2015 +0100

    x86/HVM: correct page dirty marking in hvm_map_guest_frame_rw()
    
    Rather than dirtying a page when establishing a (permanent) mapping,
    dirty it when the page gets unmapped, or - if still mapped - on the
    final iteration of a save operation (or in other cases where the guest
    is paused or already shut down). (Transient mappings continue to get
    dirtied upon getting mapped, to avoid the overhead of tracking.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_sr_save.c         |    3 +-
 xen/arch/x86/hvm/hvm.c           |   57 +++++++++++++++++++++++++++++++++++--
 xen/arch/x86/mm/paging.c         |   10 ++++++
 xen/include/asm-x86/hvm/domain.h |    6 ++++
 xen/include/asm-x86/hvm/hvm.h    |    1 +
 xen/include/public/domctl.h      |   12 ++++++-
 6 files changed, 82 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 7dc3a48..d1bdf72 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -537,7 +537,8 @@ static int suspend_and_send_dirty(struct xc_sr_context *ctx)
     if ( xc_shadow_control(
              xch, ctx->domid, XEN_DOMCTL_SHADOW_OP_CLEAN,
              HYPERCALL_BUFFER(dirty_bitmap), ctx->save.p2m_size,
-             NULL, 0, &stats) != ctx->save.p2m_size )
+             NULL, XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL, &stats) !=
+         ctx->save.p2m_size )
     {
         PERROR("Failed to retrieve logdirty bitmap");
         rc = -1;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 965bfbf..21f42a7 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1565,6 +1565,8 @@ int hvm_domain_initialise(struct domain *d)
     INIT_LIST_HEAD(&d->arch.hvm_domain.ioreq_server.list);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
     spin_lock_init(&d->arch.hvm_domain.uc_lock);
+    spin_lock_init(&d->arch.hvm_domain.write_map.lock);
+    INIT_LIST_HEAD(&d->arch.hvm_domain.write_map.list);
 
     hvm_init_cacheattr_region_list(d);
 
@@ -3677,6 +3679,11 @@ int hvm_virtual_to_linear_addr(
     return 1;
 }
 
+struct hvm_write_map {
+    struct list_head list;
+    struct page_info *page;
+};
+
 /* On non-NULL return, we leave this function holding an additional 
  * ref on the underlying mfn, if any */
 static void *_hvm_map_guest_frame(unsigned long gfn, bool_t permanent,
@@ -3704,15 +3711,30 @@ static void *_hvm_map_guest_frame(unsigned long gfn, bool_t permanent,
 
     if ( writable )
     {
-        if ( !p2m_is_discard_write(p2mt) )
-            paging_mark_dirty(d, page_to_mfn(page));
-        else
+        if ( unlikely(p2m_is_discard_write(p2mt)) )
             *writable = 0;
+        else if ( !permanent )
+            paging_mark_dirty(d, page_to_mfn(page));
     }
 
     if ( !permanent )
         return __map_domain_page(page);
 
+    if ( writable && *writable )
+    {
+        struct hvm_write_map *track = xmalloc(struct hvm_write_map);
+
+        if ( !track )
+        {
+            put_page(page);
+            return NULL;
+        }
+        track->page = page;
+        spin_lock(&d->arch.hvm_domain.write_map.lock);
+        list_add_tail(&track->list, &d->arch.hvm_domain.write_map.list);
+        spin_unlock(&d->arch.hvm_domain.write_map.lock);
+    }
+
     map = __map_domain_page_global(page);
     if ( !map )
         put_page(page);
@@ -3735,18 +3757,45 @@ void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent)
 void hvm_unmap_guest_frame(void *p, bool_t permanent)
 {
     unsigned long mfn;
+    struct page_info *page;
 
     if ( !p )
         return;
 
     mfn = domain_page_map_to_mfn(p);
+    page = mfn_to_page(mfn);
 
     if ( !permanent )
         unmap_domain_page(p);
     else
+    {
+        struct domain *d = page_get_owner(page);
+        struct hvm_write_map *track;
+
         unmap_domain_page_global(p);
+        spin_lock(&d->arch.hvm_domain.write_map.lock);
+        list_for_each_entry(track, &d->arch.hvm_domain.write_map.list, list)
+            if ( track->page == page )
+            {
+                paging_mark_dirty(d, mfn);
+                list_del(&track->list);
+                xfree(track);
+                break;
+            }
+        spin_unlock(&d->arch.hvm_domain.write_map.lock);
+    }
+
+    put_page(page);
+}
+
+void hvm_mapped_guest_frames_mark_dirty(struct domain *d)
+{
+    struct hvm_write_map *track;
 
-    put_page(mfn_to_page(mfn));
+    spin_lock(&d->arch.hvm_domain.write_map.lock);
+    list_for_each_entry(track, &d->arch.hvm_domain.write_map.list, list)
+        paging_mark_dirty(d, page_to_mfn(track->page));
+    spin_unlock(&d->arch.hvm_domain.write_map.lock);
 }
 
 static void *hvm_map_entry(unsigned long va, bool_t *writable)
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ba1d528..42648df 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -29,6 +29,7 @@
 #include <asm/hvm/nestedhvm.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
+#include <public/sched.h> /* SHUTDOWN_suspend */
 
 #include "mm-locks.h"
 
@@ -422,6 +423,13 @@ static int paging_log_dirty_op(struct domain *d,
 
     if ( !resuming )
     {
+        /*
+         * Mark dirty all currently write-mapped pages on e.g. the
+         * final iteration of a save operation.
+         */
+        if ( sc->mode & XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL )
+            hvm_mapped_guest_frames_mark_dirty(d);
+
         domain_pause(d);
 
         /*
@@ -744,6 +752,8 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
 
     case XEN_DOMCTL_SHADOW_OP_CLEAN:
     case XEN_DOMCTL_SHADOW_OP_PEEK:
+        if ( sc->mode & ~XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL )
+            return -EINVAL;
         return paging_log_dirty_op(d, sc, resuming);
     }
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 992d5d1..a8cc2ad 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -145,6 +145,12 @@ struct hvm_domain {
 
     unsigned long *io_bitmap;
 
+    /* List of permanently write-mapped pages. */
+    struct {
+        spinlock_t lock;
+        struct list_head list;
+    } write_map;
+
     union {
         struct vmx_domain vmx;
         struct svm_domain svm;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0693706..0cf7da1 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -445,6 +445,7 @@ void *hvm_map_guest_frame_rw(unsigned long gfn, bool_t permanent,
                              bool_t *writable);
 void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent);
 void hvm_unmap_guest_frame(void *p, bool_t permanent);
+void hvm_mapped_guest_frames_mark_dirty(struct domain *);
 
 static inline void hvm_set_info_guest(struct vcpu *v)
 {
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 86cd0ab..7a56b3f 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -208,6 +208,13 @@ struct xen_domctl_getpageframeinfo3 {
   */
 #define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL  (1 << 4)
 
+/* Mode flags for XEN_DOMCTL_SHADOW_OP_{CLEAN,PEEK}. */
+ /*
+  * This is the final iteration: Requesting to include pages mapped
+  * writably by the hypervisor in the dirty bitmap.
+  */
+#define XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL   (1 << 0)
+
 struct xen_domctl_shadow_op_stats {
     uint32_t fault_count;
     uint32_t dirty_count;
@@ -219,8 +226,9 @@ struct xen_domctl_shadow_op {
     /* IN variables. */
     uint32_t       op;       /* XEN_DOMCTL_SHADOW_OP_* */
 
-    /* OP_ENABLE */
-    uint32_t       mode;     /* XEN_DOMCTL_SHADOW_ENABLE_* */
+    /* OP_ENABLE: XEN_DOMCTL_SHADOW_ENABLE_* */
+    /* OP_PEAK / OP_CLEAN: XEN_DOMCTL_SHADOW_LOGDIRTY_* */
+    uint32_t       mode;
 
     /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */
     uint32_t       mb;       /* Shadow memory allocation in MB */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:14:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkE0-000232-0F; Thu, 29 Oct 2015 10:14:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDy-00022i-5K
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:26 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	46/F9-01421-181F1365; Thu, 29 Oct 2015 10:14:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446113663!57772438!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18621 invoked from network); 29 Oct 2015 10:14:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 10:14:24 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDv-0004d3-8l
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkDv-0005HG-6X
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:23 +0000
Date: Thu, 29 Oct 2015 10:14:23 +0000
Message-Id: <E1ZrkDv-0005HG-6X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: correct page dirty marking in
	hvm_map_guest_frame_rw()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c23c760a8ef4cec4aaef11575b85fd17e82986c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:42:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:42:04 2015 +0100

    x86/HVM: correct page dirty marking in hvm_map_guest_frame_rw()
    
    Rather than dirtying a page when establishing a (permanent) mapping,
    dirty it when the page gets unmapped, or - if still mapped - on the
    final iteration of a save operation (or in other cases where the guest
    is paused or already shut down). (Transient mappings continue to get
    dirtied upon getting mapped, to avoid the overhead of tracking.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_sr_save.c         |    3 +-
 xen/arch/x86/hvm/hvm.c           |   57 +++++++++++++++++++++++++++++++++++--
 xen/arch/x86/mm/paging.c         |   10 ++++++
 xen/include/asm-x86/hvm/domain.h |    6 ++++
 xen/include/asm-x86/hvm/hvm.h    |    1 +
 xen/include/public/domctl.h      |   12 ++++++-
 6 files changed, 82 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 7dc3a48..d1bdf72 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -537,7 +537,8 @@ static int suspend_and_send_dirty(struct xc_sr_context *ctx)
     if ( xc_shadow_control(
              xch, ctx->domid, XEN_DOMCTL_SHADOW_OP_CLEAN,
              HYPERCALL_BUFFER(dirty_bitmap), ctx->save.p2m_size,
-             NULL, 0, &stats) != ctx->save.p2m_size )
+             NULL, XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL, &stats) !=
+         ctx->save.p2m_size )
     {
         PERROR("Failed to retrieve logdirty bitmap");
         rc = -1;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 965bfbf..21f42a7 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1565,6 +1565,8 @@ int hvm_domain_initialise(struct domain *d)
     INIT_LIST_HEAD(&d->arch.hvm_domain.ioreq_server.list);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
     spin_lock_init(&d->arch.hvm_domain.uc_lock);
+    spin_lock_init(&d->arch.hvm_domain.write_map.lock);
+    INIT_LIST_HEAD(&d->arch.hvm_domain.write_map.list);
 
     hvm_init_cacheattr_region_list(d);
 
@@ -3677,6 +3679,11 @@ int hvm_virtual_to_linear_addr(
     return 1;
 }
 
+struct hvm_write_map {
+    struct list_head list;
+    struct page_info *page;
+};
+
 /* On non-NULL return, we leave this function holding an additional 
  * ref on the underlying mfn, if any */
 static void *_hvm_map_guest_frame(unsigned long gfn, bool_t permanent,
@@ -3704,15 +3711,30 @@ static void *_hvm_map_guest_frame(unsigned long gfn, bool_t permanent,
 
     if ( writable )
     {
-        if ( !p2m_is_discard_write(p2mt) )
-            paging_mark_dirty(d, page_to_mfn(page));
-        else
+        if ( unlikely(p2m_is_discard_write(p2mt)) )
             *writable = 0;
+        else if ( !permanent )
+            paging_mark_dirty(d, page_to_mfn(page));
     }
 
     if ( !permanent )
         return __map_domain_page(page);
 
+    if ( writable && *writable )
+    {
+        struct hvm_write_map *track = xmalloc(struct hvm_write_map);
+
+        if ( !track )
+        {
+            put_page(page);
+            return NULL;
+        }
+        track->page = page;
+        spin_lock(&d->arch.hvm_domain.write_map.lock);
+        list_add_tail(&track->list, &d->arch.hvm_domain.write_map.list);
+        spin_unlock(&d->arch.hvm_domain.write_map.lock);
+    }
+
     map = __map_domain_page_global(page);
     if ( !map )
         put_page(page);
@@ -3735,18 +3757,45 @@ void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent)
 void hvm_unmap_guest_frame(void *p, bool_t permanent)
 {
     unsigned long mfn;
+    struct page_info *page;
 
     if ( !p )
         return;
 
     mfn = domain_page_map_to_mfn(p);
+    page = mfn_to_page(mfn);
 
     if ( !permanent )
         unmap_domain_page(p);
     else
+    {
+        struct domain *d = page_get_owner(page);
+        struct hvm_write_map *track;
+
         unmap_domain_page_global(p);
+        spin_lock(&d->arch.hvm_domain.write_map.lock);
+        list_for_each_entry(track, &d->arch.hvm_domain.write_map.list, list)
+            if ( track->page == page )
+            {
+                paging_mark_dirty(d, mfn);
+                list_del(&track->list);
+                xfree(track);
+                break;
+            }
+        spin_unlock(&d->arch.hvm_domain.write_map.lock);
+    }
+
+    put_page(page);
+}
+
+void hvm_mapped_guest_frames_mark_dirty(struct domain *d)
+{
+    struct hvm_write_map *track;
 
-    put_page(mfn_to_page(mfn));
+    spin_lock(&d->arch.hvm_domain.write_map.lock);
+    list_for_each_entry(track, &d->arch.hvm_domain.write_map.list, list)
+        paging_mark_dirty(d, page_to_mfn(track->page));
+    spin_unlock(&d->arch.hvm_domain.write_map.lock);
 }
 
 static void *hvm_map_entry(unsigned long va, bool_t *writable)
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ba1d528..42648df 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -29,6 +29,7 @@
 #include <asm/hvm/nestedhvm.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
+#include <public/sched.h> /* SHUTDOWN_suspend */
 
 #include "mm-locks.h"
 
@@ -422,6 +423,13 @@ static int paging_log_dirty_op(struct domain *d,
 
     if ( !resuming )
     {
+        /*
+         * Mark dirty all currently write-mapped pages on e.g. the
+         * final iteration of a save operation.
+         */
+        if ( sc->mode & XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL )
+            hvm_mapped_guest_frames_mark_dirty(d);
+
         domain_pause(d);
 
         /*
@@ -744,6 +752,8 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
 
     case XEN_DOMCTL_SHADOW_OP_CLEAN:
     case XEN_DOMCTL_SHADOW_OP_PEEK:
+        if ( sc->mode & ~XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL )
+            return -EINVAL;
         return paging_log_dirty_op(d, sc, resuming);
     }
 
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 992d5d1..a8cc2ad 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -145,6 +145,12 @@ struct hvm_domain {
 
     unsigned long *io_bitmap;
 
+    /* List of permanently write-mapped pages. */
+    struct {
+        spinlock_t lock;
+        struct list_head list;
+    } write_map;
+
     union {
         struct vmx_domain vmx;
         struct svm_domain svm;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0693706..0cf7da1 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -445,6 +445,7 @@ void *hvm_map_guest_frame_rw(unsigned long gfn, bool_t permanent,
                              bool_t *writable);
 void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent);
 void hvm_unmap_guest_frame(void *p, bool_t permanent);
+void hvm_mapped_guest_frames_mark_dirty(struct domain *);
 
 static inline void hvm_set_info_guest(struct vcpu *v)
 {
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 86cd0ab..7a56b3f 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -208,6 +208,13 @@ struct xen_domctl_getpageframeinfo3 {
   */
 #define XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL  (1 << 4)
 
+/* Mode flags for XEN_DOMCTL_SHADOW_OP_{CLEAN,PEEK}. */
+ /*
+  * This is the final iteration: Requesting to include pages mapped
+  * writably by the hypervisor in the dirty bitmap.
+  */
+#define XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL   (1 << 0)
+
 struct xen_domctl_shadow_op_stats {
     uint32_t fault_count;
     uint32_t dirty_count;
@@ -219,8 +226,9 @@ struct xen_domctl_shadow_op {
     /* IN variables. */
     uint32_t       op;       /* XEN_DOMCTL_SHADOW_OP_* */
 
-    /* OP_ENABLE */
-    uint32_t       mode;     /* XEN_DOMCTL_SHADOW_ENABLE_* */
+    /* OP_ENABLE: XEN_DOMCTL_SHADOW_ENABLE_* */
+    /* OP_PEAK / OP_CLEAN: XEN_DOMCTL_SHADOW_LOGDIRTY_* */
+    uint32_t       mode;
 
     /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */
     uint32_t       mb;       /* Shadow memory allocation in MB */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:14:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkEA-00024w-2v; Thu, 29 Oct 2015 10:14:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkE9-00024j-0P
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:37 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	A9/CB-32641-B81F1365; Thu, 29 Oct 2015 10:14:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446113673!11858031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1191 invoked from network); 29 Oct 2015 10:14:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 10:14:35 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkE5-0004dE-KM
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkE5-0005Hl-Gp
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:33 +0000
Date: Thu, 29 Oct 2015 10:14:33 +0000
Message-Id: <E1ZrkE5-0005Hl-Gp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsaves: add basic
	definitions/helpers to support xsaves
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c21beba4e7bff001181322348f5f111742e83f0
Author:     Shuai Ruan <shuai.ruan@linux.intel.com>
AuthorDate: Tue Oct 27 11:42:57 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:42:57 2015 +0100

    x86/xsaves: add basic definitions/helpers to support xsaves
    
    This patch add basic definitions/helpers which will be used in
    later patches.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@linux.intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/xstate.c           |   19 +++++++++++++++++++
 xen/include/asm-x86/hvm/vcpu.h  |    1 +
 xen/include/asm-x86/msr-index.h |    2 ++
 xen/include/asm-x86/xstate.h    |   12 ++++++++++--
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index c6238d9..827e0e1 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -60,6 +60,25 @@ uint64_t get_xcr0(void)
     return this_cpu(xcr0);
 }
 
+/* Cached xss for fast read */
+static DEFINE_PER_CPU(uint64_t, xss);
+
+void set_msr_xss(u64 xss)
+{
+    u64 *this_xss = &this_cpu(xss);
+
+    if ( *this_xss != xss )
+    {
+        wrmsrl(MSR_IA32_XSS, xss);
+        *this_xss = xss;
+    }
+}
+
+uint64_t get_msr_xss(void)
+{
+    return this_cpu(xss);
+}
+
 void xsave(struct vcpu *v, uint64_t mask)
 {
     struct xsave_struct *ptr = v->arch.xsave_area;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index f553814..de81f8a 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -173,6 +173,7 @@ struct hvm_vcpu {
 
     u32                 msr_tsc_aux;
     u64                 msr_tsc_adjust;
+    u64                 msr_xss;
 
     union {
         struct arch_vmx_struct vmx;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 65c1d02..b8ad93c 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -58,6 +58,8 @@
 
 #define MSR_IA32_BNDCFGS		0x00000D90
 
+#define MSR_IA32_XSS			0x00000da0
+
 #define MSR_MTRRfix64K_00000		0x00000250
 #define MSR_MTRRfix16K_80000		0x00000258
 #define MSR_MTRRfix16K_A0000		0x00000259
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index f0d8f0b..b95a5b5 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -19,8 +19,12 @@
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
+#define XSAVE_HDR_SIZE            64
+#define XSAVE_SSE_OFFSET          160
 #define XSTATE_YMM_SIZE           256
-#define XSTATE_AREA_MIN_SIZE      (512 + 64)  /* FP/SSE + XSAVE.HEADER */
+#define FXSAVE_SIZE               512
+#define XSAVE_HDR_OFFSET          FXSAVE_SIZE
+#define XSTATE_AREA_MIN_SIZE      (FXSAVE_SIZE + XSAVE_HDR_SIZE)
 
 #define XSTATE_FP      (1ULL << 0)
 #define XSTATE_SSE     (1ULL << 1)
@@ -38,6 +42,7 @@
 #define XSTATE_ALL     (~(1ULL << 63))
 #define XSTATE_NONLAZY (XSTATE_LWP | XSTATE_BNDREGS | XSTATE_BNDCSR)
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
+#define XSTATE_COMPACTION_ENABLED  (1ULL << 63)
 
 extern u64 xfeature_mask;
 
@@ -68,7 +73,8 @@ struct __packed __attribute__((aligned (64))) xsave_struct
 
     struct {
         u64 xstate_bv;
-        u64 reserved[7];
+        u64 xcomp_bv;
+        u64 reserved[6];
     } xsave_hdr;                             /* The 64-byte header */
 
     struct { char x[XSTATE_YMM_SIZE]; } ymm; /* YMM */
@@ -78,6 +84,8 @@ struct __packed __attribute__((aligned (64))) xsave_struct
 /* extended state operations */
 bool_t __must_check set_xcr0(u64 xfeatures);
 uint64_t get_xcr0(void);
+void set_msr_xss(u64 xss);
+uint64_t get_msr_xss(void);
 void xsave(struct vcpu *v, uint64_t mask);
 void xrstor(struct vcpu *v, uint64_t mask);
 bool_t xsave_enabled(const struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:14:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkEA-00024w-2v; Thu, 29 Oct 2015 10:14:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkE9-00024j-0P
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:37 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	A9/CB-32641-B81F1365; Thu, 29 Oct 2015 10:14:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446113673!11858031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1191 invoked from network); 29 Oct 2015 10:14:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 10:14:35 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkE5-0004dE-KM
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkE5-0005Hl-Gp
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:33 +0000
Date: Thu, 29 Oct 2015 10:14:33 +0000
Message-Id: <E1ZrkE5-0005Hl-Gp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsaves: add basic
	definitions/helpers to support xsaves
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c21beba4e7bff001181322348f5f111742e83f0
Author:     Shuai Ruan <shuai.ruan@linux.intel.com>
AuthorDate: Tue Oct 27 11:42:57 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:42:57 2015 +0100

    x86/xsaves: add basic definitions/helpers to support xsaves
    
    This patch add basic definitions/helpers which will be used in
    later patches.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@linux.intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/xstate.c           |   19 +++++++++++++++++++
 xen/include/asm-x86/hvm/vcpu.h  |    1 +
 xen/include/asm-x86/msr-index.h |    2 ++
 xen/include/asm-x86/xstate.h    |   12 ++++++++++--
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index c6238d9..827e0e1 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -60,6 +60,25 @@ uint64_t get_xcr0(void)
     return this_cpu(xcr0);
 }
 
+/* Cached xss for fast read */
+static DEFINE_PER_CPU(uint64_t, xss);
+
+void set_msr_xss(u64 xss)
+{
+    u64 *this_xss = &this_cpu(xss);
+
+    if ( *this_xss != xss )
+    {
+        wrmsrl(MSR_IA32_XSS, xss);
+        *this_xss = xss;
+    }
+}
+
+uint64_t get_msr_xss(void)
+{
+    return this_cpu(xss);
+}
+
 void xsave(struct vcpu *v, uint64_t mask)
 {
     struct xsave_struct *ptr = v->arch.xsave_area;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index f553814..de81f8a 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -173,6 +173,7 @@ struct hvm_vcpu {
 
     u32                 msr_tsc_aux;
     u64                 msr_tsc_adjust;
+    u64                 msr_xss;
 
     union {
         struct arch_vmx_struct vmx;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 65c1d02..b8ad93c 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -58,6 +58,8 @@
 
 #define MSR_IA32_BNDCFGS		0x00000D90
 
+#define MSR_IA32_XSS			0x00000da0
+
 #define MSR_MTRRfix64K_00000		0x00000250
 #define MSR_MTRRfix16K_80000		0x00000258
 #define MSR_MTRRfix16K_A0000		0x00000259
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index f0d8f0b..b95a5b5 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -19,8 +19,12 @@
 
 #define XCR_XFEATURE_ENABLED_MASK 0x00000000  /* index of XCR0 */
 
+#define XSAVE_HDR_SIZE            64
+#define XSAVE_SSE_OFFSET          160
 #define XSTATE_YMM_SIZE           256
-#define XSTATE_AREA_MIN_SIZE      (512 + 64)  /* FP/SSE + XSAVE.HEADER */
+#define FXSAVE_SIZE               512
+#define XSAVE_HDR_OFFSET          FXSAVE_SIZE
+#define XSTATE_AREA_MIN_SIZE      (FXSAVE_SIZE + XSAVE_HDR_SIZE)
 
 #define XSTATE_FP      (1ULL << 0)
 #define XSTATE_SSE     (1ULL << 1)
@@ -38,6 +42,7 @@
 #define XSTATE_ALL     (~(1ULL << 63))
 #define XSTATE_NONLAZY (XSTATE_LWP | XSTATE_BNDREGS | XSTATE_BNDCSR)
 #define XSTATE_LAZY    (XSTATE_ALL & ~XSTATE_NONLAZY)
+#define XSTATE_COMPACTION_ENABLED  (1ULL << 63)
 
 extern u64 xfeature_mask;
 
@@ -68,7 +73,8 @@ struct __packed __attribute__((aligned (64))) xsave_struct
 
     struct {
         u64 xstate_bv;
-        u64 reserved[7];
+        u64 xcomp_bv;
+        u64 reserved[6];
     } xsave_hdr;                             /* The 64-byte header */
 
     struct { char x[XSTATE_YMM_SIZE]; } ymm; /* YMM */
@@ -78,6 +84,8 @@ struct __packed __attribute__((aligned (64))) xsave_struct
 /* extended state operations */
 bool_t __must_check set_xcr0(u64 xfeatures);
 uint64_t get_xcr0(void);
+void set_msr_xss(u64 xss);
+uint64_t get_msr_xss(void);
 void xsave(struct vcpu *v, uint64_t mask);
 void xrstor(struct vcpu *v, uint64_t mask);
 bool_t xsave_enabled(const struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:14:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkEK-00026m-5N; Thu, 29 Oct 2015 10:14:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEI-00026T-KL
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:46 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	2D/01-13905-591F1365; Thu, 29 Oct 2015 10:14:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446113684!40769258!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1559 invoked from network); 29 Oct 2015 10:14:45 -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;
	29 Oct 2015 10:14:45 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEG-0004dM-0L
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEF-0005ID-Ta
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:43 +0000
Date: Thu, 29 Oct 2015 10:14:43 +0000
Message-Id: <E1ZrkEF-0005ID-Ta@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use clear_domain_page() instead of
	open coding it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3980ccfb975974639254042b2b17d4d6bc02153e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:44:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:44:20 2015 +0100

    use clear_domain_page() instead of open coding it
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/hvm/stdvga.c       |    7 ++-----
 xen/arch/x86/hvm/vmx/vvmx.c     |    8 +++-----
 xen/arch/x86/mm/p2m.c           |    9 ++++-----
 xen/arch/x86/mm/paging.c        |    8 +++-----
 xen/arch/x86/mm/shadow/common.c |    8 ++------
 xen/common/page_alloc.c         |   10 ++--------
 6 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index f50bff7..02a97f9 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -552,8 +552,7 @@ void stdvga_init(struct domain *d)
 {
     struct hvm_hw_stdvga *s = &d->arch.hvm_domain.stdvga;
     struct page_info *pg;
-    void *p;
-    int i;
+    unsigned int i;
 
     memset(s, 0, sizeof(*s));
     spin_lock_init(&s->lock);
@@ -564,9 +563,7 @@ void stdvga_init(struct domain *d)
         if ( pg == NULL )
             break;
         s->vram_page[i] = pg;
-        p = __map_domain_page(pg);
-        clear_page(p);
-        unmap_domain_page(p);
+        clear_domain_page(_mfn(page_to_mfn(pg)));
     }
 
     if ( i == ARRAY_SIZE(s->vram_page) )
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index cb6f9b8..3ac9cf9 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -68,7 +68,7 @@ int nvmx_vcpu_initialise(struct vcpu *v)
     if ( cpu_has_vmx_vmcs_shadowing )
     {
         struct page_info *vmread_bitmap, *vmwrite_bitmap;
-        unsigned long *vr, *vw;
+        unsigned long *vw;
 
         vmread_bitmap = alloc_domheap_page(NULL, 0);
         if ( !vmread_bitmap )
@@ -78,6 +78,8 @@ int nvmx_vcpu_initialise(struct vcpu *v)
         }
         v->arch.hvm_vmx.vmread_bitmap = vmread_bitmap;
 
+        clear_domain_page(_mfn(page_to_mfn(vmread_bitmap)));
+
         vmwrite_bitmap = alloc_domheap_page(NULL, 0);
         if ( !vmwrite_bitmap )
         {
@@ -86,10 +88,7 @@ int nvmx_vcpu_initialise(struct vcpu *v)
         }
         v->arch.hvm_vmx.vmwrite_bitmap = vmwrite_bitmap;
 
-        vr = __map_domain_page(vmread_bitmap);
         vw = __map_domain_page(vmwrite_bitmap);
-
-        clear_page(vr);
         clear_page(vw);
 
         /*
@@ -101,7 +100,6 @@ int nvmx_vcpu_initialise(struct vcpu *v)
         set_bit(IO_BITMAP_B, vw);
         set_bit(VMCS_HIGH(IO_BITMAP_B), vw);
 
-        unmap_domain_page(vr);
         unmap_domain_page(vw);
     }
 
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1178832..7f68f24 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1907,7 +1907,7 @@ p2m_flush_table(struct p2m_domain *p2m)
 {
     struct page_info *top, *pg;
     struct domain *d = p2m->domain;
-    void *p;
+    mfn_t mfn;
 
     p2m_lock(p2m);
 
@@ -1928,15 +1928,14 @@ p2m_flush_table(struct p2m_domain *p2m)
     p2m->np2m_base = P2M_BASE_EADDR;
     
     /* Zap the top level of the trie */
-    top = mfn_to_page(pagetable_get_mfn(p2m_get_pagetable(p2m)));
-    p = __map_domain_page(top);
-    clear_page(p);
-    unmap_domain_page(p);
+    mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
+    clear_domain_page(mfn);
 
     /* Make sure nobody else is using this p2m table */
     nestedhvm_vmcx_flushtlb(p2m);
 
     /* Free the rest of the trie pages back to the paging pool */
+    top = mfn_to_page(mfn);
     while ( (pg = page_list_remove_head(&p2m->pages)) )
         if ( pg != top ) 
             d->arch.paging.free_page(d, pg);
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 42648df..e6f726d 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -79,12 +79,10 @@ static mfn_t paging_new_log_dirty_page(struct domain *d)
 static mfn_t paging_new_log_dirty_leaf(struct domain *d)
 {
     mfn_t mfn = paging_new_log_dirty_page(d);
+
     if ( mfn_valid(mfn) )
-    {
-        void *leaf = map_domain_page(mfn);
-        clear_page(leaf);
-        unmap_domain_page(leaf);
-    }
+        clear_domain_page(mfn);
+
     return mfn;
 }
 
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index fa70ad6..bad355b 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1407,8 +1407,7 @@ mfn_t shadow_alloc(struct domain *d,
     unsigned int pages = shadow_size(shadow_type);
     struct page_list_head tmp_list;
     cpumask_t mask;
-    void *p;
-    int i;
+    unsigned int i;
 
     ASSERT(paging_locked_by_me(d));
     ASSERT(shadow_type != SH_type_none);
@@ -1454,10 +1453,7 @@ mfn_t shadow_alloc(struct domain *d,
             flush_tlb_mask(&mask);
         }
         /* Now safe to clear the page for reuse */
-        p = __map_domain_page(sp);
-        ASSERT(p != NULL);
-        clear_page(p);
-        unmap_domain_page(p);
+        clear_domain_page(page_to_mfn(sp));
         INIT_PAGE_LIST_ENTRY(&sp->list);
         page_list_add(sp, &tmp_list);
         sp->u.sh.type = shadow_type;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index abd5448..624a266 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1959,22 +1959,16 @@ __initcall(pagealloc_keyhandler_init);
 
 void scrub_one_page(struct page_info *pg)
 {
-    void *p;
-
     if ( unlikely(pg->count_info & PGC_broken) )
         return;
 
-    p = __map_domain_page(pg);
-
 #ifndef NDEBUG
     /* Avoid callers relying on allocations returning zeroed pages. */
-    memset(p, 0xc2, PAGE_SIZE);
+    unmap_domain_page(memset(__map_domain_page(pg), 0xc2, PAGE_SIZE));
 #else
     /* For a production build, clear_page() is the fastest way to scrub. */
-    clear_page(p);
+    clear_domain_page(_mfn(page_to_mfn(pg)));
 #endif
-
-    unmap_domain_page(p);
 }
 
 static void dump_heap(unsigned char key)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:14:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkEK-00026m-5N; Thu, 29 Oct 2015 10:14:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEI-00026T-KL
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:46 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	2D/01-13905-591F1365; Thu, 29 Oct 2015 10:14:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446113684!40769258!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1559 invoked from network); 29 Oct 2015 10:14:45 -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;
	29 Oct 2015 10:14:45 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEG-0004dM-0L
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEF-0005ID-Ta
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:43 +0000
Date: Thu, 29 Oct 2015 10:14:43 +0000
Message-Id: <E1ZrkEF-0005ID-Ta@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use clear_domain_page() instead of
	open coding it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3980ccfb975974639254042b2b17d4d6bc02153e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:44:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:44:20 2015 +0100

    use clear_domain_page() instead of open coding it
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/hvm/stdvga.c       |    7 ++-----
 xen/arch/x86/hvm/vmx/vvmx.c     |    8 +++-----
 xen/arch/x86/mm/p2m.c           |    9 ++++-----
 xen/arch/x86/mm/paging.c        |    8 +++-----
 xen/arch/x86/mm/shadow/common.c |    8 ++------
 xen/common/page_alloc.c         |   10 ++--------
 6 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index f50bff7..02a97f9 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -552,8 +552,7 @@ void stdvga_init(struct domain *d)
 {
     struct hvm_hw_stdvga *s = &d->arch.hvm_domain.stdvga;
     struct page_info *pg;
-    void *p;
-    int i;
+    unsigned int i;
 
     memset(s, 0, sizeof(*s));
     spin_lock_init(&s->lock);
@@ -564,9 +563,7 @@ void stdvga_init(struct domain *d)
         if ( pg == NULL )
             break;
         s->vram_page[i] = pg;
-        p = __map_domain_page(pg);
-        clear_page(p);
-        unmap_domain_page(p);
+        clear_domain_page(_mfn(page_to_mfn(pg)));
     }
 
     if ( i == ARRAY_SIZE(s->vram_page) )
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index cb6f9b8..3ac9cf9 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -68,7 +68,7 @@ int nvmx_vcpu_initialise(struct vcpu *v)
     if ( cpu_has_vmx_vmcs_shadowing )
     {
         struct page_info *vmread_bitmap, *vmwrite_bitmap;
-        unsigned long *vr, *vw;
+        unsigned long *vw;
 
         vmread_bitmap = alloc_domheap_page(NULL, 0);
         if ( !vmread_bitmap )
@@ -78,6 +78,8 @@ int nvmx_vcpu_initialise(struct vcpu *v)
         }
         v->arch.hvm_vmx.vmread_bitmap = vmread_bitmap;
 
+        clear_domain_page(_mfn(page_to_mfn(vmread_bitmap)));
+
         vmwrite_bitmap = alloc_domheap_page(NULL, 0);
         if ( !vmwrite_bitmap )
         {
@@ -86,10 +88,7 @@ int nvmx_vcpu_initialise(struct vcpu *v)
         }
         v->arch.hvm_vmx.vmwrite_bitmap = vmwrite_bitmap;
 
-        vr = __map_domain_page(vmread_bitmap);
         vw = __map_domain_page(vmwrite_bitmap);
-
-        clear_page(vr);
         clear_page(vw);
 
         /*
@@ -101,7 +100,6 @@ int nvmx_vcpu_initialise(struct vcpu *v)
         set_bit(IO_BITMAP_B, vw);
         set_bit(VMCS_HIGH(IO_BITMAP_B), vw);
 
-        unmap_domain_page(vr);
         unmap_domain_page(vw);
     }
 
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1178832..7f68f24 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1907,7 +1907,7 @@ p2m_flush_table(struct p2m_domain *p2m)
 {
     struct page_info *top, *pg;
     struct domain *d = p2m->domain;
-    void *p;
+    mfn_t mfn;
 
     p2m_lock(p2m);
 
@@ -1928,15 +1928,14 @@ p2m_flush_table(struct p2m_domain *p2m)
     p2m->np2m_base = P2M_BASE_EADDR;
     
     /* Zap the top level of the trie */
-    top = mfn_to_page(pagetable_get_mfn(p2m_get_pagetable(p2m)));
-    p = __map_domain_page(top);
-    clear_page(p);
-    unmap_domain_page(p);
+    mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
+    clear_domain_page(mfn);
 
     /* Make sure nobody else is using this p2m table */
     nestedhvm_vmcx_flushtlb(p2m);
 
     /* Free the rest of the trie pages back to the paging pool */
+    top = mfn_to_page(mfn);
     while ( (pg = page_list_remove_head(&p2m->pages)) )
         if ( pg != top ) 
             d->arch.paging.free_page(d, pg);
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 42648df..e6f726d 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -79,12 +79,10 @@ static mfn_t paging_new_log_dirty_page(struct domain *d)
 static mfn_t paging_new_log_dirty_leaf(struct domain *d)
 {
     mfn_t mfn = paging_new_log_dirty_page(d);
+
     if ( mfn_valid(mfn) )
-    {
-        void *leaf = map_domain_page(mfn);
-        clear_page(leaf);
-        unmap_domain_page(leaf);
-    }
+        clear_domain_page(mfn);
+
     return mfn;
 }
 
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index fa70ad6..bad355b 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1407,8 +1407,7 @@ mfn_t shadow_alloc(struct domain *d,
     unsigned int pages = shadow_size(shadow_type);
     struct page_list_head tmp_list;
     cpumask_t mask;
-    void *p;
-    int i;
+    unsigned int i;
 
     ASSERT(paging_locked_by_me(d));
     ASSERT(shadow_type != SH_type_none);
@@ -1454,10 +1453,7 @@ mfn_t shadow_alloc(struct domain *d,
             flush_tlb_mask(&mask);
         }
         /* Now safe to clear the page for reuse */
-        p = __map_domain_page(sp);
-        ASSERT(p != NULL);
-        clear_page(p);
-        unmap_domain_page(p);
+        clear_domain_page(page_to_mfn(sp));
         INIT_PAGE_LIST_ENTRY(&sp->list);
         page_list_add(sp, &tmp_list);
         sp->u.sh.type = shadow_type;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index abd5448..624a266 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1959,22 +1959,16 @@ __initcall(pagealloc_keyhandler_init);
 
 void scrub_one_page(struct page_info *pg)
 {
-    void *p;
-
     if ( unlikely(pg->count_info & PGC_broken) )
         return;
 
-    p = __map_domain_page(pg);
-
 #ifndef NDEBUG
     /* Avoid callers relying on allocations returning zeroed pages. */
-    memset(p, 0xc2, PAGE_SIZE);
+    unmap_domain_page(memset(__map_domain_page(pg), 0xc2, PAGE_SIZE));
 #else
     /* For a production build, clear_page() is the fastest way to scrub. */
-    clear_page(p);
+    clear_domain_page(_mfn(page_to_mfn(pg)));
 #endif
-
-    unmap_domain_page(p);
 }
 
 static void dump_heap(unsigned char key)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 29 10:14:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkEV-00028y-AB; Thu, 29 Oct 2015 10:14:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkET-00028k-N3
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:57 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	CD/9F-15765-0A1F1365; Thu, 29 Oct 2015 10:14:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446113694!35988188!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 7535 invoked from network); 29 Oct 2015 10:14:55 -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;
	29 Oct 2015 10:14:55 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEQ-0004dU-Bh
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEQ-0005Ii-9j
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:54 +0000
Date: Thu, 29 Oct 2015 10:14:54 +0000
Message-Id: <E1ZrkEQ-0005Ii-9j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: override stored file names for
	multiply built sources
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a771b7a0d5cbcd386744bd4bdd8e66dcfc096c8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:44:52 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:44:52 2015 +0100

    x86/mm: override stored file names for multiply built sources
    
    To make it possible to tell apart the static symbols therein, use their
    object file names instead of their source ones.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/Rules.mk                     |    4 ++--
 xen/arch/x86/mm/guest_walk.c     |    3 +++
 xen/arch/x86/mm/hap/guest_walk.c |    2 ++
 xen/arch/x86/mm/shadow/multi.c   |    4 +++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index bf19d20..433dad3 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -42,10 +42,10 @@ ALL_OBJS-y               += $(BASEDIR)/xsm/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
 ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
-CFLAGS += -fno-builtin -fno-common
+CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
-CFLAGS += -nostdinc
+CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c
index 773454d..ac28122 100644
--- a/xen/arch/x86/mm/guest_walk.c
+++ b/xen/arch/x86/mm/guest_walk.c
@@ -21,6 +21,9 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+/* Allow uniquely identifying static symbols in the 3 generated objects. */
+asm(".file \"" __OBJECT_FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/mm.h>
 #include <xen/paging.h>
diff --git a/xen/arch/x86/mm/hap/guest_walk.c b/xen/arch/x86/mm/hap/guest_walk.c
index 66f0010..11c1b35 100644
--- a/xen/arch/x86/mm/hap/guest_walk.c
+++ b/xen/arch/x86/mm/hap/guest_walk.c
@@ -18,6 +18,8 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+/* Allow uniquely identifying static symbols in the 3 generated objects. */
+asm(".file \"" __OBJECT_FILE__ "\"");
 
 #include <xen/domain_page.h>
 #include <xen/paging.h>
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b54835d..58f7e72 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -20,7 +20,9 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/config.h>
+/* Allow uniquely identifying static symbols in the 3 generated objects. */
+asm(".file \"" __OBJECT_FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/mm.h>
 #include <xen/trace.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:14:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:14: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 1ZrkEV-00028y-AB; Thu, 29 Oct 2015 10:14:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkET-00028k-N3
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:57 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	CD/9F-15765-0A1F1365; Thu, 29 Oct 2015 10:14:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446113694!35988188!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 7535 invoked from network); 29 Oct 2015 10:14:55 -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;
	29 Oct 2015 10:14:55 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEQ-0004dU-Bh
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEQ-0005Ii-9j
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:14:54 +0000
Date: Thu, 29 Oct 2015 10:14:54 +0000
Message-Id: <E1ZrkEQ-0005Ii-9j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: override stored file names for
	multiply built sources
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a771b7a0d5cbcd386744bd4bdd8e66dcfc096c8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:44:52 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:44:52 2015 +0100

    x86/mm: override stored file names for multiply built sources
    
    To make it possible to tell apart the static symbols therein, use their
    object file names instead of their source ones.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/Rules.mk                     |    4 ++--
 xen/arch/x86/mm/guest_walk.c     |    3 +++
 xen/arch/x86/mm/hap/guest_walk.c |    2 ++
 xen/arch/x86/mm/shadow/multi.c   |    4 +++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index bf19d20..433dad3 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -42,10 +42,10 @@ ALL_OBJS-y               += $(BASEDIR)/xsm/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
 ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
-CFLAGS += -fno-builtin -fno-common
+CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
-CFLAGS += -nostdinc
+CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c
index 773454d..ac28122 100644
--- a/xen/arch/x86/mm/guest_walk.c
+++ b/xen/arch/x86/mm/guest_walk.c
@@ -21,6 +21,9 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+/* Allow uniquely identifying static symbols in the 3 generated objects. */
+asm(".file \"" __OBJECT_FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/mm.h>
 #include <xen/paging.h>
diff --git a/xen/arch/x86/mm/hap/guest_walk.c b/xen/arch/x86/mm/hap/guest_walk.c
index 66f0010..11c1b35 100644
--- a/xen/arch/x86/mm/hap/guest_walk.c
+++ b/xen/arch/x86/mm/hap/guest_walk.c
@@ -18,6 +18,8 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+/* Allow uniquely identifying static symbols in the 3 generated objects. */
+asm(".file \"" __OBJECT_FILE__ "\"");
 
 #include <xen/domain_page.h>
 #include <xen/paging.h>
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b54835d..58f7e72 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -20,7 +20,9 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/config.h>
+/* Allow uniquely identifying static symbols in the 3 generated objects. */
+asm(".file \"" __OBJECT_FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/mm.h>
 #include <xen/trace.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:15:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkEh-0002Ag-D1; Thu, 29 Oct 2015 10:15: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 1ZrkEg-0002AV-3j
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:10 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	DB/F6-17090-DA1F1365; Thu, 29 Oct 2015 10:15:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1446113704!46042367!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1929 invoked from network); 29 Oct 2015 10:15:05 -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;
	29 Oct 2015 10:15:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEa-0004eW-NI
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEa-0005JP-JY
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:04 +0000
Date: Thu, 29 Oct 2015 10:15:04 +0000
Message-Id: <E1ZrkEa-0005JP-JY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: build map_domain_gfn() just
	once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9a6787cc3809c1e48e6fce22cacdd0def0cc2b92
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:46:05 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:46:05 2015 +0100

    x86/mm: build map_domain_gfn() just once
    
    It doesn't depend on GUEST_PAGING_LEVELS. Moving the function to p2m.c
    at once allows a bogus #define/#include pair to be removed from
    hap/nested_ept.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by:  George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/guest_walk.c     |   40 --------------------------------------
 xen/arch/x86/mm/hap/nested_ept.c |    4 ---
 xen/arch/x86/mm/p2m.c            |   38 ++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/guest_pt.h   |    4 ---
 xen/include/asm-x86/p2m.h        |    3 ++
 5 files changed, 41 insertions(+), 48 deletions(-)

diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c
index ac28122..76ddb52 100644
--- a/xen/arch/x86/mm/guest_walk.c
+++ b/xen/arch/x86/mm/guest_walk.c
@@ -88,46 +88,6 @@ static uint32_t set_ad_bits(void *guest_p, void *walk_p, int set_dirty)
     return 0;
 }
 
-/* If the map is non-NULL, we leave this function having 
- * acquired an extra ref on mfn_to_page(*mfn) */
-void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
-                     p2m_type_t *p2mt, p2m_query_t q, uint32_t *rc)
-{
-    struct page_info *page;
-    void *map;
-
-    /* Translate the gfn, unsharing if shared */
-    page = get_page_from_gfn_p2m(p2m->domain, p2m, gfn_x(gfn), p2mt, NULL,
-                                 q);
-    if ( p2m_is_paging(*p2mt) )
-    {
-        ASSERT(p2m_is_hostp2m(p2m));
-        if ( page )
-            put_page(page);
-        p2m_mem_paging_populate(p2m->domain, gfn_x(gfn));
-        *rc = _PAGE_PAGED;
-        return NULL;
-    }
-    if ( p2m_is_shared(*p2mt) )
-    {
-        if ( page )
-            put_page(page);
-        *rc = _PAGE_SHARED;
-        return NULL;
-    }
-    if ( !page )
-    {
-        *rc |= _PAGE_PRESENT;
-        return NULL;
-    }
-    *mfn = _mfn(page_to_mfn(page));
-    ASSERT(mfn_valid(mfn_x(*mfn)));
-
-    map = map_domain_page(*mfn);
-    return map;
-}
-
-
 /* Walk the guest pagetables, after the manner of a hardware walker. */
 /* Because the walk is essentially random, it can cause a deadlock 
  * warning in the p2m locking code. Highly unlikely this is an actual
diff --git a/xen/arch/x86/mm/hap/nested_ept.c b/xen/arch/x86/mm/hap/nested_ept.c
index 4b5576d..94cf832 100644
--- a/xen/arch/x86/mm/hap/nested_ept.c
+++ b/xen/arch/x86/mm/hap/nested_ept.c
@@ -34,10 +34,6 @@
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vvmx.h>
 
-/* EPT always use 4-level paging structure */
-#define GUEST_PAGING_LEVELS 4
-#include <asm/guest_pt.h>
-
 /* Must reserved bits in all level entries  */
 #define EPT_MUST_RSV_BITS (((1ull << PADDR_BITS) - 1) & \
                            ~((1ull << paddr_bits) - 1))
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 7f68f24..006be64 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2053,6 +2053,44 @@ unsigned long paging_gva_to_gfn(struct vcpu *v,
     return hostmode->gva_to_gfn(v, hostp2m, va, pfec);
 }
 
+/*
+ * If the map is non-NULL, we leave this function having
+ * acquired an extra ref on mfn_to_page(*mfn).
+ */
+void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
+                     p2m_type_t *p2mt, p2m_query_t q, uint32_t *rc)
+{
+    struct page_info *page;
+
+    /* Translate the gfn, unsharing if shared. */
+    page = get_page_from_gfn_p2m(p2m->domain, p2m, gfn_x(gfn), p2mt, NULL, q);
+    if ( p2m_is_paging(*p2mt) )
+    {
+        ASSERT(p2m_is_hostp2m(p2m));
+        if ( page )
+            put_page(page);
+        p2m_mem_paging_populate(p2m->domain, gfn_x(gfn));
+        *rc = _PAGE_PAGED;
+        return NULL;
+    }
+    if ( p2m_is_shared(*p2mt) )
+    {
+        if ( page )
+            put_page(page);
+        *rc = _PAGE_SHARED;
+        return NULL;
+    }
+    if ( !page )
+    {
+        *rc |= _PAGE_PRESENT;
+        return NULL;
+    }
+    *mfn = page_to_mfn(page);
+    ASSERT(mfn_valid(*mfn));
+
+    return map_domain_page(*mfn);
+}
+
 int map_mmio_regions(struct domain *d,
                      unsigned long start_gfn,
                      unsigned long nr,
diff --git a/xen/include/asm-x86/guest_pt.h b/xen/include/asm-x86/guest_pt.h
index f8a0d76..3447973 100644
--- a/xen/include/asm-x86/guest_pt.h
+++ b/xen/include/asm-x86/guest_pt.h
@@ -305,10 +305,6 @@ guest_walk_to_page_order(walk_t *gw)
 #define GPT_RENAME2(_n, _l) _n ## _ ## _l ## _levels
 #define GPT_RENAME(_n, _l) GPT_RENAME2(_n, _l)
 #define guest_walk_tables GPT_RENAME(guest_walk_tables, GUEST_PAGING_LEVELS)
-#define map_domain_gfn GPT_RENAME(map_domain_gfn, GUEST_PAGING_LEVELS)
-
-void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
-                     p2m_type_t *p2mt, p2m_query_t q, uint32_t *rc);
 
 extern uint32_t 
 guest_walk_tables(struct vcpu *v, struct p2m_domain *p2m, unsigned long va,
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 5e99ac6..2fc8667 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -680,6 +680,9 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 /* Set up function pointers for PT implementation: only for use by p2m code */
 extern void p2m_pt_init(struct p2m_domain *p2m);
 
+void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
+                     p2m_type_t *p2mt, p2m_query_t q, uint32_t *rc);
+
 /* Debugging and auditing of the P2M code? */
 #ifndef NDEBUG
 #define P2M_AUDIT     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 Oct 29 10:15:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkEh-0002Ag-D1; Thu, 29 Oct 2015 10:15: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 1ZrkEg-0002AV-3j
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:10 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	DB/F6-17090-DA1F1365; Thu, 29 Oct 2015 10:15:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1446113704!46042367!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1929 invoked from network); 29 Oct 2015 10:15:05 -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;
	29 Oct 2015 10:15:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEa-0004eW-NI
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEa-0005JP-JY
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:04 +0000
Date: Thu, 29 Oct 2015 10:15:04 +0000
Message-Id: <E1ZrkEa-0005JP-JY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: build map_domain_gfn() just
	once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9a6787cc3809c1e48e6fce22cacdd0def0cc2b92
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:46:05 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:46:05 2015 +0100

    x86/mm: build map_domain_gfn() just once
    
    It doesn't depend on GUEST_PAGING_LEVELS. Moving the function to p2m.c
    at once allows a bogus #define/#include pair to be removed from
    hap/nested_ept.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by:  George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/guest_walk.c     |   40 --------------------------------------
 xen/arch/x86/mm/hap/nested_ept.c |    4 ---
 xen/arch/x86/mm/p2m.c            |   38 ++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/guest_pt.h   |    4 ---
 xen/include/asm-x86/p2m.h        |    3 ++
 5 files changed, 41 insertions(+), 48 deletions(-)

diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c
index ac28122..76ddb52 100644
--- a/xen/arch/x86/mm/guest_walk.c
+++ b/xen/arch/x86/mm/guest_walk.c
@@ -88,46 +88,6 @@ static uint32_t set_ad_bits(void *guest_p, void *walk_p, int set_dirty)
     return 0;
 }
 
-/* If the map is non-NULL, we leave this function having 
- * acquired an extra ref on mfn_to_page(*mfn) */
-void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
-                     p2m_type_t *p2mt, p2m_query_t q, uint32_t *rc)
-{
-    struct page_info *page;
-    void *map;
-
-    /* Translate the gfn, unsharing if shared */
-    page = get_page_from_gfn_p2m(p2m->domain, p2m, gfn_x(gfn), p2mt, NULL,
-                                 q);
-    if ( p2m_is_paging(*p2mt) )
-    {
-        ASSERT(p2m_is_hostp2m(p2m));
-        if ( page )
-            put_page(page);
-        p2m_mem_paging_populate(p2m->domain, gfn_x(gfn));
-        *rc = _PAGE_PAGED;
-        return NULL;
-    }
-    if ( p2m_is_shared(*p2mt) )
-    {
-        if ( page )
-            put_page(page);
-        *rc = _PAGE_SHARED;
-        return NULL;
-    }
-    if ( !page )
-    {
-        *rc |= _PAGE_PRESENT;
-        return NULL;
-    }
-    *mfn = _mfn(page_to_mfn(page));
-    ASSERT(mfn_valid(mfn_x(*mfn)));
-
-    map = map_domain_page(*mfn);
-    return map;
-}
-
-
 /* Walk the guest pagetables, after the manner of a hardware walker. */
 /* Because the walk is essentially random, it can cause a deadlock 
  * warning in the p2m locking code. Highly unlikely this is an actual
diff --git a/xen/arch/x86/mm/hap/nested_ept.c b/xen/arch/x86/mm/hap/nested_ept.c
index 4b5576d..94cf832 100644
--- a/xen/arch/x86/mm/hap/nested_ept.c
+++ b/xen/arch/x86/mm/hap/nested_ept.c
@@ -34,10 +34,6 @@
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vvmx.h>
 
-/* EPT always use 4-level paging structure */
-#define GUEST_PAGING_LEVELS 4
-#include <asm/guest_pt.h>
-
 /* Must reserved bits in all level entries  */
 #define EPT_MUST_RSV_BITS (((1ull << PADDR_BITS) - 1) & \
                            ~((1ull << paddr_bits) - 1))
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 7f68f24..006be64 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2053,6 +2053,44 @@ unsigned long paging_gva_to_gfn(struct vcpu *v,
     return hostmode->gva_to_gfn(v, hostp2m, va, pfec);
 }
 
+/*
+ * If the map is non-NULL, we leave this function having
+ * acquired an extra ref on mfn_to_page(*mfn).
+ */
+void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
+                     p2m_type_t *p2mt, p2m_query_t q, uint32_t *rc)
+{
+    struct page_info *page;
+
+    /* Translate the gfn, unsharing if shared. */
+    page = get_page_from_gfn_p2m(p2m->domain, p2m, gfn_x(gfn), p2mt, NULL, q);
+    if ( p2m_is_paging(*p2mt) )
+    {
+        ASSERT(p2m_is_hostp2m(p2m));
+        if ( page )
+            put_page(page);
+        p2m_mem_paging_populate(p2m->domain, gfn_x(gfn));
+        *rc = _PAGE_PAGED;
+        return NULL;
+    }
+    if ( p2m_is_shared(*p2mt) )
+    {
+        if ( page )
+            put_page(page);
+        *rc = _PAGE_SHARED;
+        return NULL;
+    }
+    if ( !page )
+    {
+        *rc |= _PAGE_PRESENT;
+        return NULL;
+    }
+    *mfn = page_to_mfn(page);
+    ASSERT(mfn_valid(*mfn));
+
+    return map_domain_page(*mfn);
+}
+
 int map_mmio_regions(struct domain *d,
                      unsigned long start_gfn,
                      unsigned long nr,
diff --git a/xen/include/asm-x86/guest_pt.h b/xen/include/asm-x86/guest_pt.h
index f8a0d76..3447973 100644
--- a/xen/include/asm-x86/guest_pt.h
+++ b/xen/include/asm-x86/guest_pt.h
@@ -305,10 +305,6 @@ guest_walk_to_page_order(walk_t *gw)
 #define GPT_RENAME2(_n, _l) _n ## _ ## _l ## _levels
 #define GPT_RENAME(_n, _l) GPT_RENAME2(_n, _l)
 #define guest_walk_tables GPT_RENAME(guest_walk_tables, GUEST_PAGING_LEVELS)
-#define map_domain_gfn GPT_RENAME(map_domain_gfn, GUEST_PAGING_LEVELS)
-
-void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
-                     p2m_type_t *p2mt, p2m_query_t q, uint32_t *rc);
 
 extern uint32_t 
 guest_walk_tables(struct vcpu *v, struct p2m_domain *p2m, unsigned long va,
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 5e99ac6..2fc8667 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -680,6 +680,9 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 /* Set up function pointers for PT implementation: only for use by p2m code */
 extern void p2m_pt_init(struct p2m_domain *p2m);
 
+void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
+                     p2m_type_t *p2mt, p2m_query_t q, uint32_t *rc);
+
 /* Debugging and auditing of the P2M code? */
 #ifndef NDEBUG
 #define P2M_AUDIT     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 Oct 29 10:15:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkEt-0002CS-Fb; Thu, 29 Oct 2015 10:15:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEr-0002CJ-IU
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:21 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	6E/78-14422-8B1F1365; Thu, 29 Oct 2015 10:15:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446113715!40649328!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 8991 invoked from network); 29 Oct 2015 10:15:16 -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 Oct 2015 10:15:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEk-0004ej-Ud
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEk-0005Kh-Td
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:14 +0000
Date: Thu, 29 Oct 2015 10:15:14 +0000
Message-Id: <E1ZrkEk-0005Kh-Td@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: only a single instance of
	gw_page_flags[] is needed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit caa0350794e22f67fc3d080ab538604428b34073
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:46:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:46:35 2015 +0100

    x86/mm: only a single instance of gw_page_flags[] is needed
    
    None of its elements depends on GUEST_PAGING_LEVELS.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/guest_walk.c |   44 +++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c
index 76ddb52..18d1acf 100644
--- a/xen/arch/x86/mm/guest_walk.c
+++ b/xen/arch/x86/mm/guest_walk.c
@@ -32,30 +32,32 @@ asm(".file \"" __OBJECT_FILE__ "\"");
 #include <asm/page.h>
 #include <asm/guest_pt.h>
 
+extern const uint32_t gw_page_flags[];
+#if GUEST_PAGING_LEVELS == CONFIG_PAGING_LEVELS
+const uint32_t gw_page_flags[] = {
+    /* I/F -  Usr Wr */
+    /* 0   0   0   0 */ _PAGE_PRESENT,
+    /* 0   0   0   1 */ _PAGE_PRESENT|_PAGE_RW,
+    /* 0   0   1   0 */ _PAGE_PRESENT|_PAGE_USER,
+    /* 0   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,
+    /* 0   1   0   0 */ _PAGE_PRESENT,
+    /* 0   1   0   1 */ _PAGE_PRESENT|_PAGE_RW,
+    /* 0   1   1   0 */ _PAGE_PRESENT|_PAGE_USER,
+    /* 0   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,
+    /* 1   0   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT,
+    /* 1   0   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,
+    /* 1   0   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,
+    /* 1   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,
+    /* 1   1   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT,
+    /* 1   1   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,
+    /* 1   1   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,
+    /* 1   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,
+};
+#endif
 
 /* Flags that are needed in a pagetable entry, with the sense of NX inverted */
 static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec) 
 {
-    static const uint32_t flags[] = {
-        /* I/F -  Usr Wr */
-        /* 0   0   0   0 */ _PAGE_PRESENT, 
-        /* 0   0   0   1 */ _PAGE_PRESENT|_PAGE_RW,
-        /* 0   0   1   0 */ _PAGE_PRESENT|_PAGE_USER,
-        /* 0   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,
-        /* 0   1   0   0 */ _PAGE_PRESENT, 
-        /* 0   1   0   1 */ _PAGE_PRESENT|_PAGE_RW,
-        /* 0   1   1   0 */ _PAGE_PRESENT|_PAGE_USER,
-        /* 0   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,
-        /* 1   0   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT, 
-        /* 1   0   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,
-        /* 1   0   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,
-        /* 1   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,
-        /* 1   1   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT, 
-        /* 1   1   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,
-        /* 1   1   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,
-        /* 1   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,
-    };
-
     /* Don't demand not-NX if the CPU wouldn't enforce it. */
     if ( !guest_supports_nx(v) )
         pfec &= ~PFEC_insn_fetch;
@@ -65,7 +67,7 @@ static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec)
          && !(pfec & PFEC_user_mode) )
         pfec &= ~PFEC_write_access;
 
-    return flags[(pfec & 0x1f) >> 1] | _PAGE_INVALID_BITS;
+    return gw_page_flags[(pfec & 0x1f) >> 1] | _PAGE_INVALID_BITS;
 }
 
 /* Modify a guest pagetable entry to set the Accessed and Dirty bits.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:15:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkEt-0002CS-Fb; Thu, 29 Oct 2015 10:15:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEr-0002CJ-IU
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:21 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	6E/78-14422-8B1F1365; Thu, 29 Oct 2015 10:15:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446113715!40649328!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 8991 invoked from network); 29 Oct 2015 10:15:16 -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 Oct 2015 10:15:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEk-0004ej-Ud
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEk-0005Kh-Td
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:14 +0000
Date: Thu, 29 Oct 2015 10:15:14 +0000
Message-Id: <E1ZrkEk-0005Kh-Td@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: only a single instance of
	gw_page_flags[] is needed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit caa0350794e22f67fc3d080ab538604428b34073
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 11:46:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 11:46:35 2015 +0100

    x86/mm: only a single instance of gw_page_flags[] is needed
    
    None of its elements depends on GUEST_PAGING_LEVELS.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/guest_walk.c |   44 +++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c
index 76ddb52..18d1acf 100644
--- a/xen/arch/x86/mm/guest_walk.c
+++ b/xen/arch/x86/mm/guest_walk.c
@@ -32,30 +32,32 @@ asm(".file \"" __OBJECT_FILE__ "\"");
 #include <asm/page.h>
 #include <asm/guest_pt.h>
 
+extern const uint32_t gw_page_flags[];
+#if GUEST_PAGING_LEVELS == CONFIG_PAGING_LEVELS
+const uint32_t gw_page_flags[] = {
+    /* I/F -  Usr Wr */
+    /* 0   0   0   0 */ _PAGE_PRESENT,
+    /* 0   0   0   1 */ _PAGE_PRESENT|_PAGE_RW,
+    /* 0   0   1   0 */ _PAGE_PRESENT|_PAGE_USER,
+    /* 0   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,
+    /* 0   1   0   0 */ _PAGE_PRESENT,
+    /* 0   1   0   1 */ _PAGE_PRESENT|_PAGE_RW,
+    /* 0   1   1   0 */ _PAGE_PRESENT|_PAGE_USER,
+    /* 0   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,
+    /* 1   0   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT,
+    /* 1   0   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,
+    /* 1   0   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,
+    /* 1   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,
+    /* 1   1   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT,
+    /* 1   1   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,
+    /* 1   1   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,
+    /* 1   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,
+};
+#endif
 
 /* Flags that are needed in a pagetable entry, with the sense of NX inverted */
 static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec) 
 {
-    static const uint32_t flags[] = {
-        /* I/F -  Usr Wr */
-        /* 0   0   0   0 */ _PAGE_PRESENT, 
-        /* 0   0   0   1 */ _PAGE_PRESENT|_PAGE_RW,
-        /* 0   0   1   0 */ _PAGE_PRESENT|_PAGE_USER,
-        /* 0   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,
-        /* 0   1   0   0 */ _PAGE_PRESENT, 
-        /* 0   1   0   1 */ _PAGE_PRESENT|_PAGE_RW,
-        /* 0   1   1   0 */ _PAGE_PRESENT|_PAGE_USER,
-        /* 0   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,
-        /* 1   0   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT, 
-        /* 1   0   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,
-        /* 1   0   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,
-        /* 1   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,
-        /* 1   1   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT, 
-        /* 1   1   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,
-        /* 1   1   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,
-        /* 1   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,
-    };
-
     /* Don't demand not-NX if the CPU wouldn't enforce it. */
     if ( !guest_supports_nx(v) )
         pfec &= ~PFEC_insn_fetch;
@@ -65,7 +67,7 @@ static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec)
          && !(pfec & PFEC_user_mode) )
         pfec &= ~PFEC_write_access;
 
-    return flags[(pfec & 0x1f) >> 1] | _PAGE_INVALID_BITS;
+    return gw_page_flags[(pfec & 0x1f) >> 1] | _PAGE_INVALID_BITS;
 }
 
 /* Modify a guest pagetable entry to set the Accessed and Dirty bits.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:15:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkF0-0002DX-Hv; Thu, 29 Oct 2015 10:15: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 1ZrkEz-0002DO-Vb
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:30 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	C4/8C-01753-1C1F1365; Thu, 29 Oct 2015 10:15:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446113727!56662404!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24456 invoked from network); 29 Oct 2015 10:15:28 -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 Oct 2015 10:15:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEw-0004eo-TK
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEv-0005LD-8D
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:26 +0000
Date: Thu, 29 Oct 2015 10:15:25 +0000
Message-Id: <E1ZrkEv-0005LD-8D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: don't zero-map LDT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 61031e64d3dafd2fb1953436444bf02eccb9b146
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 14:46:12 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 14:46:12 2015 +0100

    x86/PV: don't zero-map LDT
    
    This effectvely reverts the LDT related part of commit cf6d39f819
    ("x86/PV: properly populate descriptor tables"), which broke demand
    paged LDT handling in guests.
    
    Reported-by: David Vrabel <david.vrabel@citrix.com>
    Diagnosed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 327b837..8763414 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -508,7 +508,6 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 {
     l1_pgentry_t *pl1e;
     unsigned int i;
-    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
     struct page_info *page;
 
     BUG_ON(unlikely(in_irq()));
@@ -523,11 +522,10 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 
     for ( i = 16; i < 32; i++ )
     {
-        pfn = l1e_get_pfn(pl1e[i]);
-        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn )
+        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) )
             continue;
-        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
-        page = mfn_to_page(pfn);
+        page = l1e_get_page(pl1e[i]);
+        l1e_write(&pl1e[i], l1e_empty());
         ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
         ASSERT_PAGE_IS_DOMAIN(page, v->domain);
         put_page_and_type(page);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:15:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkF0-0002DX-Hv; Thu, 29 Oct 2015 10:15: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 1ZrkEz-0002DO-Vb
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:30 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	C4/8C-01753-1C1F1365; Thu, 29 Oct 2015 10:15:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446113727!56662404!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24456 invoked from network); 29 Oct 2015 10:15:28 -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 Oct 2015 10:15:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEw-0004eo-TK
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkEv-0005LD-8D
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:26 +0000
Date: Thu, 29 Oct 2015 10:15:25 +0000
Message-Id: <E1ZrkEv-0005LD-8D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: don't zero-map LDT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 61031e64d3dafd2fb1953436444bf02eccb9b146
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 14:46:12 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 14:46:12 2015 +0100

    x86/PV: don't zero-map LDT
    
    This effectvely reverts the LDT related part of commit cf6d39f819
    ("x86/PV: properly populate descriptor tables"), which broke demand
    paged LDT handling in guests.
    
    Reported-by: David Vrabel <david.vrabel@citrix.com>
    Diagnosed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 327b837..8763414 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -508,7 +508,6 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 {
     l1_pgentry_t *pl1e;
     unsigned int i;
-    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
     struct page_info *page;
 
     BUG_ON(unlikely(in_irq()));
@@ -523,11 +522,10 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 
     for ( i = 16; i < 32; i++ )
     {
-        pfn = l1e_get_pfn(pl1e[i]);
-        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn )
+        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) )
             continue;
-        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
-        page = mfn_to_page(pfn);
+        page = l1e_get_page(pl1e[i]);
+        l1e_write(&pl1e[i], l1e_empty());
         ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
         ASSERT_PAGE_IS_DOMAIN(page, v->domain);
         put_page_and_type(page);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:15:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkFA-0002FE-KR; Thu, 29 Oct 2015 10:15: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 1ZrkF9-0002F1-QX
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:39 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	20/C0-30270-BC1F1365; Thu, 29 Oct 2015 10:15:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446113737!46062119!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31941 invoked from network); 29 Oct 2015 10:15:38 -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;
	29 Oct 2015 10:15:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkF7-0004ez-9w
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkF7-0005Ll-7Y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:37 +0000
Date: Thu, 29 Oct 2015 10:15:37 +0000
Message-Id: <E1ZrkF7-0005Ll-7Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mm: unmap page for direct mapped
	domain on decrease reservation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68f2e49032fa32c9cc5413994d8b072d3d2bd048
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Oct 27 14:47:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 14:47:01 2015 +0100

    mm: unmap page for direct mapped domain on decrease reservation
    
    Direct mapped domain needs to retrieve the exact same underlying
    physical page when the region is re-populated.
    
    Currently, when the memory reservation for this domain is decreased, the
    request is just ignored and the page stayed mapped in the P2M. However,
    this make more difficult to spot issue when the domain has not yet mapped
    foreign page but trying to access the region.
    
    What we really care for direct mapped domain is to not give back the
    page to the allocator. So we can re-enable to direct mapped when the guest
    memory region is re-populated.
    
    The rest of the process to remove a page can be safely done. This
    also ensures us to stay close to the normal domain memory handling.
    
    At the same time, drop the trailing whitespaces around the code
    modified.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/memory.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index f6aed0d..241655b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -257,8 +257,17 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
 
     if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
         put_page_and_type(page);
-            
-    if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
+
+    /*
+     * With the lack of an IOMMU on some platforms, domains with DMA-capable
+     * device must retrieve the same pfn when the hypercall populate_physmap
+     * is called.
+     *
+     * For this purpose (and to match populate_physmap() behavior), the page
+     * is kept allocated.
+     */
+    if ( !is_domain_direct_mapped(d) &&
+         test_and_clear_bit(_PGC_allocated, &page->count_info) )
         put_page(page);
 
     guest_physmap_remove_page(d, gmfn, mfn, 0);
@@ -309,13 +318,6 @@ static void decrease_reservation(struct memop_args *a)
              && p2m_pod_decrease_reservation(a->domain, gmfn, a->extent_order) )
             continue;
 
-        /* With the lack for iommu on some ARM platform, domain with DMA-capable
-         * device must retrieve the same pfn when the hypercall
-         * populate_physmap is called.
-         */
-        if ( is_domain_direct_mapped(a->domain) )
-            continue;
-
         for ( j = 0; j < (1 << a->extent_order); j++ )
             if ( !guest_remove_page(a->domain, gmfn + j) )
                 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 Oct 29 10:15:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkFA-0002FE-KR; Thu, 29 Oct 2015 10:15: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 1ZrkF9-0002F1-QX
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:39 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	20/C0-30270-BC1F1365; Thu, 29 Oct 2015 10:15:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446113737!46062119!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31941 invoked from network); 29 Oct 2015 10:15:38 -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;
	29 Oct 2015 10:15:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkF7-0004ez-9w
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkF7-0005Ll-7Y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:37 +0000
Date: Thu, 29 Oct 2015 10:15:37 +0000
Message-Id: <E1ZrkF7-0005Ll-7Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mm: unmap page for direct mapped
	domain on decrease reservation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68f2e49032fa32c9cc5413994d8b072d3d2bd048
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Oct 27 14:47:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 14:47:01 2015 +0100

    mm: unmap page for direct mapped domain on decrease reservation
    
    Direct mapped domain needs to retrieve the exact same underlying
    physical page when the region is re-populated.
    
    Currently, when the memory reservation for this domain is decreased, the
    request is just ignored and the page stayed mapped in the P2M. However,
    this make more difficult to spot issue when the domain has not yet mapped
    foreign page but trying to access the region.
    
    What we really care for direct mapped domain is to not give back the
    page to the allocator. So we can re-enable to direct mapped when the guest
    memory region is re-populated.
    
    The rest of the process to remove a page can be safely done. This
    also ensures us to stay close to the normal domain memory handling.
    
    At the same time, drop the trailing whitespaces around the code
    modified.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/memory.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index f6aed0d..241655b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -257,8 +257,17 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
 
     if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
         put_page_and_type(page);
-            
-    if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
+
+    /*
+     * With the lack of an IOMMU on some platforms, domains with DMA-capable
+     * device must retrieve the same pfn when the hypercall populate_physmap
+     * is called.
+     *
+     * For this purpose (and to match populate_physmap() behavior), the page
+     * is kept allocated.
+     */
+    if ( !is_domain_direct_mapped(d) &&
+         test_and_clear_bit(_PGC_allocated, &page->count_info) )
         put_page(page);
 
     guest_physmap_remove_page(d, gmfn, mfn, 0);
@@ -309,13 +318,6 @@ static void decrease_reservation(struct memop_args *a)
              && p2m_pod_decrease_reservation(a->domain, gmfn, a->extent_order) )
             continue;
 
-        /* With the lack for iommu on some ARM platform, domain with DMA-capable
-         * device must retrieve the same pfn when the hypercall
-         * populate_physmap is called.
-         */
-        if ( is_domain_direct_mapped(a->domain) )
-            continue;
-
         for ( j = 0; j < (1 << a->extent_order); j++ )
             if ( !guest_remove_page(a->domain, gmfn + j) )
                 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 Oct 29 10:15:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkFM-0002Gs-N0; Thu, 29 Oct 2015 10:15: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 1ZrkFL-0002Gj-Fg
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:51 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	76/7D-01421-6D1F1365; Thu, 29 Oct 2015 10:15:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446113747!57773104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16919 invoked from network); 29 Oct 2015 10:15:48 -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;
	29 Oct 2015 10:15:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkFH-0004f5-Lk
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkFH-0005ME-Gy
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:47 +0000
Date: Thu, 29 Oct 2015 10:15:47 +0000
Message-Id: <E1ZrkFH-0005ME-Gy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mm: improve message in populate
	physmap when the domain is direct mapped
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f3a26badbe9e980c759e2246cb248ceef018968
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Oct 27 14:47:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 14:47:33 2015 +0100

    mm: improve message in populate physmap when the domain is direct mapped
    
    The current domain and the domain pointed by the variable "d" are not
    the same.
    
    However, when it's not possible to get a reference on the page, the
    target domain ID is not printed. This makes the message difficult to
    understand.
    
    Improve the message by printing the target domain ID.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/memory.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 241655b..23f90c6 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -140,8 +140,8 @@ static void populate_physmap(struct memop_args *a)
                     if ( !get_page(page, d) )
                     {
                         gdprintk(XENLOG_INFO,
-                                 "mfn %#"PRI_xen_pfn" doesn't belong to the"
-                                 " domain\n", mfn);
+                                 "mfn %#"PRI_xen_pfn" doesn't belong to d%d\n",
+                                  mfn, d->domain_id);
                         goto out;
                     }
                     put_page(page);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:15:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:15: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 1ZrkFM-0002Gs-N0; Thu, 29 Oct 2015 10:15: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 1ZrkFL-0002Gj-Fg
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:51 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	76/7D-01421-6D1F1365; Thu, 29 Oct 2015 10:15:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446113747!57773104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16919 invoked from network); 29 Oct 2015 10:15:48 -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;
	29 Oct 2015 10:15:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkFH-0004f5-Lk
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkFH-0005ME-Gy
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:47 +0000
Date: Thu, 29 Oct 2015 10:15:47 +0000
Message-Id: <E1ZrkFH-0005ME-Gy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mm: improve message in populate
	physmap when the domain is direct mapped
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f3a26badbe9e980c759e2246cb248ceef018968
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Oct 27 14:47:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 14:47:33 2015 +0100

    mm: improve message in populate physmap when the domain is direct mapped
    
    The current domain and the domain pointed by the variable "d" are not
    the same.
    
    However, when it's not possible to get a reference on the page, the
    target domain ID is not printed. This makes the message difficult to
    understand.
    
    Improve the message by printing the target domain ID.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/memory.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 241655b..23f90c6 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -140,8 +140,8 @@ static void populate_physmap(struct memop_args *a)
                     if ( !get_page(page, d) )
                     {
                         gdprintk(XENLOG_INFO,
-                                 "mfn %#"PRI_xen_pfn" doesn't belong to the"
-                                 " domain\n", mfn);
+                                 "mfn %#"PRI_xen_pfn" doesn't belong to d%d\n",
+                                  mfn, d->domain_id);
                         goto out;
                     }
                     put_page(page);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 10:16:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:16: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 1ZrkFW-0002Ij-Ra; Thu, 29 Oct 2015 10:16: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 1ZrkFV-0002IP-Rr
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:16:02 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	09/18-04752-0E1F1365; Thu, 29 Oct 2015 10:16:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446113758!62515721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25500 invoked from network); 29 Oct 2015 10:16:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 10:16:00 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkFR-0004fG-W0
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkFR-0005Mt-UA
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:57 +0000
Date: Thu, 29 Oct 2015 10:15:57 +0000
Message-Id: <E1ZrkFR-0005Mt-UA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: don't call HVM-only function
	for PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf0d4923d7783ece38bb8f3b832e8df0f3fc284b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 16:34:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 16:34:29 2015 +0100

    x86/mm: don't call HVM-only function for PV guests
    
    Somehow I managed to drop the HVM dependency from v2 to v3 of what
    became commit 5c23c760a8 ("x86/HVM: correct page dirty marking in
    hvm_map_guest_frame_rw()"), obviously breaking migration of PV guests.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/paging.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index e6f726d..0bfb2be 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -425,7 +425,8 @@ static int paging_log_dirty_op(struct domain *d,
          * Mark dirty all currently write-mapped pages on e.g. the
          * final iteration of a save operation.
          */
-        if ( sc->mode & XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL )
+        if ( has_hvm_container_domain(d) &&
+             (sc->mode & XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL) )
             hvm_mapped_guest_frames_mark_dirty(d);
 
         domain_pause(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 Thu Oct 29 10:16:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 10:16: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 1ZrkFW-0002Ij-Ra; Thu, 29 Oct 2015 10:16: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 1ZrkFV-0002IP-Rr
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:16:02 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	09/18-04752-0E1F1365; Thu, 29 Oct 2015 10:16:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446113758!62515721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25500 invoked from network); 29 Oct 2015 10:16:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 10:16:00 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkFR-0004fG-W0
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrkFR-0005Mt-UA
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 10:15:57 +0000
Date: Thu, 29 Oct 2015 10:15:57 +0000
Message-Id: <E1ZrkFR-0005Mt-UA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: don't call HVM-only function
	for PV guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf0d4923d7783ece38bb8f3b832e8df0f3fc284b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 27 16:34:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 27 16:34:29 2015 +0100

    x86/mm: don't call HVM-only function for PV guests
    
    Somehow I managed to drop the HVM dependency from v2 to v3 of what
    became commit 5c23c760a8 ("x86/HVM: correct page dirty marking in
    hvm_map_guest_frame_rw()"), obviously breaking migration of PV guests.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/paging.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index e6f726d..0bfb2be 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -425,7 +425,8 @@ static int paging_log_dirty_op(struct domain *d,
          * Mark dirty all currently write-mapped pages on e.g. the
          * final iteration of a save operation.
          */
-        if ( sc->mode & XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL )
+        if ( has_hvm_container_domain(d) &&
+             (sc->mode & XEN_DOMCTL_SHADOW_LOGDIRTY_FINAL) )
             hvm_mapped_guest_frames_mark_dirty(d);
 
         domain_pause(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 Thu Oct 29 12:44:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12: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 1ZrmYt-0007Q2-51; Thu, 29 Oct 2015 12:44: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 1ZrmYr-0007Pv-Cs
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:09 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	62/AA-19110-89412365; Thu, 29 Oct 2015 12:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1446122646!26600068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29003 invoked from network); 29 Oct 2015 12:44:07 -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;
	29 Oct 2015 12:44:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmYn-0006BV-A7
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmYm-0004lY-Bq
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:04 +0000
Date: Thu, 29 Oct 2015 12:44:04 +0000
Message-Id: <E1ZrmYm-0004lY-Bq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] VT-d: don't suppress invalidation
	address write when it is zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a262a89198551d5b74477b21cdc733ce414c1ff0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:30:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:30:12 2015 +0200

    VT-d: don't suppress invalidation address write when it is zero
    
    GFN zero is a valid address, and hence may need invalidation done for
    it just like for any other GFN.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 710942e57fb42ff8f344ca82f6b678f67e38ae63
    master date: 2015-10-12 15:58:35 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c2e22a6..c085339 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -414,7 +414,7 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 {
     struct iommu *iommu = (struct iommu *) _iommu;
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
-    u64 val = 0, val_iva = 0;
+    u64 val = 0;
     unsigned long flags;
 
     /*
@@ -435,7 +435,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
     switch ( type )
     {
     case DMA_TLB_GLOBAL_FLUSH:
-        /* global flush doesn't need set IVA_REG */
         val = DMA_TLB_GLOBAL_FLUSH|DMA_TLB_IVT;
         break;
     case DMA_TLB_DSI_FLUSH:
@@ -443,8 +442,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
         break;
     case DMA_TLB_PSI_FLUSH:
         val = DMA_TLB_PSI_FLUSH|DMA_TLB_IVT|DMA_TLB_DID(did);
-        /* Note: always flush non-leaf currently */
-        val_iva = size_order | addr;
         break;
     default:
         BUG();
@@ -457,8 +454,11 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     /* Note: Only uses first TLB reg currently */
-    if ( val_iva )
-        dmar_writeq(iommu->reg, tlb_offset, val_iva);
+    if ( type == DMA_TLB_PSI_FLUSH )
+    {
+        /* Note: always flush non-leaf currently. */
+        dmar_writeq(iommu->reg, tlb_offset, size_order | addr);
+    }
     dmar_writeq(iommu->reg, tlb_offset + 8, val);
 
     /* Make sure hardware complete it */
--
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 Oct 29 12:44:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12: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 1ZrmYt-0007Q2-51; Thu, 29 Oct 2015 12:44: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 1ZrmYr-0007Pv-Cs
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:09 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	62/AA-19110-89412365; Thu, 29 Oct 2015 12:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1446122646!26600068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29003 invoked from network); 29 Oct 2015 12:44:07 -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;
	29 Oct 2015 12:44:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmYn-0006BV-A7
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmYm-0004lY-Bq
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:04 +0000
Date: Thu, 29 Oct 2015 12:44:04 +0000
Message-Id: <E1ZrmYm-0004lY-Bq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] VT-d: don't suppress invalidation
	address write when it is zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a262a89198551d5b74477b21cdc733ce414c1ff0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:30:12 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:30:12 2015 +0200

    VT-d: don't suppress invalidation address write when it is zero
    
    GFN zero is a valid address, and hence may need invalidation done for
    it just like for any other GFN.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 710942e57fb42ff8f344ca82f6b678f67e38ae63
    master date: 2015-10-12 15:58:35 +0200
---
 xen/drivers/passthrough/vtd/iommu.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c2e22a6..c085339 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -414,7 +414,7 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 {
     struct iommu *iommu = (struct iommu *) _iommu;
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
-    u64 val = 0, val_iva = 0;
+    u64 val = 0;
     unsigned long flags;
 
     /*
@@ -435,7 +435,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
     switch ( type )
     {
     case DMA_TLB_GLOBAL_FLUSH:
-        /* global flush doesn't need set IVA_REG */
         val = DMA_TLB_GLOBAL_FLUSH|DMA_TLB_IVT;
         break;
     case DMA_TLB_DSI_FLUSH:
@@ -443,8 +442,6 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
         break;
     case DMA_TLB_PSI_FLUSH:
         val = DMA_TLB_PSI_FLUSH|DMA_TLB_IVT|DMA_TLB_DID(did);
-        /* Note: always flush non-leaf currently */
-        val_iva = size_order | addr;
         break;
     default:
         BUG();
@@ -457,8 +454,11 @@ static int flush_iotlb_reg(void *_iommu, u16 did,
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     /* Note: Only uses first TLB reg currently */
-    if ( val_iva )
-        dmar_writeq(iommu->reg, tlb_offset, val_iva);
+    if ( type == DMA_TLB_PSI_FLUSH )
+    {
+        /* Note: always flush non-leaf currently. */
+        dmar_writeq(iommu->reg, tlb_offset, size_order | addr);
+    }
     dmar_writeq(iommu->reg, tlb_offset + 8, val);
 
     /* Make sure hardware complete it */
--
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 Oct 29 12:44:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrmZ2-0007Qe-7b; Thu, 29 Oct 2015 12:44:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZ1-0007QV-4G
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:19 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	F9/73-06179-2A412365; Thu, 29 Oct 2015 12:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1446122656!46096864!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4357 invoked from network); 29 Oct 2015 12:44:17 -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;
	29 Oct 2015 12:44:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmYy-0006BZ-I5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmYy-0004m6-D0
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:16 +0000
Date: Thu, 29 Oct 2015 12:44:16 +0000
Message-Id: <E1ZrmYy-0004m6-D0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: hide MWAITX from PV domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0368463ece89a400c2f63800b782929d4b5fb949
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:31:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:31:02 2015 +0200

    x86: hide MWAITX from PV domains
    
    Since MWAIT is hidden too. (Linux starting with 4.3 is making use of
    that feature, and is checking for it without looking at the MWAIT one.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 941cd44324db7eddc46cba4596fa13d505066ccf
    master date: 2015-10-13 17:17:52 +0200
---
 xen/arch/x86/traps.c             |    1 +
 xen/include/asm-x86/cpufeature.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index c037b00..1c3db47 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -904,6 +904,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_LWP % 32, &c);
         __clear_bit(X86_FEATURE_NODEID_MSR % 32, &c);
         __clear_bit(X86_FEATURE_TOPOEXT % 32, &c);
+        __clear_bit(X86_FEATURE_MWAITX % 32, &c);
         break;
 
     case 0x00000005: /* MONITOR/MWAIT */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index d3bd14d..4caa4e6 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -137,6 +137,7 @@
 #define X86_FEATURE_TBM         (6*32+21) /* trailing bit manipulations */
 #define X86_FEATURE_TOPOEXT     (6*32+22) /* topology extensions CPUID leafs */
 #define X86_FEATURE_DBEXT       (6*32+26) /* data breakpoint extension */
+#define X86_FEATURE_MWAITX      (6*32+29) /* MWAIT extension (MONITORX/MWAITX) */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
--
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 Oct 29 12:44:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrmZ2-0007Qe-7b; Thu, 29 Oct 2015 12:44:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZ1-0007QV-4G
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:19 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	F9/73-06179-2A412365; Thu, 29 Oct 2015 12:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1446122656!46096864!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4357 invoked from network); 29 Oct 2015 12:44:17 -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;
	29 Oct 2015 12:44:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmYy-0006BZ-I5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmYy-0004m6-D0
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:16 +0000
Date: Thu, 29 Oct 2015 12:44:16 +0000
Message-Id: <E1ZrmYy-0004m6-D0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: hide MWAITX from PV domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0368463ece89a400c2f63800b782929d4b5fb949
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:31:02 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:31:02 2015 +0200

    x86: hide MWAITX from PV domains
    
    Since MWAIT is hidden too. (Linux starting with 4.3 is making use of
    that feature, and is checking for it without looking at the MWAIT one.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 941cd44324db7eddc46cba4596fa13d505066ccf
    master date: 2015-10-13 17:17:52 +0200
---
 xen/arch/x86/traps.c             |    1 +
 xen/include/asm-x86/cpufeature.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index c037b00..1c3db47 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -904,6 +904,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_LWP % 32, &c);
         __clear_bit(X86_FEATURE_NODEID_MSR % 32, &c);
         __clear_bit(X86_FEATURE_TOPOEXT % 32, &c);
+        __clear_bit(X86_FEATURE_MWAITX % 32, &c);
         break;
 
     case 0x00000005: /* MONITOR/MWAIT */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index d3bd14d..4caa4e6 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -137,6 +137,7 @@
 #define X86_FEATURE_TBM         (6*32+21) /* trailing bit manipulations */
 #define X86_FEATURE_TOPOEXT     (6*32+22) /* topology extensions CPUID leafs */
 #define X86_FEATURE_DBEXT       (6*32+26) /* data breakpoint extension */
+#define X86_FEATURE_MWAITX      (6*32+29) /* MWAIT extension (MONITORX/MWAITX) */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
--
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 Oct 29 12:44:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:44: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 1ZrmZE-0007SI-A5; Thu, 29 Oct 2015 12:44:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZD-0007S7-4F
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:31 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	AD/2D-03763-EA412365; Thu, 29 Oct 2015 12:44:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446122667!11926479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26209 invoked from network); 29 Oct 2015 12:44:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 12:44:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZ9-0006Bl-Lu
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZ8-0004mg-PU
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:26 +0000
Date: Thu, 29 Oct 2015 12:44:26 +0000
Message-Id: <E1ZrmZ8-0004mg-PU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/NUMA: fix SRAT table processor
	entry parsing and consumption
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53c11b041793944e26165f294fb96242c459d197
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:33:32 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:33:32 2015 +0200

    x86/NUMA: fix SRAT table processor entry parsing and consumption
    
    - don't overrun apicid_to_node[] (possible in the x2APIC case)
    - don't limit number of processor related SRAT entries we can consume
    - make acpi_numa_{processor,x2apic}_affinity_init() as similar to one
      another as possible
    - print APIC IDs in hex (to ease matching with other log messages), at
      once making legacy and x2APIC ones distinguishable (by width)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 83281fc9b31396e94c0bfb6550b75c165037a0ad
    master date: 2015-10-14 12:46:27 +0200
---
 xen/arch/x86/numa.c     |    2 +-
 xen/arch/x86/setup.c    |    2 +-
 xen/arch/x86/smpboot.c  |    3 ++-
 xen/arch/x86/srat.c     |   18 +++++++++++-------
 xen/drivers/acpi/numa.c |    4 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 628a40a..a526f77 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -347,7 +347,7 @@ void __init init_cpu_to_node(void)
         u32 apicid = x86_cpu_to_apicid[i];
         if ( apicid == BAD_APICID )
             continue;
-        node = apicid_to_node[apicid];
+        node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
         if ( node == NUMA_NO_NODE || !node_online(node) )
             node = 0;
         numa_set_node(i, node);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 1efe02f..ff608fd 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -191,7 +191,7 @@ void __devinit srat_detect_node(int cpu)
     unsigned node;
     u32 apicid = x86_cpu_to_apicid[cpu];
 
-    node = apicid_to_node[apicid];
+    node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
     if ( node == NUMA_NO_NODE )
         node = 0;
 
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index fe376f0..a84f038 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -885,7 +885,8 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm)
             cpu = node;
             goto out;
         }
-        apicid_to_node[apic_id] = node;
+        if ( apic_id < MAX_LOCAL_APIC )
+             apicid_to_node[apic_id] = node;
     }
 
     /* Physically added CPUs do not have synchronised TSC. */
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 12bb008..8d6a10e 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -170,7 +170,6 @@ void __init
 acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 {
 	int pxm, node;
-	int apic_id;
 
 	if (srat_disabled())
 		return;
@@ -178,8 +177,13 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		bad_srat();
 		return;
 	}
-	if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
+	if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
+		return;
+	if (pa->apic_id >= MAX_LOCAL_APIC) {
+		printk(KERN_INFO "SRAT: APIC %08x ignored\n", pa->apic_id);
 		return;
+	}
+
 	pxm = pa->proximity_domain;
 	node = setup_node(pxm);
 	if (node < 0) {
@@ -187,11 +191,11 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		return;
 	}
 
-	apic_id = pa->apic_id;
-	apicid_to_node[apic_id] = node;
+	apicid_to_node[pa->apic_id] = node;
+	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
-	       pxm, apic_id, node);
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n",
+	       pxm, pa->apic_id, node);
 }
 
 /* Callback for Proximity Domain -> LAPIC mapping */
@@ -221,7 +225,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	apicid_to_node[pa->apic_id] = node;
 	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n",
 	       pxm, pa->apic_id, node);
 }
 
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 775537b..9b4543a 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -199,9 +199,9 @@ int __init acpi_numa_init(void)
 	/* SRAT: Static Resource Affinity Table */
 	if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
-				      acpi_parse_x2apic_affinity, NR_CPUS);
+				      acpi_parse_x2apic_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
-				      acpi_parse_processor_affinity, NR_CPUS);
+				      acpi_parse_processor_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
 				      acpi_parse_memory_affinity,
 				      NR_NODE_MEMBLKS);
--
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 Oct 29 12:44:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:44: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 1ZrmZE-0007SI-A5; Thu, 29 Oct 2015 12:44:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZD-0007S7-4F
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:31 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	AD/2D-03763-EA412365; Thu, 29 Oct 2015 12:44:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446122667!11926479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26209 invoked from network); 29 Oct 2015 12:44:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 12:44:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZ9-0006Bl-Lu
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZ8-0004mg-PU
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:26 +0000
Date: Thu, 29 Oct 2015 12:44:26 +0000
Message-Id: <E1ZrmZ8-0004mg-PU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/NUMA: fix SRAT table processor
	entry parsing and consumption
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53c11b041793944e26165f294fb96242c459d197
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 21 17:33:32 2015 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 21 17:33:32 2015 +0200

    x86/NUMA: fix SRAT table processor entry parsing and consumption
    
    - don't overrun apicid_to_node[] (possible in the x2APIC case)
    - don't limit number of processor related SRAT entries we can consume
    - make acpi_numa_{processor,x2apic}_affinity_init() as similar to one
      another as possible
    - print APIC IDs in hex (to ease matching with other log messages), at
      once making legacy and x2APIC ones distinguishable (by width)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 83281fc9b31396e94c0bfb6550b75c165037a0ad
    master date: 2015-10-14 12:46:27 +0200
---
 xen/arch/x86/numa.c     |    2 +-
 xen/arch/x86/setup.c    |    2 +-
 xen/arch/x86/smpboot.c  |    3 ++-
 xen/arch/x86/srat.c     |   18 +++++++++++-------
 xen/drivers/acpi/numa.c |    4 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 628a40a..a526f77 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -347,7 +347,7 @@ void __init init_cpu_to_node(void)
         u32 apicid = x86_cpu_to_apicid[i];
         if ( apicid == BAD_APICID )
             continue;
-        node = apicid_to_node[apicid];
+        node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
         if ( node == NUMA_NO_NODE || !node_online(node) )
             node = 0;
         numa_set_node(i, node);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 1efe02f..ff608fd 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -191,7 +191,7 @@ void __devinit srat_detect_node(int cpu)
     unsigned node;
     u32 apicid = x86_cpu_to_apicid[cpu];
 
-    node = apicid_to_node[apicid];
+    node = apicid < MAX_LOCAL_APIC ? apicid_to_node[apicid] : NUMA_NO_NODE;
     if ( node == NUMA_NO_NODE )
         node = 0;
 
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index fe376f0..a84f038 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -885,7 +885,8 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm)
             cpu = node;
             goto out;
         }
-        apicid_to_node[apic_id] = node;
+        if ( apic_id < MAX_LOCAL_APIC )
+             apicid_to_node[apic_id] = node;
     }
 
     /* Physically added CPUs do not have synchronised TSC. */
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 12bb008..8d6a10e 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -170,7 +170,6 @@ void __init
 acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 {
 	int pxm, node;
-	int apic_id;
 
 	if (srat_disabled())
 		return;
@@ -178,8 +177,13 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		bad_srat();
 		return;
 	}
-	if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
+	if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
+		return;
+	if (pa->apic_id >= MAX_LOCAL_APIC) {
+		printk(KERN_INFO "SRAT: APIC %08x ignored\n", pa->apic_id);
 		return;
+	}
+
 	pxm = pa->proximity_domain;
 	node = setup_node(pxm);
 	if (node < 0) {
@@ -187,11 +191,11 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 		return;
 	}
 
-	apic_id = pa->apic_id;
-	apicid_to_node[apic_id] = node;
+	apicid_to_node[pa->apic_id] = node;
+	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
-	       pxm, apic_id, node);
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n",
+	       pxm, pa->apic_id, node);
 }
 
 /* Callback for Proximity Domain -> LAPIC mapping */
@@ -221,7 +225,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	apicid_to_node[pa->apic_id] = node;
 	node_set(node, processor_nodes_parsed);
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n",
 	       pxm, pa->apic_id, node);
 }
 
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 775537b..9b4543a 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -199,9 +199,9 @@ int __init acpi_numa_init(void)
 	/* SRAT: Static Resource Affinity Table */
 	if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
-				      acpi_parse_x2apic_affinity, NR_CPUS);
+				      acpi_parse_x2apic_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
-				      acpi_parse_processor_affinity, NR_CPUS);
+				      acpi_parse_processor_affinity, 0);
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
 				      acpi_parse_memory_affinity,
 				      NR_NODE_MEMBLKS);
--
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 Oct 29 12:44:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:44: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 1ZrmZO-0007Tx-Ct; Thu, 29 Oct 2015 12:44:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZM-0007Tc-My
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:40 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	D2/61-01421-7B412365; Thu, 29 Oct 2015 12:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446122678!58040385!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7165 invoked from network); 29 Oct 2015 12:44:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 12:44:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZK-0006By-4M
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZJ-0004ns-Tf
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:38 +0000
Date: Thu, 29 Oct 2015 12:44:37 +0000
Message-Id: <E1ZrmZJ-0004ns-Tf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] libxl: use correct command line
	for arm guests.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9befcd335c21818caaf5c5ab764d31a4006d2800
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Aug 6 11:55:57 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 21 17:08:56 2015 +0100

    libxl: use correct command line for arm guests.
    
    We need to use libxl__domain_build_state.pv_cmdline in order to pickup
    the correct args when using pygrub. libxl_domain_build_info.cmdline is
    any args statically configured by the user.
    
    This is consistent with the call to xc_domain_allocate, which takes
    the cmdline too (in that case for x86/PV usage).
    
    state->pv_cmdline is also set for non-pygrub guests, since
    libxl__bootloader_run propagates info->cmdline if no bootloader is
    configured.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 201eac83831d94ba2e9a63a7eed4c128633fafb1)
---
 tools/libxl/libxl_arm.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 448ac07..f89533b 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -195,6 +195,7 @@ static int make_root_properties(libxl__gc *gc,
 }
 
 static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
+                            libxl__domain_build_state *state,
                             const libxl_domain_build_info *info)
 {
     int res;
@@ -203,8 +204,9 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;
 
-    if (info->cmdline) {
-        res = fdt_property_string(fdt, "bootargs", info->cmdline);
+    if (state->pv_cmdline) {
+        LOG(DEBUG, "/chosen/bootargs = %s", state->pv_cmdline);
+        res = fdt_property_string(fdt, "bootargs", state->pv_cmdline);
         if (res) return res;
     }
 
@@ -586,7 +588,7 @@ next_resize:
         FDT( fdt_begin_node(fdt, "") );
 
         FDT( make_root_properties(gc, vers, fdt) );
-        FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, info) );
+        FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, state, info) );
         FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
         FDT( make_psci_node(gc, fdt) );
 
--
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 Oct 29 12:44:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:44: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 1ZrmZO-0007Tx-Ct; Thu, 29 Oct 2015 12:44:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZM-0007Tc-My
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:40 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	D2/61-01421-7B412365; Thu, 29 Oct 2015 12:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446122678!58040385!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7165 invoked from network); 29 Oct 2015 12:44:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 12:44:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZK-0006By-4M
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZJ-0004ns-Tf
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:38 +0000
Date: Thu, 29 Oct 2015 12:44:37 +0000
Message-Id: <E1ZrmZJ-0004ns-Tf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] libxl: use correct command line
	for arm guests.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9befcd335c21818caaf5c5ab764d31a4006d2800
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Aug 6 11:55:57 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 21 17:08:56 2015 +0100

    libxl: use correct command line for arm guests.
    
    We need to use libxl__domain_build_state.pv_cmdline in order to pickup
    the correct args when using pygrub. libxl_domain_build_info.cmdline is
    any args statically configured by the user.
    
    This is consistent with the call to xc_domain_allocate, which takes
    the cmdline too (in that case for x86/PV usage).
    
    state->pv_cmdline is also set for non-pygrub guests, since
    libxl__bootloader_run propagates info->cmdline if no bootloader is
    configured.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    (cherry picked from commit 201eac83831d94ba2e9a63a7eed4c128633fafb1)
---
 tools/libxl/libxl_arm.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 448ac07..f89533b 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -195,6 +195,7 @@ static int make_root_properties(libxl__gc *gc,
 }
 
 static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
+                            libxl__domain_build_state *state,
                             const libxl_domain_build_info *info)
 {
     int res;
@@ -203,8 +204,9 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;
 
-    if (info->cmdline) {
-        res = fdt_property_string(fdt, "bootargs", info->cmdline);
+    if (state->pv_cmdline) {
+        LOG(DEBUG, "/chosen/bootargs = %s", state->pv_cmdline);
+        res = fdt_property_string(fdt, "bootargs", state->pv_cmdline);
         if (res) return res;
     }
 
@@ -586,7 +588,7 @@ next_resize:
         FDT( fdt_begin_node(fdt, "") );
 
         FDT( make_root_properties(gc, vers, fdt) );
-        FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, info) );
+        FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, state, info) );
         FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
         FDT( make_psci_node(gc, fdt) );
 
--
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 Oct 29 12:44:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:44:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrmZY-0007W5-Fw; Thu, 29 Oct 2015 12:44:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZX-0007Vg-18
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:51 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	63/71-32641-2C412365; Thu, 29 Oct 2015 12:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446122688!58040458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8678 invoked from network); 29 Oct 2015 12:44:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 12:44:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZU-0006C6-Du
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZU-0004oH-BO
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:48 +0000
Date: Thu, 29 Oct 2015 12:44:48 +0000
Message-Id: <E1ZrmZU-0004oH-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] tools/libxc: arm: Check the index
	before accessing the bank
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5d0480d9c5b36b5f47459ce92ed3c67b7bed51d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Sep 17 18:36:36 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 21 17:09:14 2015 +0100

    tools/libxc: arm: Check the index before accessing the bank
    
    When creating a guest with more than 3GB of memory, the 2 banks will be
    used and the loop with overrunning. The code will fail later on because
    Xen will deny to populate the region:
    
    domainbuilder: detail: xc_dom_devicetree_mem: called
    domainbuilder: detail: xc_dom_mem_init: mem 3096 MB, pages 0xc1800 pages, 4k each
    domainbuilder: detail: xc_dom_mem_init: 0xc1800 pages
    domainbuilder: detail: xc_dom_boot_mem_init: called
    domainbuilder: detail: set_mode: guest xen-3.0-aarch64, address size 64
    domainbuilder: detail: xc_dom_malloc            : 14384 kB
    domainbuilder: detail: populate_guest_memory: populating RAM @0000000040000000-0000000100000000 (3072MB)
    domainbuilder: detail: populate_one_size: populated 0x3/0x3 entries with shift 18
    domainbuilder: detail: populate_guest_memory: populating RAM @0000000200000000-0000000201800000 (24MB)
    domainbuilder: detail: populate_one_size: populated 0xc/0xc entries with shift 9
    domainbuilder: detail: populate_guest_memory: populating RAM @0000007fad41c000-0007fb39dd42c000 (2141954816MB)
    domainbuilder: detail: populate_one_size: populated 0x100/0x1e4 entries with shift 0
    domainbuilder: detail: populate_guest_memory: Not enough RAM
    
    This is because we are currently accessing the bank before checking the
    validity of the index. AFAICT, on  Debian Jessie, the compiler (gcc 4.9.2) is
    assuming that it's not necessary to verify the index because it's used
    before. This is a valid assumption because the operand of && are
    execute from from left to right.
    
    Re-order the checks to verify the validity of the index before accessing
    the bank.
    
    The problem has been present since the introduction of the multi-bank
    feature in commit 45d9867837f099e9eed4189dac5ed39d1fe2ed49 " tools: arm:
    prepare domain builder for multiple banks of guest RAM".
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit ed5c2c05cfa557b2391aef9557864d8d958d8d84)
---
 tools/libxc/xc_dom_arm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 9b31b1f..62b1523 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -456,7 +456,7 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         dom->p2m_host[pfn] = INVALID_MFN;
 
     /* setup initial p2m and allocate guest memory */
-    for ( i = 0; dom->rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
+    for ( i = 0; i < GUEST_RAM_BANKS && dom->rambank_size[i]; i++ )
     {
         if ((rc = populate_guest_memory(dom,
                                         bankbase[i] >> XC_PAGE_SHIFT,
--
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 Oct 29 12:44:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:44:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrmZY-0007W5-Fw; Thu, 29 Oct 2015 12:44:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZX-0007Vg-18
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:51 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	63/71-32641-2C412365; Thu, 29 Oct 2015 12:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446122688!58040458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8678 invoked from network); 29 Oct 2015 12:44:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 12:44:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZU-0006C6-Du
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZU-0004oH-BO
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:48 +0000
Date: Thu, 29 Oct 2015 12:44:48 +0000
Message-Id: <E1ZrmZU-0004oH-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] tools/libxc: arm: Check the index
	before accessing the bank
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5d0480d9c5b36b5f47459ce92ed3c67b7bed51d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Sep 17 18:36:36 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 21 17:09:14 2015 +0100

    tools/libxc: arm: Check the index before accessing the bank
    
    When creating a guest with more than 3GB of memory, the 2 banks will be
    used and the loop with overrunning. The code will fail later on because
    Xen will deny to populate the region:
    
    domainbuilder: detail: xc_dom_devicetree_mem: called
    domainbuilder: detail: xc_dom_mem_init: mem 3096 MB, pages 0xc1800 pages, 4k each
    domainbuilder: detail: xc_dom_mem_init: 0xc1800 pages
    domainbuilder: detail: xc_dom_boot_mem_init: called
    domainbuilder: detail: set_mode: guest xen-3.0-aarch64, address size 64
    domainbuilder: detail: xc_dom_malloc            : 14384 kB
    domainbuilder: detail: populate_guest_memory: populating RAM @0000000040000000-0000000100000000 (3072MB)
    domainbuilder: detail: populate_one_size: populated 0x3/0x3 entries with shift 18
    domainbuilder: detail: populate_guest_memory: populating RAM @0000000200000000-0000000201800000 (24MB)
    domainbuilder: detail: populate_one_size: populated 0xc/0xc entries with shift 9
    domainbuilder: detail: populate_guest_memory: populating RAM @0000007fad41c000-0007fb39dd42c000 (2141954816MB)
    domainbuilder: detail: populate_one_size: populated 0x100/0x1e4 entries with shift 0
    domainbuilder: detail: populate_guest_memory: Not enough RAM
    
    This is because we are currently accessing the bank before checking the
    validity of the index. AFAICT, on  Debian Jessie, the compiler (gcc 4.9.2) is
    assuming that it's not necessary to verify the index because it's used
    before. This is a valid assumption because the operand of && are
    execute from from left to right.
    
    Re-order the checks to verify the validity of the index before accessing
    the bank.
    
    The problem has been present since the introduction of the multi-bank
    feature in commit 45d9867837f099e9eed4189dac5ed39d1fe2ed49 " tools: arm:
    prepare domain builder for multiple banks of guest RAM".
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit ed5c2c05cfa557b2391aef9557864d8d958d8d84)
---
 tools/libxc/xc_dom_arm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 9b31b1f..62b1523 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -456,7 +456,7 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         dom->p2m_host[pfn] = INVALID_MFN;
 
     /* setup initial p2m and allocate guest memory */
-    for ( i = 0; dom->rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
+    for ( i = 0; i < GUEST_RAM_BANKS && dom->rambank_size[i]; i++ )
     {
         if ((rc = populate_guest_memory(dom,
                                         bankbase[i] >> XC_PAGE_SHIFT,
--
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 Oct 29 12:45:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:45: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 1ZrmZi-0007Xe-IR; Thu, 29 Oct 2015 12:45:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZh-0007XK-0j
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:45:01 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	2A/DC-30270-CC412365; Thu, 29 Oct 2015 12:45:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446122698!40703375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25652 invoked from network); 29 Oct 2015 12:44:59 -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 Oct 2015 12:44:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZe-0006CE-Nd
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZe-0004og-Lv
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:58 +0000
Date: Thu, 29 Oct 2015 12:44:58 +0000
Message-Id: <E1ZrmZe-0004og-Lv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Revert "libxl: use correct command
	line for arm guests."
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 47db4b088d18d900b5613ecb872283804320dde9
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Oct 26 11:16:06 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 26 11:25:07 2015 +0000

    Revert "libxl: use correct command line for arm guests."
    
    This reverts commit 9befcd335c21818caaf5c5ab764d31a4006d2800.
    
    This commit breaks the build:
     libxl_arm.c: In function 'libxl__arch_domain_init_hw_description':
     libxl_arm.c:591:76: error: 'state' undeclared (first use in this function)
     libxl_arm.c:591:76: note: each undeclared identifier is reported only once fo\
    r each function it appears in
     make[3]: *** [libxl_arm.o] Error 1
    
    "state" was introduced in a7511905 "xen: Extend DOMCTL createdomain to
    support arch configuration".
    
    On Julien's recommendation: a7511905 ought not to be backported, so
    revert this and wait for Ian Campbell to get back.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    CC: Julien Grall <julien.grall@citrix.com>
    CC: Ian Campbell <Ian.Campbell@eu.citrix.com>
    CC: Jan Beulich <JBeulich@suse.com>
---
 tools/libxl/libxl_arm.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index f89533b..448ac07 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -195,7 +195,6 @@ static int make_root_properties(libxl__gc *gc,
 }
 
 static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
-                            libxl__domain_build_state *state,
                             const libxl_domain_build_info *info)
 {
     int res;
@@ -204,9 +203,8 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;
 
-    if (state->pv_cmdline) {
-        LOG(DEBUG, "/chosen/bootargs = %s", state->pv_cmdline);
-        res = fdt_property_string(fdt, "bootargs", state->pv_cmdline);
+    if (info->cmdline) {
+        res = fdt_property_string(fdt, "bootargs", info->cmdline);
         if (res) return res;
     }
 
@@ -588,7 +586,7 @@ next_resize:
         FDT( fdt_begin_node(fdt, "") );
 
         FDT( make_root_properties(gc, vers, fdt) );
-        FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, state, info) );
+        FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, info) );
         FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
         FDT( make_psci_node(gc, fdt) );
 
--
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 Oct 29 12:45:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 12:45: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 1ZrmZi-0007Xe-IR; Thu, 29 Oct 2015 12:45:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZh-0007XK-0j
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:45:01 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	2A/DC-30270-CC412365; Thu, 29 Oct 2015 12:45:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446122698!40703375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25652 invoked from network); 29 Oct 2015 12:44:59 -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 Oct 2015 12:44:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZe-0006CE-Nd
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrmZe-0004og-Lv
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 12:44:58 +0000
Date: Thu, 29 Oct 2015 12:44:58 +0000
Message-Id: <E1ZrmZe-0004og-Lv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Revert "libxl: use correct command
	line for arm guests."
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 47db4b088d18d900b5613ecb872283804320dde9
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Oct 26 11:16:06 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 26 11:25:07 2015 +0000

    Revert "libxl: use correct command line for arm guests."
    
    This reverts commit 9befcd335c21818caaf5c5ab764d31a4006d2800.
    
    This commit breaks the build:
     libxl_arm.c: In function 'libxl__arch_domain_init_hw_description':
     libxl_arm.c:591:76: error: 'state' undeclared (first use in this function)
     libxl_arm.c:591:76: note: each undeclared identifier is reported only once fo\
    r each function it appears in
     make[3]: *** [libxl_arm.o] Error 1
    
    "state" was introduced in a7511905 "xen: Extend DOMCTL createdomain to
    support arch configuration".
    
    On Julien's recommendation: a7511905 ought not to be backported, so
    revert this and wait for Ian Campbell to get back.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    CC: Julien Grall <julien.grall@citrix.com>
    CC: Ian Campbell <Ian.Campbell@eu.citrix.com>
    CC: Jan Beulich <JBeulich@suse.com>
---
 tools/libxl/libxl_arm.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index f89533b..448ac07 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -195,7 +195,6 @@ static int make_root_properties(libxl__gc *gc,
 }
 
 static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
-                            libxl__domain_build_state *state,
                             const libxl_domain_build_info *info)
 {
     int res;
@@ -204,9 +203,8 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool ramdisk,
     res = fdt_begin_node(fdt, "chosen");
     if (res) return res;
 
-    if (state->pv_cmdline) {
-        LOG(DEBUG, "/chosen/bootargs = %s", state->pv_cmdline);
-        res = fdt_property_string(fdt, "bootargs", state->pv_cmdline);
+    if (info->cmdline) {
+        res = fdt_property_string(fdt, "bootargs", info->cmdline);
         if (res) return res;
     }
 
@@ -588,7 +586,7 @@ next_resize:
         FDT( fdt_begin_node(fdt, "") );
 
         FDT( make_root_properties(gc, vers, fdt) );
-        FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, state, info) );
+        FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, info) );
         FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
         FDT( make_psci_node(gc, fdt) );
 
--
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 Oct 29 15:33:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:33: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 1ZrpCP-0000Aa-R8; Thu, 29 Oct 2015 15:33:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCO-0000AV-Mm
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:08 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	64/FA-30270-43C32365; Thu, 29 Oct 2015 15:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1446132786!46160837!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11574 invoked from network); 29 Oct 2015 15:33:07 -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;
	29 Oct 2015 15:33:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCL-00082f-Ul
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 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 1ZrpCL-0004R9-Oz
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:05 +0000
Date: Thu, 29 Oct 2015 15:33:05 +0000
Message-Id: <E1ZrpCL-0004R9-Oz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] virtio-blk:
	initialise unused blkcfg.size_max field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 835928ed5d9a707c95e19213e1a201366678cb1c
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:23:24 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:05 2015 +0100

    virtio-blk: initialise unused blkcfg.size_max field
    
    Newer GCC warns about memcpy()ing uninitialised data.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1056088
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/virtio-blk.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 520ad1b..fcf893a 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -252,6 +252,7 @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
     stw_raw(&blkcfg.cylinders, cylinders);
     blkcfg.heads = heads;
     blkcfg.sectors = secs;
+    blkcfg.size_max = 0;
     memcpy(config, &blkcfg, sizeof(blkcfg));
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:33: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 1ZrpCP-0000Aa-R8; Thu, 29 Oct 2015 15:33:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCO-0000AV-Mm
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:08 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	64/FA-30270-43C32365; Thu, 29 Oct 2015 15:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1446132786!46160837!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11574 invoked from network); 29 Oct 2015 15:33:07 -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;
	29 Oct 2015 15:33:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCL-00082f-Ul
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 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 1ZrpCL-0004R9-Oz
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:05 +0000
Date: Thu, 29 Oct 2015 15:33:05 +0000
Message-Id: <E1ZrpCL-0004R9-Oz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] virtio-blk:
	initialise unused blkcfg.size_max field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 835928ed5d9a707c95e19213e1a201366678cb1c
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:23:24 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:05 2015 +0100

    virtio-blk: initialise unused blkcfg.size_max field
    
    Newer GCC warns about memcpy()ing uninitialised data.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1056088
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/virtio-blk.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 520ad1b..fcf893a 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -252,6 +252,7 @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
     stw_raw(&blkcfg.cylinders, cylinders);
     blkcfg.heads = heads;
     blkcfg.sectors = secs;
+    blkcfg.size_max = 0;
     memcpy(config, &blkcfg, sizeof(blkcfg));
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 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 1ZrpCZ-0000BM-TV; Thu, 29 Oct 2015 15: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 1ZrpCZ-0000BF-Bn
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:19 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	C8/99-15765-E3C32365; Thu, 29 Oct 2015 15:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446132796!62635978!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17839 invoked from network); 29 Oct 2015 15:33:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 15:33:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCW-00082n-B2
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCW-0004RV-6I
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:16 +0000
Date: Thu, 29 Oct 2015 15:33:16 +0000
Message-Id: <E1ZrpCW-0004RV-6I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] cirrus_vga:
	default all I/O port reads to 0xff
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c615d81a3c0fca9ca4706f6505cc032c737cf0c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:39:43 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:05 2015 +0100

    cirrus_vga: default all I/O port reads to 0xff
    
    Some error paths in vga_ioport_read() would return undefined values.
    Always default the result to 0xff.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a26b051..11ce212 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2674,7 +2674,7 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
 static uint32_t vga_ioport_read(void *opaque, uint32_t addr)
 {
     CirrusVGAState *s = opaque;
-    int val, index;
+    int val = 0xff, index;
 
     /* check port range access depending on color/monochrome mode */
     if ((addr >= 0x3b0 && addr <= 0x3bf && (s->msr & MSR_COLOR_EMULATION))
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 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 1ZrpCZ-0000BM-TV; Thu, 29 Oct 2015 15: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 1ZrpCZ-0000BF-Bn
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:19 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	C8/99-15765-E3C32365; Thu, 29 Oct 2015 15:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446132796!62635978!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17839 invoked from network); 29 Oct 2015 15:33:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 15:33:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCW-00082n-B2
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCW-0004RV-6I
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:16 +0000
Date: Thu, 29 Oct 2015 15:33:16 +0000
Message-Id: <E1ZrpCW-0004RV-6I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] cirrus_vga:
	default all I/O port reads to 0xff
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c615d81a3c0fca9ca4706f6505cc032c737cf0c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:39:43 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:05 2015 +0100

    cirrus_vga: default all I/O port reads to 0xff
    
    Some error paths in vga_ioport_read() would return undefined values.
    Always default the result to 0xff.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/cirrus_vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a26b051..11ce212 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2674,7 +2674,7 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
 static uint32_t vga_ioport_read(void *opaque, uint32_t addr)
 {
     CirrusVGAState *s = opaque;
-    int val, index;
+    int val = 0xff, index;
 
     /* check port range access depending on color/monochrome mode */
     if ((addr >= 0x3b0 && addr <= 0x3bf && (s->msr & MSR_COLOR_EMULATION))
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpCk-0000Cm-W7; Thu, 29 Oct 2015 15: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 1ZrpCk-0000Cf-B9
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:30 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	F0/A9-00475-94C32365; Thu, 29 Oct 2015 15:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1446132806!62691920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17821 invoked from network); 29 Oct 2015 15:33:29 -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;
	29 Oct 2015 15:33:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCg-00082v-Ld
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCg-0004Rt-Hq
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:26 +0000
Date: Thu, 29 Oct 2015 15:33:26 +0000
Message-Id: <E1ZrpCg-0004Rt-Hq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] lm832x: don't
	overrun file buffer on save/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 fb9ee2e1049f7ca8f597a00360745ead64fd974b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:46:46 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    lm832x: don't overrun file buffer on save/restore
    
    Saving and restoring an lm832x record would overrun the pwm.file array
    since pwm.file is uint16_t elements and sizeof(pwm.file) twice as many
    elements.
    
    To ensure compatibility, padding bytes are added to the record.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-IDs: 1055728 1055729
---
 hw/lm832x.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/lm832x.c b/hw/lm832x.c
index dd94310..a212866 100644
--- a/hw/lm832x.c
+++ b/hw/lm832x.c
@@ -439,8 +439,11 @@ static void lm_kbd_save(QEMUFile *f, void *opaque)
     qemu_put_byte(f, s->kbd.len);
     qemu_put_buffer(f, s->kbd.fifo, sizeof(s->kbd.fifo));
 
-    for (i = 0; i < sizeof(s->pwm.file); i ++)
+    for (i = 0; i < ARRAY_SIZE(s->pwm.file); i ++)
         qemu_put_be16s(f, &s->pwm.file[i]);
+    /* Padding for compatibility with older records. */
+    for ( ; i < sizeof(s->pwm.file); i++)
+        qemu_put_be16s(f, 0);
     qemu_put_8s(f, &s->pwm.faddr);
     qemu_put_buffer(f, s->pwm.addr, sizeof(s->pwm.addr));
     qemu_put_timer(f, s->pwm.tm[0]);
@@ -451,6 +454,7 @@ static void lm_kbd_save(QEMUFile *f, void *opaque)
 static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
 {
     struct lm_kbd_s *s = (struct lm_kbd_s *) opaque;
+    uint16_t pad;
     int i;
 
     i2c_slave_load(f, &s->i2c);
@@ -475,8 +479,11 @@ static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
     s->kbd.len = qemu_get_byte(f);
     qemu_get_buffer(f, s->kbd.fifo, sizeof(s->kbd.fifo));
 
-    for (i = 0; i < sizeof(s->pwm.file); i ++)
+    for (i = 0; i < ARRAY_SIZE(s->pwm.file); i ++)
         qemu_get_be16s(f, &s->pwm.file[i]);
+    /* Skip padding. */
+    for ( ; i < sizeof(s->pwm.file); i++)
+        qemu_get_be16(f);
     qemu_get_8s(f, &s->pwm.faddr);
     qemu_get_buffer(f, s->pwm.addr, sizeof(s->pwm.addr));
     qemu_get_timer(f, s->pwm.tm[0]);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpCk-0000Cm-W7; Thu, 29 Oct 2015 15: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 1ZrpCk-0000Cf-B9
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:30 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	F0/A9-00475-94C32365; Thu, 29 Oct 2015 15:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1446132806!62691920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17821 invoked from network); 29 Oct 2015 15:33:29 -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;
	29 Oct 2015 15:33:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCg-00082v-Ld
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCg-0004Rt-Hq
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:26 +0000
Date: Thu, 29 Oct 2015 15:33:26 +0000
Message-Id: <E1ZrpCg-0004Rt-Hq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] lm832x: don't
	overrun file buffer on save/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 fb9ee2e1049f7ca8f597a00360745ead64fd974b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:46:46 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    lm832x: don't overrun file buffer on save/restore
    
    Saving and restoring an lm832x record would overrun the pwm.file array
    since pwm.file is uint16_t elements and sizeof(pwm.file) twice as many
    elements.
    
    To ensure compatibility, padding bytes are added to the record.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-IDs: 1055728 1055729
---
 hw/lm832x.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/lm832x.c b/hw/lm832x.c
index dd94310..a212866 100644
--- a/hw/lm832x.c
+++ b/hw/lm832x.c
@@ -439,8 +439,11 @@ static void lm_kbd_save(QEMUFile *f, void *opaque)
     qemu_put_byte(f, s->kbd.len);
     qemu_put_buffer(f, s->kbd.fifo, sizeof(s->kbd.fifo));
 
-    for (i = 0; i < sizeof(s->pwm.file); i ++)
+    for (i = 0; i < ARRAY_SIZE(s->pwm.file); i ++)
         qemu_put_be16s(f, &s->pwm.file[i]);
+    /* Padding for compatibility with older records. */
+    for ( ; i < sizeof(s->pwm.file); i++)
+        qemu_put_be16s(f, 0);
     qemu_put_8s(f, &s->pwm.faddr);
     qemu_put_buffer(f, s->pwm.addr, sizeof(s->pwm.addr));
     qemu_put_timer(f, s->pwm.tm[0]);
@@ -451,6 +454,7 @@ static void lm_kbd_save(QEMUFile *f, void *opaque)
 static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
 {
     struct lm_kbd_s *s = (struct lm_kbd_s *) opaque;
+    uint16_t pad;
     int i;
 
     i2c_slave_load(f, &s->i2c);
@@ -475,8 +479,11 @@ static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
     s->kbd.len = qemu_get_byte(f);
     qemu_get_buffer(f, s->kbd.fifo, sizeof(s->kbd.fifo));
 
-    for (i = 0; i < sizeof(s->pwm.file); i ++)
+    for (i = 0; i < ARRAY_SIZE(s->pwm.file); i ++)
         qemu_get_be16s(f, &s->pwm.file[i]);
+    /* Skip padding. */
+    for ( ; i < sizeof(s->pwm.file); i++)
+        qemu_get_be16(f);
     qemu_get_8s(f, &s->pwm.faddr);
     qemu_get_buffer(f, s->pwm.addr, sizeof(s->pwm.addr));
     qemu_get_timer(f, s->pwm.tm[0]);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpCu-0000E4-2E; Thu, 29 Oct 2015 15: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 1ZrpCt-0000Ds-FI
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:39 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	35/64-18107-25C32365; Thu, 29 Oct 2015 15:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446132817!46176139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20617 invoked from network); 29 Oct 2015 15:33:38 -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;
	29 Oct 2015 15:33:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCr-000830-0D
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCq-0004SF-U7
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:36 +0000
Date: Thu, 29 Oct 2015 15:33:36 +0000
Message-Id: <E1ZrpCq-0004SF-U7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-vvfat: fix
	fat_chksum() buffer overrun warning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af9e620745434868b0aeebc00c6ca1cadd9a01c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:54:11 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-vvfat: fix fat_chksum() buffer overrun warning
    
    Newer GCC versions raise an undefined behaviour warning in
    fat_chksum() because it overruns the name buffer.  However, this is
    intentional behaviour because the extension array immediately follows.
    
    Refactor this function to avoid the warning and make it clear it's
    checksumming both parts.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-ID: 1055738
---
 block-vvfat.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 9eb676b..345d7be 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -504,14 +504,21 @@ static void set_begin_of_direntry(direntry_t* direntry, uint32_t begin)
 
 /* fat functions */
 
+static inline void fat_chksum_part(const char *name, size_t len, uint8_t *chksum)
+{
+    size_t i;
+
+    for(i = 0; i < len; i++)
+	*chksum = (((*chksum&0xfe) >> 1) | ((*chksum & 0x01) ? 0x80 : 0))
+	    + (unsigned char)name[i];
+}
+
 static inline uint8_t fat_chksum(const direntry_t* entry)
 {
     uint8_t chksum=0;
-    int i;
 
-    for(i=0;i<11;i++)
-	chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0))
-	    +(unsigned char)entry->name[i];
+    fat_chksum_part(entry->name, ARRAY_SIZE(entry->name), &chksum);
+    fat_chksum_part(entry->extension, ARRAY_SIZE(entry->extension), &chksum);
 
     return chksum;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpCu-0000E4-2E; Thu, 29 Oct 2015 15: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 1ZrpCt-0000Ds-FI
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:39 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	35/64-18107-25C32365; Thu, 29 Oct 2015 15:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446132817!46176139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20617 invoked from network); 29 Oct 2015 15:33:38 -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;
	29 Oct 2015 15:33:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCr-000830-0D
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpCq-0004SF-U7
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:36 +0000
Date: Thu, 29 Oct 2015 15:33:36 +0000
Message-Id: <E1ZrpCq-0004SF-U7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-vvfat: fix
	fat_chksum() buffer overrun warning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af9e620745434868b0aeebc00c6ca1cadd9a01c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 11:54:11 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-vvfat: fix fat_chksum() buffer overrun warning
    
    Newer GCC versions raise an undefined behaviour warning in
    fat_chksum() because it overruns the name buffer.  However, this is
    intentional behaviour because the extension array immediately follows.
    
    Refactor this function to avoid the warning and make it clear it's
    checksumming both parts.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-ID: 1055738
---
 block-vvfat.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 9eb676b..345d7be 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -504,14 +504,21 @@ static void set_begin_of_direntry(direntry_t* direntry, uint32_t begin)
 
 /* fat functions */
 
+static inline void fat_chksum_part(const char *name, size_t len, uint8_t *chksum)
+{
+    size_t i;
+
+    for(i = 0; i < len; i++)
+	*chksum = (((*chksum&0xfe) >> 1) | ((*chksum & 0x01) ? 0x80 : 0))
+	    + (unsigned char)name[i];
+}
+
 static inline uint8_t fat_chksum(const direntry_t* entry)
 {
     uint8_t chksum=0;
-    int i;
 
-    for(i=0;i<11;i++)
-	chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0))
-	    +(unsigned char)entry->name[i];
+    fat_chksum_part(entry->name, ARRAY_SIZE(entry->name), &chksum);
+    fat_chksum_part(entry->extension, ARRAY_SIZE(entry->extension), &chksum);
 
     return chksum;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpD5-0000Fp-4p; Thu, 29 Oct 2015 15:33:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpD4-0000Fd-8h
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:50 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	F9/6D-12831-D5C32365; Thu, 29 Oct 2015 15:33:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446132828!42054142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9535 invoked from network); 29 Oct 2015 15:33:49 -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 Oct 2015 15:33:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpD2-00083B-3x
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpD1-0004Se-8A
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:47 +0000
Date: Thu, 29 Oct 2015 15:33:47 +0000
Message-Id: <E1ZrpD1-0004Se-8A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] usb-linux.c: fix
	buffer overflow
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c1e883f6c41b15690f6f466aeaa87362723bcb4
Author:     Jim Paris <jim@jtan.com>
AuthorDate: Wed Apr 22 12:29:21 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    usb-linux.c: fix buffer overflow
    
    In usb-linux.c:usb_host_handle_control, we pass a 1024-byte buffer and
    length to the kernel.  However, the length was provided by the caller
    of dev->handle_packet, and is not checked, so the kernel might provide
    too much data and overflow our buffer.
    
    For example, hw/usb-uhci.c could set the length to 2047.
    hw/usb-ohci.c looks like it might go up to 4096 or 8192.
    
    This causes a qemu crash, as reported here:
      http://www.mail-archive.com/kvm@vger.kernel.org/msg18447.html
    
    This patch increases the usb-linux.c buffer size to 2048 to fix the
    specific device reported, and adds a check to avoid the overflow in
    any case.
    
    Signed-off-by: Jim Paris <jim@jtan.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 usb-linux.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/usb-linux.c b/usb-linux.c
index 5dfed8c..51bac8a 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -117,7 +117,7 @@ struct ctrl_struct {
     uint16_t offset;
     uint8_t  state;
     struct   usb_ctrlrequest req;
-    uint8_t  buffer[1024];
+    uint8_t  buffer[2048];
 };
 
 typedef struct USBHostDevice {
@@ -554,6 +554,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
     struct usbdevfs_urb *urb;
     AsyncURB *aurb;
     int ret, value, index;
+    int buffer_len;
 
     /* 
      * Process certain standard device requests.
@@ -582,6 +583,13 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
 
     /* The rest are asynchronous */
 
+    buffer_len = 8 + s->ctrl.len;
+    if (buffer_len > sizeof(s->ctrl.buffer)) {
+	    fprintf(stderr, "husb: ctrl buffer too small (%d > %zu)\n",
+		    buffer_len, sizeof(s->ctrl.buffer));
+	    return USB_RET_STALL;
+    }
+
     aurb = async_alloc();
     aurb->hdev   = s;
     aurb->packet = p;
@@ -598,7 +606,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
     urb->endpoint = p->devep;
 
     urb->buffer        = &s->ctrl.req;
-    urb->buffer_length = 8 + s->ctrl.len;
+    urb->buffer_length = buffer_len;
 
     urb->usercontext = s;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:33:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpD5-0000Fp-4p; Thu, 29 Oct 2015 15:33:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpD4-0000Fd-8h
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:50 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	F9/6D-12831-D5C32365; Thu, 29 Oct 2015 15:33:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446132828!42054142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9535 invoked from network); 29 Oct 2015 15:33:49 -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 Oct 2015 15:33:49 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpD2-00083B-3x
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpD1-0004Se-8A
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:47 +0000
Date: Thu, 29 Oct 2015 15:33:47 +0000
Message-Id: <E1ZrpD1-0004Se-8A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] usb-linux.c: fix
	buffer overflow
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c1e883f6c41b15690f6f466aeaa87362723bcb4
Author:     Jim Paris <jim@jtan.com>
AuthorDate: Wed Apr 22 12:29:21 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    usb-linux.c: fix buffer overflow
    
    In usb-linux.c:usb_host_handle_control, we pass a 1024-byte buffer and
    length to the kernel.  However, the length was provided by the caller
    of dev->handle_packet, and is not checked, so the kernel might provide
    too much data and overflow our buffer.
    
    For example, hw/usb-uhci.c could set the length to 2047.
    hw/usb-ohci.c looks like it might go up to 4096 or 8192.
    
    This causes a qemu crash, as reported here:
      http://www.mail-archive.com/kvm@vger.kernel.org/msg18447.html
    
    This patch increases the usb-linux.c buffer size to 2048 to fix the
    specific device reported, and adds a check to avoid the overflow in
    any case.
    
    Signed-off-by: Jim Paris <jim@jtan.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 usb-linux.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/usb-linux.c b/usb-linux.c
index 5dfed8c..51bac8a 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -117,7 +117,7 @@ struct ctrl_struct {
     uint16_t offset;
     uint8_t  state;
     struct   usb_ctrlrequest req;
-    uint8_t  buffer[1024];
+    uint8_t  buffer[2048];
 };
 
 typedef struct USBHostDevice {
@@ -554,6 +554,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
     struct usbdevfs_urb *urb;
     AsyncURB *aurb;
     int ret, value, index;
+    int buffer_len;
 
     /* 
      * Process certain standard device requests.
@@ -582,6 +583,13 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
 
     /* The rest are asynchronous */
 
+    buffer_len = 8 + s->ctrl.len;
+    if (buffer_len > sizeof(s->ctrl.buffer)) {
+	    fprintf(stderr, "husb: ctrl buffer too small (%d > %zu)\n",
+		    buffer_len, sizeof(s->ctrl.buffer));
+	    return USB_RET_STALL;
+    }
+
     aurb = async_alloc();
     aurb->hdev   = s;
     aurb->packet = p;
@@ -598,7 +606,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
     urb->endpoint = p->devep;
 
     urb->buffer        = &s->ctrl.req;
-    urb->buffer_length = 8 + s->ctrl.len;
+    urb->buffer_length = buffer_len;
 
     urb->usercontext = s;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34: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 1ZrpDH-0000HW-87; Thu, 29 Oct 2015 15:34: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 1ZrpDE-0000HG-RM
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:00 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	E5/82-01748-86C32365; Thu, 29 Oct 2015 15:34:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446132838!57914369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13547 invoked from network); 29 Oct 2015 15:33:59 -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;
	29 Oct 2015 15:33:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDC-00083J-BB
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDC-0004Tk-9E
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:58 +0000
Date: Thu, 29 Oct 2015 15:33:58 +0000
Message-Id: <E1ZrpDC-0004Tk-9E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] CVE-2014-8106:
	cirrus: fix blit region check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5e4ed9cded14f2d8445150c8a6d225b283bed3fa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 21 17:16:42 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-8106: cirrus: fix blit region check
    
    Backport of qemu-upstream:
     * bf25983345ca44aec3dd92c57142be45452bd38a
     * d3532a0db02296e687711b8cdc7791924efccea0
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/cirrus_vga.c |   66 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 11ce212..d3bf4cf 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -34,6 +34,8 @@
 #include "qemu-xen.h"
 #include "qemu-log.h"
 
+#include <assert.h>
+
 /*
  * TODO:
  *    - destination write mask support not complete (bits 5..7)
@@ -223,20 +225,6 @@
 
 #define ABS(a) ((signed)(a) > 0 ? a : -a)
 
-#define BLTUNSAFE(s) \
-    ( \
-        ( /* check dst is within bounds */ \
-            (s)->cirrus_blt_height * ABS((s)->cirrus_blt_dstpitch) \
-                + ((s)->cirrus_blt_dstaddr & (s)->cirrus_addr_mask) > \
-                    (s)->vram_size \
-        ) || \
-        ( /* check src is within bounds */ \
-            (s)->cirrus_blt_height * ABS((s)->cirrus_blt_srcpitch) \
-                + ((s)->cirrus_blt_srcaddr & (s)->cirrus_addr_mask) > \
-                    (s)->vram_size \
-        ) \
-    )
-
 struct CirrusVGAState;
 typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
                                      uint8_t * dst, const uint8_t * src,
@@ -315,6 +303,50 @@ static void cirrus_vga_mem_writew(void *opaque, target_phys_addr_t addr, uint32_
  *
  ***************************************/
 
+static bool blit_region_is_unsafe(struct CirrusVGAState *s,
+                                  int32_t pitch, int32_t addr)
+{
+    if (pitch < 0) {
+        int64_t min = addr
+            + ((int64_t)s->cirrus_blt_height-1) * pitch;
+        int32_t max = addr
+            + s->cirrus_blt_width;
+        if (min < 0 || max >= s->vram_size) {
+            return true;
+        }
+    } else {
+        int64_t max = addr
+            + ((int64_t)s->cirrus_blt_height-1) * pitch
+            + s->cirrus_blt_width;
+        if (max >= s->vram_size) {
+            return true;
+        }
+    }
+    return false;
+}
+
+static bool blit_is_unsafe(struct CirrusVGAState *s)
+{
+    /* should be the case, see cirrus_bitblt_start */
+    assert(s->cirrus_blt_width > 0);
+    assert(s->cirrus_blt_height > 0);
+
+    if (s->cirrus_blt_width > CIRRUS_BLTBUFSIZE) {
+        return true;
+    }
+
+    if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
+                              s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
+        return true;
+    }
+    if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch,
+                              s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) {
+        return true;
+    }
+
+    return false;
+}
+
 static void cirrus_bitblt_rop_nop(CirrusVGAState *s,
                                   uint8_t *dst,const uint8_t *src,
                                   int dstpitch,int srcpitch,
@@ -676,7 +708,7 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s,
 
     dst = s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask);
 
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
 
     (*s->cirrus_rop) (s, dst, src,
@@ -694,7 +726,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
 {
     cirrus_fill_t rop_func;
 
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
     rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
     rop_func(s, s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
@@ -790,7 +822,7 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
 
 static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s)
 {
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
 
     cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->start_addr,
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34: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 1ZrpDH-0000HW-87; Thu, 29 Oct 2015 15:34: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 1ZrpDE-0000HG-RM
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:00 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	E5/82-01748-86C32365; Thu, 29 Oct 2015 15:34:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446132838!57914369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13547 invoked from network); 29 Oct 2015 15:33:59 -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;
	29 Oct 2015 15:33:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDC-00083J-BB
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDC-0004Tk-9E
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:33:58 +0000
Date: Thu, 29 Oct 2015 15:33:58 +0000
Message-Id: <E1ZrpDC-0004Tk-9E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] CVE-2014-8106:
	cirrus: fix blit region check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5e4ed9cded14f2d8445150c8a6d225b283bed3fa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 21 17:16:42 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-8106: cirrus: fix blit region check
    
    Backport of qemu-upstream:
     * bf25983345ca44aec3dd92c57142be45452bd38a
     * d3532a0db02296e687711b8cdc7791924efccea0
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/cirrus_vga.c |   66 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 11ce212..d3bf4cf 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -34,6 +34,8 @@
 #include "qemu-xen.h"
 #include "qemu-log.h"
 
+#include <assert.h>
+
 /*
  * TODO:
  *    - destination write mask support not complete (bits 5..7)
@@ -223,20 +225,6 @@
 
 #define ABS(a) ((signed)(a) > 0 ? a : -a)
 
-#define BLTUNSAFE(s) \
-    ( \
-        ( /* check dst is within bounds */ \
-            (s)->cirrus_blt_height * ABS((s)->cirrus_blt_dstpitch) \
-                + ((s)->cirrus_blt_dstaddr & (s)->cirrus_addr_mask) > \
-                    (s)->vram_size \
-        ) || \
-        ( /* check src is within bounds */ \
-            (s)->cirrus_blt_height * ABS((s)->cirrus_blt_srcpitch) \
-                + ((s)->cirrus_blt_srcaddr & (s)->cirrus_addr_mask) > \
-                    (s)->vram_size \
-        ) \
-    )
-
 struct CirrusVGAState;
 typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
                                      uint8_t * dst, const uint8_t * src,
@@ -315,6 +303,50 @@ static void cirrus_vga_mem_writew(void *opaque, target_phys_addr_t addr, uint32_
  *
  ***************************************/
 
+static bool blit_region_is_unsafe(struct CirrusVGAState *s,
+                                  int32_t pitch, int32_t addr)
+{
+    if (pitch < 0) {
+        int64_t min = addr
+            + ((int64_t)s->cirrus_blt_height-1) * pitch;
+        int32_t max = addr
+            + s->cirrus_blt_width;
+        if (min < 0 || max >= s->vram_size) {
+            return true;
+        }
+    } else {
+        int64_t max = addr
+            + ((int64_t)s->cirrus_blt_height-1) * pitch
+            + s->cirrus_blt_width;
+        if (max >= s->vram_size) {
+            return true;
+        }
+    }
+    return false;
+}
+
+static bool blit_is_unsafe(struct CirrusVGAState *s)
+{
+    /* should be the case, see cirrus_bitblt_start */
+    assert(s->cirrus_blt_width > 0);
+    assert(s->cirrus_blt_height > 0);
+
+    if (s->cirrus_blt_width > CIRRUS_BLTBUFSIZE) {
+        return true;
+    }
+
+    if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
+                              s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
+        return true;
+    }
+    if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch,
+                              s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) {
+        return true;
+    }
+
+    return false;
+}
+
 static void cirrus_bitblt_rop_nop(CirrusVGAState *s,
                                   uint8_t *dst,const uint8_t *src,
                                   int dstpitch,int srcpitch,
@@ -676,7 +708,7 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s,
 
     dst = s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask);
 
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
 
     (*s->cirrus_rop) (s, dst, src,
@@ -694,7 +726,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
 {
     cirrus_fill_t rop_func;
 
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
     rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
     rop_func(s, s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
@@ -790,7 +822,7 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
 
 static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s)
 {
-    if (BLTUNSAFE(s))
+    if (blit_is_unsafe(s))
         return 0;
 
     cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->start_addr,
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34: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 1ZrpDQ-0000It-Ac; Thu, 29 Oct 2015 15:34:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDP-0000If-30
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:11 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	D5/09-01753-27C32365; Thu, 29 Oct 2015 15:34:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1446132848!55636484!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31149 invoked from network); 29 Oct 2015 15:34:09 -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;
	29 Oct 2015 15:34:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDM-00083u-MS
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDM-0004UJ-JW
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:08 +0000
Date: Thu, 29 Oct 2015 15:34:08 +0000
Message-Id: <E1ZrpDM-0004UJ-JW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] CVE-2014-7815:
	vnc: sanitize bits_per_pixel from the client
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b050c69ee3171997d33bb8b2c111a4ebea169fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 21 19:21:11 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-7815: vnc: sanitize bits_per_pixel from the client
    
    Backport of qemu-upstream:
     * e6908bfe8e07f2b452e78e677da1b45b1c0f6829
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vnc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/vnc.c b/vnc.c
index 48e5c46..573af3b 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1616,6 +1616,16 @@ static void set_pixel_format(VncState *vs,
         return;
     }
 
+    switch (bits_per_pixel) {
+    case 8:
+    case 16:
+    case 32:
+        break;
+    default:
+        vnc_client_error(vs);
+        return;
+    }
+
     vs->clientds = vs->serverds;
     vs->clientds.pf.rmax = red_max;
     count_bits(vs->clientds.pf.rbits, red_max);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34: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 1ZrpDQ-0000It-Ac; Thu, 29 Oct 2015 15:34:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDP-0000If-30
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:11 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	D5/09-01753-27C32365; Thu, 29 Oct 2015 15:34:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1446132848!55636484!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31149 invoked from network); 29 Oct 2015 15:34:09 -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;
	29 Oct 2015 15:34:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDM-00083u-MS
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDM-0004UJ-JW
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:08 +0000
Date: Thu, 29 Oct 2015 15:34:08 +0000
Message-Id: <E1ZrpDM-0004UJ-JW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] CVE-2014-7815:
	vnc: sanitize bits_per_pixel from the client
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b050c69ee3171997d33bb8b2c111a4ebea169fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Feb 21 19:21:11 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-7815: vnc: sanitize bits_per_pixel from the client
    
    Backport of qemu-upstream:
     * e6908bfe8e07f2b452e78e677da1b45b1c0f6829
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vnc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/vnc.c b/vnc.c
index 48e5c46..573af3b 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1616,6 +1616,16 @@ static void set_pixel_format(VncState *vs,
         return;
     }
 
+    switch (bits_per_pixel) {
+    case 8:
+    case 16:
+    case 32:
+        break;
+    default:
+        vnc_client_error(vs);
+        return;
+    }
+
     vs->clientds = vs->serverds;
     vs->clientds.pf.rmax = red_max;
     count_bits(vs->clientds.pf.rbits, red_max);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpDa-0000Kp-P3; Thu, 29 Oct 2015 15:34:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDZ-0000KU-Sr
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:22 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	CB/D7-14900-D7C32365; Thu, 29 Oct 2015 15:34:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1446132859!21156138!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 27992 invoked from network); 29 Oct 2015 15:34: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;
	29 Oct 2015 15:34:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDX-000842-1M
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDW-0004Uq-UB
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:18 +0000
Date: Thu, 29 Oct 2015 15:34:18 +0000
Message-Id: <E1ZrpDW-0004Uq-UB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] CVE-2014-3615:
	vbe: rework sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a1e383df25477e21b48c67c93c3a4dde19f9e4f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Feb 22 19:21:08 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-3615: vbe: rework sanity checks
    
    Backport of qemu-upstream:
     * c1b886c45dc70f247300f549dce9833f3fa2def5
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/vga.c |  154 ++++++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 95 insertions(+), 59 deletions(-)

diff --git a/hw/vga.c b/hw/vga.c
index d0c12aa..e8b1ce0 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -521,6 +521,93 @@ static void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
 }
 
 #ifdef CONFIG_BOCHS_VBE
+/*
+ * Sanity check vbe register writes.
+ *
+ * As we don't have a way to signal errors to the guest in the bochs
+ * dispi interface we'll go adjust the registers to the closest valid
+ * value.
+ */
+static void vbe_fixup_regs(VGAState *s)
+{
+    uint16_t *r = s->vbe_regs;
+    uint32_t bits, linelength, maxy, offset;
+
+    if (!(r[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED)) {
+        /* vbe is turned off -- nothing to do */
+        return;
+    }
+
+    /* check depth */
+    switch (r[VBE_DISPI_INDEX_BPP]) {
+    case 4:
+    case 8:
+    case 16:
+    case 24:
+    case 32:
+        bits = r[VBE_DISPI_INDEX_BPP];
+        break;
+    case 15:
+        bits = 16;
+        break;
+    default:
+        bits = r[VBE_DISPI_INDEX_BPP] = 8;
+        break;
+    }
+
+    /* check width */
+    r[VBE_DISPI_INDEX_XRES] &= ~7u;
+    if (r[VBE_DISPI_INDEX_XRES] == 0) {
+        r[VBE_DISPI_INDEX_XRES] = 8;
+    }
+    if (r[VBE_DISPI_INDEX_XRES] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_XRES] = VBE_DISPI_MAX_XRES;
+    }
+    r[VBE_DISPI_INDEX_VIRT_WIDTH] &= ~7u;
+    if (r[VBE_DISPI_INDEX_VIRT_WIDTH] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_VIRT_WIDTH] = VBE_DISPI_MAX_XRES;
+    }
+    if (r[VBE_DISPI_INDEX_VIRT_WIDTH] < r[VBE_DISPI_INDEX_XRES]) {
+        r[VBE_DISPI_INDEX_VIRT_WIDTH] = r[VBE_DISPI_INDEX_XRES];
+    }
+
+    /* check height */
+    linelength = r[VBE_DISPI_INDEX_VIRT_WIDTH] * bits / 8;
+    maxy = s->vram_size / linelength;
+    if (r[VBE_DISPI_INDEX_YRES] == 0) {
+        r[VBE_DISPI_INDEX_YRES] = 1;
+    }
+    if (r[VBE_DISPI_INDEX_YRES] > VBE_DISPI_MAX_YRES) {
+        r[VBE_DISPI_INDEX_YRES] = VBE_DISPI_MAX_YRES;
+    }
+    if (r[VBE_DISPI_INDEX_YRES] > maxy) {
+        r[VBE_DISPI_INDEX_YRES] = maxy;
+    }
+
+    /* check offset */
+    if (r[VBE_DISPI_INDEX_X_OFFSET] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_X_OFFSET] = VBE_DISPI_MAX_XRES;
+    }
+    if (r[VBE_DISPI_INDEX_Y_OFFSET] > VBE_DISPI_MAX_YRES) {
+        r[VBE_DISPI_INDEX_Y_OFFSET] = VBE_DISPI_MAX_YRES;
+    }
+    offset = r[VBE_DISPI_INDEX_X_OFFSET] * bits / 8;
+    offset += r[VBE_DISPI_INDEX_Y_OFFSET] * linelength;
+    if (offset + r[VBE_DISPI_INDEX_YRES] * linelength > s->vram_size) {
+        r[VBE_DISPI_INDEX_Y_OFFSET] = 0;
+        offset = r[VBE_DISPI_INDEX_X_OFFSET] * bits / 8;
+        if (offset + r[VBE_DISPI_INDEX_YRES] * linelength > s->vram_size) {
+            r[VBE_DISPI_INDEX_X_OFFSET] = 0;
+            offset = 0;
+        }
+    }
+
+    /* update vga state */
+    r[VBE_DISPI_INDEX_VIRT_HEIGHT] = maxy;
+    s->vbe_line_offset = linelength;
+    s->vbe_start_addr  = offset / 4;
+}
+
 static uint32_t vbe_ioport_read_index(void *opaque, uint32_t addr)
 {
     VGAState *s = opaque;
@@ -588,22 +675,13 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
             }
             break;
         case VBE_DISPI_INDEX_XRES:
-            if ((val <= VBE_DISPI_MAX_XRES) && ((val & 7) == 0)) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
-            break;
         case VBE_DISPI_INDEX_YRES:
-            if (val <= VBE_DISPI_MAX_YRES) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
-            break;
         case VBE_DISPI_INDEX_BPP:
-            if (val == 0)
-                val = 8;
-            if (val == 4 || val == 8 || val == 15 ||
-                val == 16 || val == 24 || val == 32) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
+        case VBE_DISPI_INDEX_VIRT_WIDTH:
+        case VBE_DISPI_INDEX_X_OFFSET:
+        case VBE_DISPI_INDEX_Y_OFFSET:
+            s->vbe_regs[s->vbe_index] = val;
+            vbe_fixup_regs(s);
             break;
         case VBE_DISPI_INDEX_BANK:
             if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4) {
@@ -623,19 +701,11 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
                      set_vram_mapping(s, s->lfb_addr, s->lfb_end);
                 }
 
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] =
-                    s->vbe_regs[VBE_DISPI_INDEX_XRES];
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] =
-                    s->vbe_regs[VBE_DISPI_INDEX_YRES];
+                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = 0;
                 s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET] = 0;
                 s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET] = 0;
-
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    s->vbe_line_offset = s->vbe_regs[VBE_DISPI_INDEX_XRES] >> 1;
-                else
-                    s->vbe_line_offset = s->vbe_regs[VBE_DISPI_INDEX_XRES] *
-                        ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                s->vbe_start_addr = 0;
+                s->vbe_regs[VBE_DISPI_INDEX_ENABLE] |= VBE_DISPI_ENABLED;
+                vbe_fixup_regs(s);
 
                 /* clear the screen (should be done in BIOS) */
                 if (!(val & VBE_DISPI_NOCLEARMEM)) {
@@ -677,40 +747,6 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
             s->dac_8bit = (val & VBE_DISPI_8BIT_DAC) > 0;
             s->vbe_regs[s->vbe_index] = val;
             break;
-        case VBE_DISPI_INDEX_VIRT_WIDTH:
-            {
-                int w, h, line_offset;
-
-                if (val < s->vbe_regs[VBE_DISPI_INDEX_XRES])
-                    return;
-                w = val;
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    line_offset = w >> 1;
-                else
-                    line_offset = w * ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                h = s->vram_size / line_offset;
-                /* XXX: support weird bochs semantics ? */
-                if (h < s->vbe_regs[VBE_DISPI_INDEX_YRES])
-                    return;
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = w;
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] = h;
-                s->vbe_line_offset = line_offset;
-            }
-            break;
-        case VBE_DISPI_INDEX_X_OFFSET:
-        case VBE_DISPI_INDEX_Y_OFFSET:
-            {
-                int x;
-                s->vbe_regs[s->vbe_index] = val;
-                s->vbe_start_addr = s->vbe_line_offset * s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET];
-                x = s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET];
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    s->vbe_start_addr += x >> 1;
-                else
-                    s->vbe_start_addr += x * ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                s->vbe_start_addr >>= 2;
-            }
-            break;
         default:
             break;
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpDa-0000Kp-P3; Thu, 29 Oct 2015 15:34:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDZ-0000KU-Sr
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:22 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	CB/D7-14900-D7C32365; Thu, 29 Oct 2015 15:34:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1446132859!21156138!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 27992 invoked from network); 29 Oct 2015 15:34: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;
	29 Oct 2015 15:34:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDX-000842-1M
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDW-0004Uq-UB
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:18 +0000
Date: Thu, 29 Oct 2015 15:34:18 +0000
Message-Id: <E1ZrpDW-0004Uq-UB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] CVE-2014-3615:
	vbe: rework sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a1e383df25477e21b48c67c93c3a4dde19f9e4f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Feb 22 19:21:08 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    CVE-2014-3615: vbe: rework sanity checks
    
    Backport of qemu-upstream:
     * c1b886c45dc70f247300f549dce9833f3fa2def5
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/vga.c |  154 ++++++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 95 insertions(+), 59 deletions(-)

diff --git a/hw/vga.c b/hw/vga.c
index d0c12aa..e8b1ce0 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -521,6 +521,93 @@ static void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
 }
 
 #ifdef CONFIG_BOCHS_VBE
+/*
+ * Sanity check vbe register writes.
+ *
+ * As we don't have a way to signal errors to the guest in the bochs
+ * dispi interface we'll go adjust the registers to the closest valid
+ * value.
+ */
+static void vbe_fixup_regs(VGAState *s)
+{
+    uint16_t *r = s->vbe_regs;
+    uint32_t bits, linelength, maxy, offset;
+
+    if (!(r[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED)) {
+        /* vbe is turned off -- nothing to do */
+        return;
+    }
+
+    /* check depth */
+    switch (r[VBE_DISPI_INDEX_BPP]) {
+    case 4:
+    case 8:
+    case 16:
+    case 24:
+    case 32:
+        bits = r[VBE_DISPI_INDEX_BPP];
+        break;
+    case 15:
+        bits = 16;
+        break;
+    default:
+        bits = r[VBE_DISPI_INDEX_BPP] = 8;
+        break;
+    }
+
+    /* check width */
+    r[VBE_DISPI_INDEX_XRES] &= ~7u;
+    if (r[VBE_DISPI_INDEX_XRES] == 0) {
+        r[VBE_DISPI_INDEX_XRES] = 8;
+    }
+    if (r[VBE_DISPI_INDEX_XRES] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_XRES] = VBE_DISPI_MAX_XRES;
+    }
+    r[VBE_DISPI_INDEX_VIRT_WIDTH] &= ~7u;
+    if (r[VBE_DISPI_INDEX_VIRT_WIDTH] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_VIRT_WIDTH] = VBE_DISPI_MAX_XRES;
+    }
+    if (r[VBE_DISPI_INDEX_VIRT_WIDTH] < r[VBE_DISPI_INDEX_XRES]) {
+        r[VBE_DISPI_INDEX_VIRT_WIDTH] = r[VBE_DISPI_INDEX_XRES];
+    }
+
+    /* check height */
+    linelength = r[VBE_DISPI_INDEX_VIRT_WIDTH] * bits / 8;
+    maxy = s->vram_size / linelength;
+    if (r[VBE_DISPI_INDEX_YRES] == 0) {
+        r[VBE_DISPI_INDEX_YRES] = 1;
+    }
+    if (r[VBE_DISPI_INDEX_YRES] > VBE_DISPI_MAX_YRES) {
+        r[VBE_DISPI_INDEX_YRES] = VBE_DISPI_MAX_YRES;
+    }
+    if (r[VBE_DISPI_INDEX_YRES] > maxy) {
+        r[VBE_DISPI_INDEX_YRES] = maxy;
+    }
+
+    /* check offset */
+    if (r[VBE_DISPI_INDEX_X_OFFSET] > VBE_DISPI_MAX_XRES) {
+        r[VBE_DISPI_INDEX_X_OFFSET] = VBE_DISPI_MAX_XRES;
+    }
+    if (r[VBE_DISPI_INDEX_Y_OFFSET] > VBE_DISPI_MAX_YRES) {
+        r[VBE_DISPI_INDEX_Y_OFFSET] = VBE_DISPI_MAX_YRES;
+    }
+    offset = r[VBE_DISPI_INDEX_X_OFFSET] * bits / 8;
+    offset += r[VBE_DISPI_INDEX_Y_OFFSET] * linelength;
+    if (offset + r[VBE_DISPI_INDEX_YRES] * linelength > s->vram_size) {
+        r[VBE_DISPI_INDEX_Y_OFFSET] = 0;
+        offset = r[VBE_DISPI_INDEX_X_OFFSET] * bits / 8;
+        if (offset + r[VBE_DISPI_INDEX_YRES] * linelength > s->vram_size) {
+            r[VBE_DISPI_INDEX_X_OFFSET] = 0;
+            offset = 0;
+        }
+    }
+
+    /* update vga state */
+    r[VBE_DISPI_INDEX_VIRT_HEIGHT] = maxy;
+    s->vbe_line_offset = linelength;
+    s->vbe_start_addr  = offset / 4;
+}
+
 static uint32_t vbe_ioport_read_index(void *opaque, uint32_t addr)
 {
     VGAState *s = opaque;
@@ -588,22 +675,13 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
             }
             break;
         case VBE_DISPI_INDEX_XRES:
-            if ((val <= VBE_DISPI_MAX_XRES) && ((val & 7) == 0)) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
-            break;
         case VBE_DISPI_INDEX_YRES:
-            if (val <= VBE_DISPI_MAX_YRES) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
-            break;
         case VBE_DISPI_INDEX_BPP:
-            if (val == 0)
-                val = 8;
-            if (val == 4 || val == 8 || val == 15 ||
-                val == 16 || val == 24 || val == 32) {
-                s->vbe_regs[s->vbe_index] = val;
-            }
+        case VBE_DISPI_INDEX_VIRT_WIDTH:
+        case VBE_DISPI_INDEX_X_OFFSET:
+        case VBE_DISPI_INDEX_Y_OFFSET:
+            s->vbe_regs[s->vbe_index] = val;
+            vbe_fixup_regs(s);
             break;
         case VBE_DISPI_INDEX_BANK:
             if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4) {
@@ -623,19 +701,11 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
                      set_vram_mapping(s, s->lfb_addr, s->lfb_end);
                 }
 
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] =
-                    s->vbe_regs[VBE_DISPI_INDEX_XRES];
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] =
-                    s->vbe_regs[VBE_DISPI_INDEX_YRES];
+                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = 0;
                 s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET] = 0;
                 s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET] = 0;
-
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    s->vbe_line_offset = s->vbe_regs[VBE_DISPI_INDEX_XRES] >> 1;
-                else
-                    s->vbe_line_offset = s->vbe_regs[VBE_DISPI_INDEX_XRES] *
-                        ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                s->vbe_start_addr = 0;
+                s->vbe_regs[VBE_DISPI_INDEX_ENABLE] |= VBE_DISPI_ENABLED;
+                vbe_fixup_regs(s);
 
                 /* clear the screen (should be done in BIOS) */
                 if (!(val & VBE_DISPI_NOCLEARMEM)) {
@@ -677,40 +747,6 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
             s->dac_8bit = (val & VBE_DISPI_8BIT_DAC) > 0;
             s->vbe_regs[s->vbe_index] = val;
             break;
-        case VBE_DISPI_INDEX_VIRT_WIDTH:
-            {
-                int w, h, line_offset;
-
-                if (val < s->vbe_regs[VBE_DISPI_INDEX_XRES])
-                    return;
-                w = val;
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    line_offset = w >> 1;
-                else
-                    line_offset = w * ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                h = s->vram_size / line_offset;
-                /* XXX: support weird bochs semantics ? */
-                if (h < s->vbe_regs[VBE_DISPI_INDEX_YRES])
-                    return;
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = w;
-                s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] = h;
-                s->vbe_line_offset = line_offset;
-            }
-            break;
-        case VBE_DISPI_INDEX_X_OFFSET:
-        case VBE_DISPI_INDEX_Y_OFFSET:
-            {
-                int x;
-                s->vbe_regs[s->vbe_index] = val;
-                s->vbe_start_addr = s->vbe_line_offset * s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET];
-                x = s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET];
-                if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4)
-                    s->vbe_start_addr += x >> 1;
-                else
-                    s->vbe_start_addr += x * ((s->vbe_regs[VBE_DISPI_INDEX_BPP] + 7) >> 3);
-                s->vbe_start_addr >>= 2;
-            }
-            break;
         default:
             break;
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpDl-0000Ne-UB; Thu, 29 Oct 2015 15:34:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDk-0000NK-Ln
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:32 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	C7/03-16870-88C32365; Thu, 29 Oct 2015 15:34:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1446132869!46148185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1949 invoked from network); 29 Oct 2015 15:34:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 15:34:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDh-00084A-Du
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDh-0004VO-An
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:29 +0000
Date: Thu, 29 Oct 2015 15:34:29 +0000
Message-Id: <E1ZrpDh-0004VO-An@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] cirrus_vga: fix
	division by 0 for color expansion rop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd7c9bfa4955fa8c32bbaaa2b515ed2414ef9bc5
Author:     Aurelien Jarno <aurelien@aurel32.net>
AuthorDate: Tue Jan 4 21:58:24 2011 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    cirrus_vga: fix division by 0 for color expansion rop
    
    Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regression
    with Windows ME that leads to a division by 0 and a crash.
    
    It uses the color expansion rop with the source pitch set to 0. This is
    something allowed, as the manual explicitely says "When the source of
    color-expand data is display memory, the source pitch is ignored.".
    
    This patch fixes this regression by computing sx, sy and others
    variables only if they are going to be used later, that is for a plain
    copy ROP. It basically consists in moving code.
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 hw/cirrus_vga.c |   70 +++++++++++++++++++++++++++---------------------------
 1 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index d3bf4cf..e6c3893 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -754,46 +754,46 @@ static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
 
 static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
 {
-    int sx, sy;
-    int dx, dy;
-    int width, height;
-    int depth;
+    int sx = 0, sy = 0;
+    int dx = 0, dy = 0;
+    int depth = 0;
     int notify = 0;
 
-    depth = s->get_bpp((VGAState *)s) / 8;
-    s->get_resolution((VGAState *)s, &width, &height);
-
-    /* extra x, y */
-    sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
-    sy = (src / ABS(s->cirrus_blt_srcpitch));
-    dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
-    dy = (dst / ABS(s->cirrus_blt_dstpitch));
-
-    /* normalize width */
-    w /= depth;
-
-    /* if we're doing a backward copy, we have to adjust
-       our x/y to be the upper left corner (instead of the lower
-       right corner) */
-    if (s->cirrus_blt_dstpitch < 0) {
-	sx -= (s->cirrus_blt_width / depth) - 1;
-	dx -= (s->cirrus_blt_width / depth) - 1;
-	sy -= s->cirrus_blt_height - 1;
-	dy -= s->cirrus_blt_height - 1;
-    }
+    /* make sure to only copy if it's a plain copy ROP */
+    if (*s->cirrus_rop == cirrus_bitblt_rop_fwd_src ||
+        *s->cirrus_rop == cirrus_bitblt_rop_bkwd_src) {
+        int width, height;
+
+        depth = s->get_bpp((VGAState *)s) / 8;
+        s->get_resolution((VGAState *)s, &width, &height);
+
+        /* extra x, y */
+        sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
+        sy = (src / ABS(s->cirrus_blt_srcpitch));
+        dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
+        dy = (dst / ABS(s->cirrus_blt_dstpitch));
+
+        /* normalize width */
+        w /= depth;
+
+        /* if we're doing a backward copy, we have to adjust
+           our x/y to be the upper left corner (instead of the lower
+           right corner) */
+        if (s->cirrus_blt_dstpitch < 0) {
+            sx -= (s->cirrus_blt_width / depth) - 1;
+            dx -= (s->cirrus_blt_width / depth) - 1;
+            sy -= s->cirrus_blt_height - 1;
+            dy -= s->cirrus_blt_height - 1;
+        }
 
-    /* are we in the visible portion of memory? */
-    if (sx >= 0 && sy >= 0 && dx >= 0 && dy >= 0 &&
-	(sx + w) <= width && (sy + h) <= height &&
-	(dx + w) <= width && (dy + h) <= height) {
-	notify = 1;
+        /* are we in the visible portion of memory? */
+        if (sx >= 0 && sy >= 0 && dx >= 0 && dy >= 0 &&
+            (sx + w) <= width && (sy + h) <= height &&
+            (dx + w) <= width && (dy + h) <= height) {
+            notify = 1;
+        }
     }
 
-    /* make to sure only copy if it's a plain copy ROP */
-    if (*s->cirrus_rop != cirrus_bitblt_rop_fwd_src &&
-	*s->cirrus_rop != cirrus_bitblt_rop_bkwd_src)
-	notify = 0;
-
     /* we have to flush all pending changes so that the copy
        is generated at the appropriate moment in time */
     if (notify)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpDl-0000Ne-UB; Thu, 29 Oct 2015 15:34:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDk-0000NK-Ln
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:32 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	C7/03-16870-88C32365; Thu, 29 Oct 2015 15:34:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1446132869!46148185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1949 invoked from network); 29 Oct 2015 15:34:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 15:34:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDh-00084A-Du
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDh-0004VO-An
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:29 +0000
Date: Thu, 29 Oct 2015 15:34:29 +0000
Message-Id: <E1ZrpDh-0004VO-An@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] cirrus_vga: fix
	division by 0 for color expansion rop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd7c9bfa4955fa8c32bbaaa2b515ed2414ef9bc5
Author:     Aurelien Jarno <aurelien@aurel32.net>
AuthorDate: Tue Jan 4 21:58:24 2011 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    cirrus_vga: fix division by 0 for color expansion rop
    
    Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regression
    with Windows ME that leads to a division by 0 and a crash.
    
    It uses the color expansion rop with the source pitch set to 0. This is
    something allowed, as the manual explicitely says "When the source of
    color-expand data is display memory, the source pitch is ignored.".
    
    This patch fixes this regression by computing sx, sy and others
    variables only if they are going to be used later, that is for a plain
    copy ROP. It basically consists in moving code.
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 hw/cirrus_vga.c |   70 +++++++++++++++++++++++++++---------------------------
 1 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index d3bf4cf..e6c3893 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -754,46 +754,46 @@ static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
 
 static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
 {
-    int sx, sy;
-    int dx, dy;
-    int width, height;
-    int depth;
+    int sx = 0, sy = 0;
+    int dx = 0, dy = 0;
+    int depth = 0;
     int notify = 0;
 
-    depth = s->get_bpp((VGAState *)s) / 8;
-    s->get_resolution((VGAState *)s, &width, &height);
-
-    /* extra x, y */
-    sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
-    sy = (src / ABS(s->cirrus_blt_srcpitch));
-    dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
-    dy = (dst / ABS(s->cirrus_blt_dstpitch));
-
-    /* normalize width */
-    w /= depth;
-
-    /* if we're doing a backward copy, we have to adjust
-       our x/y to be the upper left corner (instead of the lower
-       right corner) */
-    if (s->cirrus_blt_dstpitch < 0) {
-	sx -= (s->cirrus_blt_width / depth) - 1;
-	dx -= (s->cirrus_blt_width / depth) - 1;
-	sy -= s->cirrus_blt_height - 1;
-	dy -= s->cirrus_blt_height - 1;
-    }
+    /* make sure to only copy if it's a plain copy ROP */
+    if (*s->cirrus_rop == cirrus_bitblt_rop_fwd_src ||
+        *s->cirrus_rop == cirrus_bitblt_rop_bkwd_src) {
+        int width, height;
+
+        depth = s->get_bpp((VGAState *)s) / 8;
+        s->get_resolution((VGAState *)s, &width, &height);
+
+        /* extra x, y */
+        sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
+        sy = (src / ABS(s->cirrus_blt_srcpitch));
+        dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
+        dy = (dst / ABS(s->cirrus_blt_dstpitch));
+
+        /* normalize width */
+        w /= depth;
+
+        /* if we're doing a backward copy, we have to adjust
+           our x/y to be the upper left corner (instead of the lower
+           right corner) */
+        if (s->cirrus_blt_dstpitch < 0) {
+            sx -= (s->cirrus_blt_width / depth) - 1;
+            dx -= (s->cirrus_blt_width / depth) - 1;
+            sy -= s->cirrus_blt_height - 1;
+            dy -= s->cirrus_blt_height - 1;
+        }
 
-    /* are we in the visible portion of memory? */
-    if (sx >= 0 && sy >= 0 && dx >= 0 && dy >= 0 &&
-	(sx + w) <= width && (sy + h) <= height &&
-	(dx + w) <= width && (dy + h) <= height) {
-	notify = 1;
+        /* are we in the visible portion of memory? */
+        if (sx >= 0 && sy >= 0 && dx >= 0 && dy >= 0 &&
+            (sx + w) <= width && (sy + h) <= height &&
+            (dx + w) <= width && (dy + h) <= height) {
+            notify = 1;
+        }
     }
 
-    /* make to sure only copy if it's a plain copy ROP */
-    if (*s->cirrus_rop != cirrus_bitblt_rop_fwd_src &&
-	*s->cirrus_rop != cirrus_bitblt_rop_bkwd_src)
-	notify = 0;
-
     /* we have to flush all pending changes so that the copy
        is generated at the appropriate moment in time */
     if (notify)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34: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 1ZrpDw-0000Pd-0T; Thu, 29 Oct 2015 15:34:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDv-0000PQ-7C
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:43 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	1F/35-25435-29C32365; Thu, 29 Oct 2015 15:34:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1446132880!51256290!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11188 invoked from network); 29 Oct 2015 15:34:41 -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;
	29 Oct 2015 15:34:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDr-00084I-OD
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDr-0004Vw-MZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:39 +0000
Date: Thu, 29 Oct 2015 15:34:39 +0000
Message-Id: <E1ZrpDr-0004Vw-MZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] ide: cancel dma
	operations on command abort or error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 56464b49335de2a452b8bff44effe72c2d00a8df
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Wed Dec 10 02:36:23 2014 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    ide: cancel dma operations on command abort or error
    
    Otherwise, a guest can cause Qemu to reuse an active aio structure.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 7b84d1b..3636611 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -919,8 +919,10 @@ static void ide_set_signature(IDEState *s)
     }
 }
 
+static void ide_dma_cancel(BMDMAState *bm);
 static inline void ide_abort_command(IDEState *s)
 {
+    if (s->bmdma) ide_dma_cancel(s->bmdma);
     s->status = READY_STAT | ERR_STAT;
     s->error = ABRT_ERR;
 }
@@ -1098,6 +1100,7 @@ static void dma_buf_commit(IDEState *s, int is_write)
 
 static void ide_dma_error(IDEState *s)
 {
+    if (s->bmdma) ide_dma_cancel(s->bmdma);
     ide_transfer_stop(s);
     s->error = ABRT_ERR;
     s->status = READY_STAT | ERR_STAT;
@@ -1230,7 +1233,7 @@ static void ide_read_dma_cb(void *opaque, int ret)
 	return;
     }
 
-    if (!s->bs) return; /* ouch! (see ide_flush_cb) */
+    if (!s || !s->bs) return; /* ouch! (see ide_dma_error & ide_flush_cb) */
 
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
@@ -1371,7 +1374,7 @@ static void ide_write_dma_cb(void *opaque, int ret)
             return;
     }
 
-    if (!s->bs) return; /* ouch! (see ide_flush_cb) */
+    if (!s || !s->bs) return; /* ouch! (see ide_dma_error & ide_flush_cb) */
 
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34: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 1ZrpDw-0000Pd-0T; Thu, 29 Oct 2015 15:34:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDv-0000PQ-7C
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:43 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	1F/35-25435-29C32365; Thu, 29 Oct 2015 15:34:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1446132880!51256290!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11188 invoked from network); 29 Oct 2015 15:34:41 -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;
	29 Oct 2015 15:34:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDr-00084I-OD
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpDr-0004Vw-MZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:39 +0000
Date: Thu, 29 Oct 2015 15:34:39 +0000
Message-Id: <E1ZrpDr-0004Vw-MZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] ide: cancel dma
	operations on command abort or error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 56464b49335de2a452b8bff44effe72c2d00a8df
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Wed Dec 10 02:36:23 2014 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    ide: cancel dma operations on command abort or error
    
    Otherwise, a guest can cause Qemu to reuse an active aio structure.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 7b84d1b..3636611 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -919,8 +919,10 @@ static void ide_set_signature(IDEState *s)
     }
 }
 
+static void ide_dma_cancel(BMDMAState *bm);
 static inline void ide_abort_command(IDEState *s)
 {
+    if (s->bmdma) ide_dma_cancel(s->bmdma);
     s->status = READY_STAT | ERR_STAT;
     s->error = ABRT_ERR;
 }
@@ -1098,6 +1100,7 @@ static void dma_buf_commit(IDEState *s, int is_write)
 
 static void ide_dma_error(IDEState *s)
 {
+    if (s->bmdma) ide_dma_cancel(s->bmdma);
     ide_transfer_stop(s);
     s->error = ABRT_ERR;
     s->status = READY_STAT | ERR_STAT;
@@ -1230,7 +1233,7 @@ static void ide_read_dma_cb(void *opaque, int ret)
 	return;
     }
 
-    if (!s->bs) return; /* ouch! (see ide_flush_cb) */
+    if (!s || !s->bs) return; /* ouch! (see ide_dma_error & ide_flush_cb) */
 
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
@@ -1371,7 +1374,7 @@ static void ide_write_dma_cb(void *opaque, int ret)
             return;
     }
 
-    if (!s->bs) return; /* ouch! (see ide_flush_cb) */
+    if (!s || !s->bs) return; /* ouch! (see ide_dma_error & ide_flush_cb) */
 
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34: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 1ZrpE6-0000Rh-35; Thu, 29 Oct 2015 15:34:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpE4-0000RM-PK
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:52 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	6E/FC-00536-B9C32365; Thu, 29 Oct 2015 15:34:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1446132890!8559646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1063 invoked from network); 29 Oct 2015 15:34:51 -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;
	29 Oct 2015 15:34:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpE2-00084U-0S
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpE1-0004WS-VZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:49 +0000
Date: Thu, 29 Oct 2015 15:34:49 +0000
Message-Id: <E1ZrpE1-0004WS-VZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] dma: fix
	incorrect bh scheduling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9589b7b60719de9a8df7887a0c08f9813cd8c58d
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Thu Dec 11 04:18:02 2014 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    dma: fix incorrect bh scheduling
    
    The following 2 cases should be avoided:
    
      1. DMAAIOCB has been released but continue_after_map_failure
         schedules a bh for it.
      2. Multiple bh calls are schduled on the same DMAAIOCB.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 dma-helpers.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/dma-helpers.c b/dma-helpers.c
index 2a1621b..c9fbbd9 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -50,8 +50,14 @@ typedef struct {
     target_phys_addr_t sg_cur_byte;
     QEMUIOVector iov;
     QEMUBH *bh;
+    int in_use;
 } DMAAIOCB;
 
+static void dma_aio_cb_reset(DMAAIOCB *p)
+{
+    p->in_use = 0;
+}
+
 static void dma_bdrv_cb(void *opaque, int ret);
 
 static void reschedule_dma(void *opaque)
@@ -60,6 +66,10 @@ static void reschedule_dma(void *opaque)
 
     qemu_bh_delete(dbs->bh);
     dbs->bh = NULL;
+
+    if (!dbs->in_use)
+        return;
+
     dma_bdrv_cb(opaque, 0);
 }
 
@@ -67,7 +77,8 @@ static void continue_after_map_failure(void *opaque)
 {
     DMAAIOCB *dbs = (DMAAIOCB *)opaque;
 
-    dbs->bh = qemu_bh_new(reschedule_dma, dbs);
+    if (!dbs->bh)
+        dbs->bh = qemu_bh_new(reschedule_dma, dbs);
     qemu_bh_schedule(dbs->bh);
 }
 
@@ -97,6 +108,7 @@ void dma_bdrv_cb(void *opaque, int ret)
         dbs->common.cb(dbs->common.opaque, ret);
         qemu_iovec_destroy(&dbs->iov);
         qemu_aio_release(dbs);
+        dma_aio_cb_reset(dbs);
         return;
     }
 
@@ -129,6 +141,7 @@ void dma_bdrv_cb(void *opaque, int ret)
     if (!dbs->acb) {
         dma_bdrv_unmap(dbs);
         qemu_iovec_destroy(&dbs->iov);
+        dma_aio_cb_reset(dbs);
         return;
     }
 }
@@ -148,6 +161,7 @@ static BlockDriverAIOCB *dma_bdrv_io(
     dbs->sg_cur_byte = 0;
     dbs->is_write = is_write;
     dbs->bh = NULL;
+    dbs->in_use = 1;
     qemu_iovec_init(&dbs->iov, sg->nsg);
     dma_bdrv_cb(dbs, 0);
     if (!dbs->acb) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:34:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:34: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 1ZrpE6-0000Rh-35; Thu, 29 Oct 2015 15:34:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpE4-0000RM-PK
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:52 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	6E/FC-00536-B9C32365; Thu, 29 Oct 2015 15:34:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1446132890!8559646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1063 invoked from network); 29 Oct 2015 15:34:51 -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;
	29 Oct 2015 15:34:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpE2-00084U-0S
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpE1-0004WS-VZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:34:49 +0000
Date: Thu, 29 Oct 2015 15:34:49 +0000
Message-Id: <E1ZrpE1-0004WS-VZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] dma: fix
	incorrect bh scheduling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9589b7b60719de9a8df7887a0c08f9813cd8c58d
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Thu Dec 11 04:18:02 2014 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    dma: fix incorrect bh scheduling
    
    The following 2 cases should be avoided:
    
      1. DMAAIOCB has been released but continue_after_map_failure
         schedules a bh for it.
      2. Multiple bh calls are schduled on the same DMAAIOCB.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 dma-helpers.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/dma-helpers.c b/dma-helpers.c
index 2a1621b..c9fbbd9 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -50,8 +50,14 @@ typedef struct {
     target_phys_addr_t sg_cur_byte;
     QEMUIOVector iov;
     QEMUBH *bh;
+    int in_use;
 } DMAAIOCB;
 
+static void dma_aio_cb_reset(DMAAIOCB *p)
+{
+    p->in_use = 0;
+}
+
 static void dma_bdrv_cb(void *opaque, int ret);
 
 static void reschedule_dma(void *opaque)
@@ -60,6 +66,10 @@ static void reschedule_dma(void *opaque)
 
     qemu_bh_delete(dbs->bh);
     dbs->bh = NULL;
+
+    if (!dbs->in_use)
+        return;
+
     dma_bdrv_cb(opaque, 0);
 }
 
@@ -67,7 +77,8 @@ static void continue_after_map_failure(void *opaque)
 {
     DMAAIOCB *dbs = (DMAAIOCB *)opaque;
 
-    dbs->bh = qemu_bh_new(reschedule_dma, dbs);
+    if (!dbs->bh)
+        dbs->bh = qemu_bh_new(reschedule_dma, dbs);
     qemu_bh_schedule(dbs->bh);
 }
 
@@ -97,6 +108,7 @@ void dma_bdrv_cb(void *opaque, int ret)
         dbs->common.cb(dbs->common.opaque, ret);
         qemu_iovec_destroy(&dbs->iov);
         qemu_aio_release(dbs);
+        dma_aio_cb_reset(dbs);
         return;
     }
 
@@ -129,6 +141,7 @@ void dma_bdrv_cb(void *opaque, int ret)
     if (!dbs->acb) {
         dma_bdrv_unmap(dbs);
         qemu_iovec_destroy(&dbs->iov);
+        dma_aio_cb_reset(dbs);
         return;
     }
 }
@@ -148,6 +161,7 @@ static BlockDriverAIOCB *dma_bdrv_io(
     dbs->sg_cur_byte = 0;
     dbs->is_write = is_write;
     dbs->bh = NULL;
+    dbs->in_use = 1;
     qemu_iovec_init(&dbs->iov, sg->nsg);
     dma_bdrv_cb(dbs, 0);
     if (!dbs->acb) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpEH-0000To-5e; Thu, 29 Oct 2015 15:35:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEF-0000TT-PB
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:03 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	B7/01-24856-7AC32365; Thu, 29 Oct 2015 15:35:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446132900!40883323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27642 invoked from network); 29 Oct 2015 15:35:02 -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;
	29 Oct 2015 15:35:02 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEC-00084c-8C
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEC-0004Xc-5z
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:00 +0000
Date: Thu, 29 Oct 2015 15:35:00 +0000
Message-Id: <E1ZrpEC-0004Xc-5z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] cmdline: Parse
	-pciemulation before trying to use it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79398a2710be3e2cf228a23eb15cf9573ff9fe9b
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Thu Jan 8 06:14:37 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    cmdline: Parse -pciemulation before trying to use it
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vl.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/vl.c b/vl.c
index d21c3aa..67d9d86 100644
--- a/vl.c
+++ b/vl.c
@@ -5952,6 +5952,15 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
+#ifdef CONFIG_PASSTHROUGH
+    for (i = 0; i < nb_pci_emulation; i++) {
+        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
+            fprintf(stderr, "Warning: could not add PCI device %s\n",
+                    pci_emulation_config_text[i]);
+        }
+    }
+#endif
+
     machine->init(ram_size, vga_ram_size, boot_devices,
                   kernel_filename, kernel_cmdline, initrd_filename, cpu_model,
 		  direct_pci);
@@ -6068,15 +6077,6 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
-#ifdef CONFIG_PASSTHROUGH
-    for (i = 0; i < nb_pci_emulation; i++) {
-        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
-            fprintf(stderr, "Warning: could not add PCI device %s\n",
-                    pci_emulation_config_text[i]);
-        }
-    }
-#endif
-
     for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
         const char *devname = virtio_consoles[i];
         if (virtcon_hds[i] && devname) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpEH-0000To-5e; Thu, 29 Oct 2015 15:35:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEF-0000TT-PB
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:03 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	B7/01-24856-7AC32365; Thu, 29 Oct 2015 15:35:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446132900!40883323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27642 invoked from network); 29 Oct 2015 15:35:02 -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;
	29 Oct 2015 15:35:02 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEC-00084c-8C
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEC-0004Xc-5z
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:00 +0000
Date: Thu, 29 Oct 2015 15:35:00 +0000
Message-Id: <E1ZrpEC-0004Xc-5z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] cmdline: Parse
	-pciemulation before trying to use it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79398a2710be3e2cf228a23eb15cf9573ff9fe9b
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Thu Jan 8 06:14:37 2015 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    cmdline: Parse -pciemulation before trying to use it
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vl.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/vl.c b/vl.c
index d21c3aa..67d9d86 100644
--- a/vl.c
+++ b/vl.c
@@ -5952,6 +5952,15 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
+#ifdef CONFIG_PASSTHROUGH
+    for (i = 0; i < nb_pci_emulation; i++) {
+        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
+            fprintf(stderr, "Warning: could not add PCI device %s\n",
+                    pci_emulation_config_text[i]);
+        }
+    }
+#endif
+
     machine->init(ram_size, vga_ram_size, boot_devices,
                   kernel_filename, kernel_cmdline, initrd_filename, cpu_model,
 		  direct_pci);
@@ -6068,15 +6077,6 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
-#ifdef CONFIG_PASSTHROUGH
-    for (i = 0; i < nb_pci_emulation; i++) {
-        if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
-            fprintf(stderr, "Warning: could not add PCI device %s\n",
-                    pci_emulation_config_text[i]);
-        }
-    }
-#endif
-
     for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
         const char *devname = virtio_consoles[i];
         if (virtcon_hds[i] && devname) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpEP-0000VX-80; Thu, 29 Oct 2015 15:35:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEO-0000VM-K5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:12 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	3C/7B-32615-FAC32365; Thu, 29 Oct 2015 15:35:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1446132910!30443707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13686 invoked from network); 29 Oct 2015 15:35:11 -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;
	29 Oct 2015 15:35:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEM-00085D-FD
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEM-0004YP-DV
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:10 +0000
Date: Thu, 29 Oct 2015 15:35:10 +0000
Message-Id: <E1ZrpEM-0004YP-DV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] smbios: Don't
	allocate smbus eeprom buffer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1f89c26126df966894b1e0746bfa56267ae1478
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:32:08 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    smbios: Don't allocate smbus eeprom buffer
    
    smbus_eeprom_device_init() has been disabled since 2007.  The #define turns
    the actual function call into a comma expression with no effect.
    
    Removing the leaked allocation also makes Valgrind happier.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-ID: 1090387
---
 hw/pc.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 3e33694..7359338 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -79,7 +79,6 @@ static void xen_relocator_hook(target_phys_addr_t *prot_addr_upd,
                                uint16_t protocol,
 			       const uint8_t header[], int kernel_size,
 			       target_phys_addr_t real_addr, int real_size);
-#define smbus_eeprom_device_init (void)
 
 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
 {
@@ -1135,17 +1134,8 @@ vga_bios_error:
     }
 
     if (pci_enabled && acpi_enabled) {
-        uint8_t *eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */
-        i2c_bus *smbus;
-
         /* TODO: Populate SPD eeprom data.  */
-        smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
-
-	if (smbus) {
-	    for (i = 0; i < 8; i++) {
-		smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256));
-	    }
-        }
+        piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
     }
 
     if (i440fx_state) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpEP-0000VX-80; Thu, 29 Oct 2015 15:35:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEO-0000VM-K5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:12 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	3C/7B-32615-FAC32365; Thu, 29 Oct 2015 15:35:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1446132910!30443707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13686 invoked from network); 29 Oct 2015 15:35:11 -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;
	29 Oct 2015 15:35:11 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEM-00085D-FD
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEM-0004YP-DV
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:10 +0000
Date: Thu, 29 Oct 2015 15:35:10 +0000
Message-Id: <E1ZrpEM-0004YP-DV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] smbios: Don't
	allocate smbus eeprom buffer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1f89c26126df966894b1e0746bfa56267ae1478
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:32:08 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    smbios: Don't allocate smbus eeprom buffer
    
    smbus_eeprom_device_init() has been disabled since 2007.  The #define turns
    the actual function call into a comma expression with no effect.
    
    Removing the leaked allocation also makes Valgrind happier.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Coverity-ID: 1090387
---
 hw/pc.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 3e33694..7359338 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -79,7 +79,6 @@ static void xen_relocator_hook(target_phys_addr_t *prot_addr_upd,
                                uint16_t protocol,
 			       const uint8_t header[], int kernel_size,
 			       target_phys_addr_t real_addr, int real_size);
-#define smbus_eeprom_device_init (void)
 
 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
 {
@@ -1135,17 +1134,8 @@ vga_bios_error:
     }
 
     if (pci_enabled && acpi_enabled) {
-        uint8_t *eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */
-        i2c_bus *smbus;
-
         /* TODO: Populate SPD eeprom data.  */
-        smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
-
-	if (smbus) {
-	    for (i = 0; i < 8; i++) {
-		smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256));
-	    }
-        }
+        piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
     }
 
     if (i440fx_state) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35: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 1ZrpEa-0000XH-AS; Thu, 29 Oct 2015 15:35: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 1ZrpEZ-0000X4-IA
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:23 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	15/7C-26043-ABC32365; Thu, 29 Oct 2015 15:35:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1446132920!29772682!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1722 invoked from network); 29 Oct 2015 15:35:21 -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;
	29 Oct 2015 15:35:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEW-00085L-Ng
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEW-0004Yu-MM
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:20 +0000
Date: Thu, 29 Oct 2015 15:35:20 +0000
Message-Id: <E1ZrpEW-0004Yu-MM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] pic: Don't
	allocate irq buffers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c36a4e522bfa615f38fbf71d7da483fefc8900f2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:36:08 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    pic: Don't allocate irq buffers
    
    i8259_init() doesn't inspect its argument at all, causing the allocation to
    be leaked and never used.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/pc.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 7359338..09b4af4 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -801,7 +801,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
     PCIBus *pci_bus;
     int piix3_devfn = -1;
     CPUState *env;
-    qemu_irq *cpu_irq;
     qemu_irq *i8259;
     int index;
     BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
@@ -970,8 +969,7 @@ vga_bios_error:
 
     bochs_bios_init();
 
-    cpu_irq = qemu_allocate_irqs(pic_irq_request, NULL, 1);
-    i8259 = i8259_init(cpu_irq[0]);
+    i8259 = i8259_init(NULL);
     ferr_irq = i8259[13];
 
     if (pci_enabled) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35: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 1ZrpEa-0000XH-AS; Thu, 29 Oct 2015 15:35: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 1ZrpEZ-0000X4-IA
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:23 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	15/7C-26043-ABC32365; Thu, 29 Oct 2015 15:35:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1446132920!29772682!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1722 invoked from network); 29 Oct 2015 15:35:21 -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;
	29 Oct 2015 15:35:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEW-00085L-Ng
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEW-0004Yu-MM
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:20 +0000
Date: Thu, 29 Oct 2015 15:35:20 +0000
Message-Id: <E1ZrpEW-0004Yu-MM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] pic: Don't
	allocate irq buffers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c36a4e522bfa615f38fbf71d7da483fefc8900f2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:36:08 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    pic: Don't allocate irq buffers
    
    i8259_init() doesn't inspect its argument at all, causing the allocation to
    be leaked and never used.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/pc.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 7359338..09b4af4 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -801,7 +801,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
     PCIBus *pci_bus;
     int piix3_devfn = -1;
     CPUState *env;
-    qemu_irq *cpu_irq;
     qemu_irq *i8259;
     int index;
     BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
@@ -970,8 +969,7 @@ vga_bios_error:
 
     bochs_bios_init();
 
-    cpu_irq = qemu_allocate_irqs(pic_irq_request, NULL, 1);
-    i8259 = i8259_init(cpu_irq[0]);
+    i8259 = i8259_init(NULL);
     ferr_irq = i8259[13];
 
     if (pci_enabled) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpEk-0000Z3-D1; Thu, 29 Oct 2015 15:35:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEj-0000Yn-7e
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:33 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	A1/60-30270-4CC32365; Thu, 29 Oct 2015 15:35:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1446132931!46190804!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14818 invoked from network); 29 Oct 2015 15:35:32 -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;
	29 Oct 2015 15:35:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEh-00085T-2H
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEg-0004Zt-WD
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:31 +0000
Date: Thu, 29 Oct 2015 15:35:30 +0000
Message-Id: <E1ZrpEg-0004Zt-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] signal: Don't use
	uninitalised sival_ptr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b81761be03ac017bdb1a212e4b59de545853d2f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:35:45 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    signal: Don't use uninitalised sival_ptr
    
    In 64bit builds, setting sival_int to 0 doesn't clear the upper half of the
    sival_ptr pointer.  Valgrind does not like this.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vl.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 67d9d86..c864e7d 100644
--- a/vl.c
+++ b/vl.c
@@ -1568,7 +1568,7 @@ static void rtc_stop_timer(struct qemu_alarm_timer *t)
 
 static int dynticks_start_timer(struct qemu_alarm_timer *t)
 {
-    struct sigevent ev;
+    struct sigevent ev = { { 0 } };
     timer_t host_timer;
     struct sigaction act;
 
@@ -1578,7 +1578,6 @@ static int dynticks_start_timer(struct qemu_alarm_timer *t)
 
     sigaction(SIGALRM, &act, NULL);
 
-    ev.sigev_value.sival_int = 0;
     ev.sigev_notify = SIGEV_SIGNAL;
     ev.sigev_signo = SIGALRM;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZrpEk-0000Z3-D1; Thu, 29 Oct 2015 15:35:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEj-0000Yn-7e
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:33 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	A1/60-30270-4CC32365; Thu, 29 Oct 2015 15:35:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1446132931!46190804!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14818 invoked from network); 29 Oct 2015 15:35:32 -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;
	29 Oct 2015 15:35:32 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEh-00085T-2H
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEg-0004Zt-WD
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:31 +0000
Date: Thu, 29 Oct 2015 15:35:30 +0000
Message-Id: <E1ZrpEg-0004Zt-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] signal: Don't use
	uninitalised sival_ptr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b81761be03ac017bdb1a212e4b59de545853d2f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 21 14:35:45 2015 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    signal: Don't use uninitalised sival_ptr
    
    In 64bit builds, setting sival_int to 0 doesn't clear the upper half of the
    sival_ptr pointer.  Valgrind does not like this.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 vl.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 67d9d86..c864e7d 100644
--- a/vl.c
+++ b/vl.c
@@ -1568,7 +1568,7 @@ static void rtc_stop_timer(struct qemu_alarm_timer *t)
 
 static int dynticks_start_timer(struct qemu_alarm_timer *t)
 {
-    struct sigevent ev;
+    struct sigevent ev = { { 0 } };
     timer_t host_timer;
     struct sigaction act;
 
@@ -1578,7 +1578,6 @@ static int dynticks_start_timer(struct qemu_alarm_timer *t)
 
     sigaction(SIGALRM, &act, NULL);
 
-    ev.sigev_value.sival_int = 0;
     ev.sigev_notify = SIGEV_SIGNAL;
     ev.sigev_signo = SIGALRM;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35: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 1ZrpEv-0000ay-FS; Thu, 29 Oct 2015 15:35:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEt-0000ag-PM
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:43 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	03/5D-01753-FCC32365; Thu, 29 Oct 2015 15:35:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1446132941!23429122!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10886 invoked from network); 29 Oct 2015 15:35:42 -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;
	29 Oct 2015 15:35:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEr-00085b-Ei
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEr-0004ac-9e
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:41 +0000
Date: Thu, 29 Oct 2015 15:35:41 +0000
Message-Id: <E1ZrpEr-0004ac-9e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] hw/msmouse.c: Fix
	deref_after_free and double free
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4d48935c97839337f6aa8b2bb944e92bb9909df
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Mon Mar 17 05:37:49 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/msmouse.c: Fix deref_after_free and double free
    
    msmouse_chr_close is only pointed by chr->chr_close in qemu_chr_close
    function. After calling chr->chr_close, chr will be freed. So we don't
    need to free it again here.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    (defect not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/msmouse.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/msmouse.c b/hw/msmouse.c
index 69356a5..2d2703b 100644
--- a/hw/msmouse.c
+++ b/hw/msmouse.c
@@ -61,7 +61,6 @@ static int msmouse_chr_write (struct CharDriverState *s, const uint8_t *buf, int
 
 static void msmouse_chr_close (struct CharDriverState *chr)
 {
-    qemu_free (chr);
 }
 
 CharDriverState *qemu_chr_open_msmouse(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35: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 1ZrpEv-0000ay-FS; Thu, 29 Oct 2015 15:35:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEt-0000ag-PM
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:43 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	03/5D-01753-FCC32365; Thu, 29 Oct 2015 15:35:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1446132941!23429122!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10886 invoked from network); 29 Oct 2015 15:35:42 -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;
	29 Oct 2015 15:35:42 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEr-00085b-Ei
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpEr-0004ac-9e
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:41 +0000
Date: Thu, 29 Oct 2015 15:35:41 +0000
Message-Id: <E1ZrpEr-0004ac-9e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] hw/msmouse.c: Fix
	deref_after_free and double free
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a4d48935c97839337f6aa8b2bb944e92bb9909df
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Mon Mar 17 05:37:49 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/msmouse.c: Fix deref_after_free and double free
    
    msmouse_chr_close is only pointed by chr->chr_close in qemu_chr_close
    function. After calling chr->chr_close, chr will be freed. So we don't
    need to free it again here.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    (defect not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/msmouse.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/msmouse.c b/hw/msmouse.c
index 69356a5..2d2703b 100644
--- a/hw/msmouse.c
+++ b/hw/msmouse.c
@@ -61,7 +61,6 @@ static int msmouse_chr_write (struct CharDriverState *s, const uint8_t *buf, int
 
 static void msmouse_chr_close (struct CharDriverState *chr)
 {
-    qemu_free (chr);
 }
 
 CharDriverState *qemu_chr_open_msmouse(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35: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 1ZrpF5-0000dA-KU; Thu, 29 Oct 2015 15:35: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 1ZrpF4-0000cv-7Y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:54 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	4D/4D-26043-9DC32365; Thu, 29 Oct 2015 15:35:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446132952!62636831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8251 invoked from network); 29 Oct 2015 15:35:53 -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 Oct 2015 15:35:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpF1-00085j-SC
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpF1-0004bB-NW
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:51 +0000
Date: Thu, 29 Oct 2015 15:35:51 +0000
Message-Id: <E1ZrpF1-0004bB-NW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] readline: fix
	memory corruption when adding history
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b10783fe24c7c5f22320032e0d4da5aab9da572
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 09:50:41 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    readline: fix memory corruption when adding history
    
    idx can be down to 0, so TERM_MAX_CMDS-idx+1 could be TERM_MAX_CMDS+1, which
    exceeds the size of term_history.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055739
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 readline.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/readline.c b/readline.c
index 8572841..4b68726 100644
--- a/readline.c
+++ b/readline.c
@@ -267,7 +267,7 @@ static void term_hist_add(const char *cmdline)
 	    new_entry = hist_entry;
 	    /* Put this entry at the end of history */
 	    memmove(&term_history[idx], &term_history[idx + 1],
-		    (TERM_MAX_CMDS - idx + 1) * sizeof(char *));
+		    (TERM_MAX_CMDS - (idx + 1)) * sizeof(char *));
 	    term_history[TERM_MAX_CMDS - 1] = NULL;
 	    for (; idx < TERM_MAX_CMDS; idx++) {
 		if (term_history[idx] == NULL)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:35:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:35: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 1ZrpF5-0000dA-KU; Thu, 29 Oct 2015 15:35: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 1ZrpF4-0000cv-7Y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:54 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	4D/4D-26043-9DC32365; Thu, 29 Oct 2015 15:35:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446132952!62636831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8251 invoked from network); 29 Oct 2015 15:35:53 -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 Oct 2015 15:35:53 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpF1-00085j-SC
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpF1-0004bB-NW
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:35:51 +0000
Date: Thu, 29 Oct 2015 15:35:51 +0000
Message-Id: <E1ZrpF1-0004bB-NW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] readline: fix
	memory corruption when adding history
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b10783fe24c7c5f22320032e0d4da5aab9da572
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 09:50:41 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    readline: fix memory corruption when adding history
    
    idx can be down to 0, so TERM_MAX_CMDS-idx+1 could be TERM_MAX_CMDS+1, which
    exceeds the size of term_history.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055739
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 readline.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/readline.c b/readline.c
index 8572841..4b68726 100644
--- a/readline.c
+++ b/readline.c
@@ -267,7 +267,7 @@ static void term_hist_add(const char *cmdline)
 	    new_entry = hist_entry;
 	    /* Put this entry at the end of history */
 	    memmove(&term_history[idx], &term_history[idx + 1],
-		    (TERM_MAX_CMDS - idx + 1) * sizeof(char *));
+		    (TERM_MAX_CMDS - (idx + 1)) * sizeof(char *));
 	    term_history[TERM_MAX_CMDS - 1] = NULL;
 	    for (; idx < TERM_MAX_CMDS; idx++) {
 		if (term_history[idx] == NULL)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:36: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 1ZrpFI-0000fC-N6; Thu, 29 Oct 2015 15:36: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 1ZrpFH-0000ex-8k
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:07 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	54/7E-32615-6EC32365; Thu, 29 Oct 2015 15:36:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446132965!40763332!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29772 invoked from network); 29 Oct 2015 15:36:06 -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 Oct 2015 15:36:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFC-00086K-6I
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFC-0004cr-3X
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:02 +0000
Date: Thu, 29 Oct 2015 15:36:02 +0000
Message-Id: <E1ZrpFC-0004cr-3X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-cow: don't
	close cow_fd twice on error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04ffc2f665cc0dd85f24274c696708dc3bc93156
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:03:40 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-cow: don't close cow_fd twice on error
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1056200
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-cow.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/block-cow.c b/block-cow.c
index 777d8a5..9ad0a32 100644
--- a/block-cow.c
+++ b/block-cow.c
@@ -224,7 +224,6 @@ static int cow_create(const char *filename, int64_t image_sectors,
 
         fd = open(image_filename, O_RDONLY | O_BINARY);
         if (fd < 0) {
-            close(cow_fd);
             goto mtime_fail;
         }
         if (fstat(fd, &st) != 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:36: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 1ZrpFI-0000fC-N6; Thu, 29 Oct 2015 15:36: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 1ZrpFH-0000ex-8k
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:07 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	54/7E-32615-6EC32365; Thu, 29 Oct 2015 15:36:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446132965!40763332!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29772 invoked from network); 29 Oct 2015 15:36:06 -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 Oct 2015 15:36:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFC-00086K-6I
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFC-0004cr-3X
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:02 +0000
Date: Thu, 29 Oct 2015 15:36:02 +0000
Message-Id: <E1ZrpFC-0004cr-3X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-cow: don't
	close cow_fd twice on error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04ffc2f665cc0dd85f24274c696708dc3bc93156
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:03:40 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-cow: don't close cow_fd twice on error
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1056200
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-cow.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/block-cow.c b/block-cow.c
index 777d8a5..9ad0a32 100644
--- a/block-cow.c
+++ b/block-cow.c
@@ -224,7 +224,6 @@ static int cow_create(const char *filename, int64_t image_sectors,
 
         fd = open(image_filename, O_RDONLY | O_BINARY);
         if (fd < 0) {
-            close(cow_fd);
             goto mtime_fail;
         }
         if (fstat(fd, &st) != 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:36: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 1ZrpFT-0000i5-1k; Thu, 29 Oct 2015 15:36:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFS-0000hX-1C
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:18 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	47/AB-18107-1FC32365; Thu, 29 Oct 2015 15:36:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1446132975!9678979!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2778 invoked from network); 29 Oct 2015 15:36:16 -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;
	29 Oct 2015 15:36:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFP-00086S-Kx
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFP-0004dX-F5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:15 +0000
Date: Thu, 29 Oct 2015 15:36:15 +0000
Message-Id: <E1ZrpFP-0004dX-F5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] console: Avoid
	overrunning the dmask arrays
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec5080d57c87e1ace8d76e12261ce660594516f8
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:11:21 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    console: Avoid overrunning the dmask arrays
    
    The valide range of font_data should be [0, 0xFF].
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 console.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/console.c b/console.c
index 9984d6f..d4f1ad0 100644
--- a/console.c
+++ b/console.c
@@ -421,7 +421,8 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
 {
     uint8_t *d;
     const uint8_t *font_ptr;
-    unsigned int font_data, linesize, xorcol, bpp;
+    uint8_t font_data;
+    unsigned int linesize, xorcol, bpp;
     int i;
     unsigned int fgcol, bgcol;
 
@@ -450,7 +451,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
             font_data = *font_ptr++;
             if (t_attrib->uline
                 && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (dmask16[(font_data >> 4)] & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (dmask16[(font_data >> 0) & 0xf] & xorcol) ^ bgcol;
@@ -463,7 +464,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
             font_data = *font_ptr++;
             if (t_attrib->uline
                 && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (dmask4[(font_data >> 6)] & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (dmask4[(font_data >> 4) & 3] & xorcol) ^ bgcol;
@@ -476,7 +477,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
         for(i = 0; i < FONT_HEIGHT; i++) {
             font_data = *font_ptr++;
             if (t_attrib->uline && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (-((font_data >> 7)) & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (-((font_data >> 6) & 1) & xorcol) ^ bgcol;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:36: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 1ZrpFT-0000i5-1k; Thu, 29 Oct 2015 15:36:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFS-0000hX-1C
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:18 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	47/AB-18107-1FC32365; Thu, 29 Oct 2015 15:36:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1446132975!9678979!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2778 invoked from network); 29 Oct 2015 15:36:16 -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;
	29 Oct 2015 15:36:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFP-00086S-Kx
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFP-0004dX-F5
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:15 +0000
Date: Thu, 29 Oct 2015 15:36:15 +0000
Message-Id: <E1ZrpFP-0004dX-F5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] console: Avoid
	overrunning the dmask arrays
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec5080d57c87e1ace8d76e12261ce660594516f8
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:11:21 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    console: Avoid overrunning the dmask arrays
    
    The valide range of font_data should be [0, 0xFF].
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 console.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/console.c b/console.c
index 9984d6f..d4f1ad0 100644
--- a/console.c
+++ b/console.c
@@ -421,7 +421,8 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
 {
     uint8_t *d;
     const uint8_t *font_ptr;
-    unsigned int font_data, linesize, xorcol, bpp;
+    uint8_t font_data;
+    unsigned int linesize, xorcol, bpp;
     int i;
     unsigned int fgcol, bgcol;
 
@@ -450,7 +451,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
             font_data = *font_ptr++;
             if (t_attrib->uline
                 && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (dmask16[(font_data >> 4)] & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (dmask16[(font_data >> 0) & 0xf] & xorcol) ^ bgcol;
@@ -463,7 +464,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
             font_data = *font_ptr++;
             if (t_attrib->uline
                 && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (dmask4[(font_data >> 6)] & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (dmask4[(font_data >> 4) & 3] & xorcol) ^ bgcol;
@@ -476,7 +477,7 @@ static void vga_putcharxy(DisplayState *ds, int x, int y, int ch,
         for(i = 0; i < FONT_HEIGHT; i++) {
             font_data = *font_ptr++;
             if (t_attrib->uline && ((i == FONT_HEIGHT - 2) || (i == FONT_HEIGHT - 3))) {
-                font_data = 0xFFFF;
+                font_data = 0xFF;
             }
             ((uint32_t *)d)[0] = (-((font_data >> 7)) & xorcol) ^ bgcol;
             ((uint32_t *)d)[1] = (-((font_data >> 6) & 1) & xorcol) ^ bgcol;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:36: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 1ZrpFe-0000ks-4Z; Thu, 29 Oct 2015 15:36: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 1ZrpFc-0000kN-5S
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:28 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	D4/50-22142-BFC32365; Thu, 29 Oct 2015 15:36:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446132986!46177064!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15805 invoked from network); 29 Oct 2015 15:36:26 -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;
	29 Oct 2015 15:36:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFa-00086a-07
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFZ-0004e8-UI
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:25 +0000
Date: Thu, 29 Oct 2015 15:36:25 +0000
Message-Id: <E1ZrpFZ-0004e8-UI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6]
	hw/device-hotplug: fix test of drive_add() return
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c69a0bb9e3b96bb041abf221323599976a4760c
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:16:42 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/device-hotplug: fix test of drive_add() return
    
    drive_opt_idx could be -1 in case error occurs inside drive_add, so the error
    check should be "if (drive_opt_idx < 0)" instead of original
    "if (!drive_opt_idx)".
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055574
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/device-hotplug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c
index 3bdc048..97d3529 100644
--- a/hw/device-hotplug.c
+++ b/hw/device-hotplug.c
@@ -34,7 +34,7 @@ int add_init_drive(const char *opts)
     int ret = -1;
 
     drive_opt_idx = drive_add(NULL, "%s", opts);
-    if (!drive_opt_idx)
+    if (drive_opt_idx < 0)
         return ret;
 
     drive_idx = drive_init(&drives_opt[drive_opt_idx], 0, current_machine);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:36: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 1ZrpFe-0000ks-4Z; Thu, 29 Oct 2015 15:36: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 1ZrpFc-0000kN-5S
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:28 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	D4/50-22142-BFC32365; Thu, 29 Oct 2015 15:36:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446132986!46177064!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15805 invoked from network); 29 Oct 2015 15:36:26 -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;
	29 Oct 2015 15:36:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFa-00086a-07
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFZ-0004e8-UI
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:25 +0000
Date: Thu, 29 Oct 2015 15:36:25 +0000
Message-Id: <E1ZrpFZ-0004e8-UI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6]
	hw/device-hotplug: fix test of drive_add() return
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c69a0bb9e3b96bb041abf221323599976a4760c
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:16:42 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/device-hotplug: fix test of drive_add() return
    
    drive_opt_idx could be -1 in case error occurs inside drive_add, so the error
    check should be "if (drive_opt_idx < 0)" instead of original
    "if (!drive_opt_idx)".
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055574
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/device-hotplug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c
index 3bdc048..97d3529 100644
--- a/hw/device-hotplug.c
+++ b/hw/device-hotplug.c
@@ -34,7 +34,7 @@ int add_init_drive(const char *opts)
     int ret = -1;
 
     drive_opt_idx = drive_add(NULL, "%s", opts);
-    if (!drive_opt_idx)
+    if (drive_opt_idx < 0)
         return ret;
 
     drive_idx = drive_init(&drives_opt[drive_opt_idx], 0, current_machine);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpFo-0000oa-7G; Thu, 29 Oct 2015 15:36: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 1ZrpFm-0000oC-Gq
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:38 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	52/37-06179-50D32365; Thu, 29 Oct 2015 15:36:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1446132996!46191173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23278 invoked from network); 29 Oct 2015 15:36:37 -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;
	29 Oct 2015 15:36:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFk-00086i-9V
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFk-0004eg-7a
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:36 +0000
Date: Thu, 29 Oct 2015 15:36:36 +0000
Message-Id: <E1ZrpFk-0004eg-7a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] qemu-char: fix
	memory leak in qemu_char_open_pty()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6af340b9e32e78fd980d46d939aa0939f51ebd4
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:27:36 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    qemu-char: fix memory leak in qemu_char_open_pty()
    
    The momery pointed by s and chr could be leaked if openpty return a value
    less then 0.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055926 1055927
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 qemu-char.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 324ed16..f62a6af 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -932,6 +932,8 @@ static CharDriverState *qemu_chr_open_pty(void)
     s = qemu_mallocz(sizeof(PtyCharDriver));
 
     if (openpty(&s->fd, &slave_fd, pty_name, NULL, NULL) < 0) {
+        qemu_free(s);
+        qemu_free(chr);
         return NULL;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpFo-0000oa-7G; Thu, 29 Oct 2015 15:36: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 1ZrpFm-0000oC-Gq
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:38 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	52/37-06179-50D32365; Thu, 29 Oct 2015 15:36:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1446132996!46191173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23278 invoked from network); 29 Oct 2015 15:36:37 -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;
	29 Oct 2015 15:36:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFk-00086i-9V
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFk-0004eg-7a
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:36 +0000
Date: Thu, 29 Oct 2015 15:36:36 +0000
Message-Id: <E1ZrpFk-0004eg-7a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] qemu-char: fix
	memory leak in qemu_char_open_pty()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6af340b9e32e78fd980d46d939aa0939f51ebd4
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 15:27:36 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    qemu-char: fix memory leak in qemu_char_open_pty()
    
    The momery pointed by s and chr could be leaked if openpty return a value
    less then 0.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055926 1055927
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 qemu-char.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 324ed16..f62a6af 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -932,6 +932,8 @@ static CharDriverState *qemu_chr_open_pty(void)
     s = qemu_mallocz(sizeof(PtyCharDriver));
 
     if (openpty(&s->fd, &slave_fd, pty_name, NULL, NULL) < 0) {
+        qemu_free(s);
+        qemu_free(chr);
         return NULL;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:36: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 1ZrpFz-0000sj-9v; Thu, 29 Oct 2015 15:36: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 1ZrpFx-0000s4-EU
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:49 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	39/9E-19110-01D32365; Thu, 29 Oct 2015 15:36:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1446133006!29773141!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14476 invoked from network); 29 Oct 2015 15:36:47 -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;
	29 Oct 2015 15:36:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFu-00086q-JL
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFu-0004fF-Hy
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:46 +0000
Date: Thu, 29 Oct 2015 15:36:46 +0000
Message-Id: <E1ZrpFu-0004fF-Hy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] hw/ide: fix
	memory leak from qemu_allocate_irqs()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18cb4bf3298c1ef21de1f320dda00152a3fa2453
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:10:14 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/ide: fix memory leak from qemu_allocate_irqs()
    
    qemu_allocate_irqs would return an array of irqs, not store the allocated
    array pointer, and subsequently leak it.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    2 +-
 hw/irq.c |   18 +++++++++++++++++-
 hw/irq.h |    4 ++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 3636611..4c30edd 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -4793,7 +4793,7 @@ struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv)
     md->card.cis = dscm1xxxx_cis;
     md->card.cis_len = sizeof(dscm1xxxx_cis);
 
-    ide_init2(md->ide, bdrv, 0, qemu_allocate_irqs(md_set_irq, md, 1)[0]);
+    ide_init2(md->ide, bdrv, 0, qemu_allocate_irq(md_set_irq, md));
     md->ide->is_cf = 1;
     md->ide->mdata_size = METADATA_SIZE;
     md->ide->mdata_storage = (uint8_t *) qemu_mallocz(METADATA_SIZE);
diff --git a/hw/irq.c b/hw/irq.c
index 7703f62..c7c4864 100644
--- a/hw/irq.c
+++ b/hw/irq.c
@@ -38,6 +38,22 @@ void qemu_set_irq(qemu_irq irq, int level)
     irq->handler(irq->opaque, irq->n, level);
 }
 
+qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque)
+{
+    struct IRQState *irq;
+
+    irq = (struct IRQState *)qemu_mallocz(sizeof(struct IRQState));
+    irq->handler = handler;
+    irq->opaque = opaque;
+    irq->n = 0;
+    return irq;
+}
+
+void qemu_free_irq(qemu_irq irq)
+{
+    qemu_free(irq);
+}
+
 qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n)
 {
     qemu_irq *s;
@@ -73,5 +89,5 @@ qemu_irq qemu_irq_invert(qemu_irq irq)
 {
     /* The default state for IRQs is low, so raise the output now.  */
     qemu_irq_raise(irq);
-    return qemu_allocate_irqs(qemu_notirq, irq, 1)[0];
+    return qemu_allocate_irq(qemu_notirq, irq);
 }
diff --git a/hw/irq.h b/hw/irq.h
index 5daae44..da34ae3 100644
--- a/hw/irq.h
+++ b/hw/irq.h
@@ -25,6 +25,10 @@ static inline void qemu_irq_pulse(qemu_irq irq)
     qemu_set_irq(irq, 0);
 }
 
+/* Returns one IRQ.  */
+qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque);
+void qemu_free_irq(qemu_irq irq);
+
 /* Returns an array of N IRQs.  */
 qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n);
 void qemu_free_irqs(qemu_irq *s);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:36:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:36: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 1ZrpFz-0000sj-9v; Thu, 29 Oct 2015 15:36: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 1ZrpFx-0000s4-EU
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:49 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	39/9E-19110-01D32365; Thu, 29 Oct 2015 15:36:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1446133006!29773141!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14476 invoked from network); 29 Oct 2015 15:36:47 -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;
	29 Oct 2015 15:36:47 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFu-00086q-JL
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpFu-0004fF-Hy
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:46 +0000
Date: Thu, 29 Oct 2015 15:36:46 +0000
Message-Id: <E1ZrpFu-0004fF-Hy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] hw/ide: fix
	memory leak from qemu_allocate_irqs()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18cb4bf3298c1ef21de1f320dda00152a3fa2453
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:10:14 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    hw/ide: fix memory leak from qemu_allocate_irqs()
    
    qemu_allocate_irqs would return an array of irqs, not store the allocated
    array pointer, and subsequently leak it.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    2 +-
 hw/irq.c |   18 +++++++++++++++++-
 hw/irq.h |    4 ++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 3636611..4c30edd 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -4793,7 +4793,7 @@ struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv)
     md->card.cis = dscm1xxxx_cis;
     md->card.cis_len = sizeof(dscm1xxxx_cis);
 
-    ide_init2(md->ide, bdrv, 0, qemu_allocate_irqs(md_set_irq, md, 1)[0]);
+    ide_init2(md->ide, bdrv, 0, qemu_allocate_irq(md_set_irq, md));
     md->ide->is_cf = 1;
     md->ide->mdata_size = METADATA_SIZE;
     md->ide->mdata_storage = (uint8_t *) qemu_mallocz(METADATA_SIZE);
diff --git a/hw/irq.c b/hw/irq.c
index 7703f62..c7c4864 100644
--- a/hw/irq.c
+++ b/hw/irq.c
@@ -38,6 +38,22 @@ void qemu_set_irq(qemu_irq irq, int level)
     irq->handler(irq->opaque, irq->n, level);
 }
 
+qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque)
+{
+    struct IRQState *irq;
+
+    irq = (struct IRQState *)qemu_mallocz(sizeof(struct IRQState));
+    irq->handler = handler;
+    irq->opaque = opaque;
+    irq->n = 0;
+    return irq;
+}
+
+void qemu_free_irq(qemu_irq irq)
+{
+    qemu_free(irq);
+}
+
 qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n)
 {
     qemu_irq *s;
@@ -73,5 +89,5 @@ qemu_irq qemu_irq_invert(qemu_irq irq)
 {
     /* The default state for IRQs is low, so raise the output now.  */
     qemu_irq_raise(irq);
-    return qemu_allocate_irqs(qemu_notirq, irq, 1)[0];
+    return qemu_allocate_irq(qemu_notirq, irq);
 }
diff --git a/hw/irq.h b/hw/irq.h
index 5daae44..da34ae3 100644
--- a/hw/irq.h
+++ b/hw/irq.h
@@ -25,6 +25,10 @@ static inline void qemu_irq_pulse(qemu_irq irq)
     qemu_set_irq(irq, 0);
 }
 
+/* Returns one IRQ.  */
+qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque);
+void qemu_free_irq(qemu_irq irq);
+
 /* Returns an array of N IRQs.  */
 qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n);
 void qemu_free_irqs(qemu_irq *s);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:37: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 1ZrpG8-0000vG-CO; Thu, 29 Oct 2015 15:37: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 1ZrpG7-0000un-2Y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:59 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	F9/D9-16870-A1D32365; Thu, 29 Oct 2015 15:36:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446133017!40763608!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5367 invoked from network); 29 Oct 2015 15:36:57 -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 Oct 2015 15:36:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpG4-000873-VN
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpG4-0004gK-Sh
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:56 +0000
Date: Thu, 29 Oct 2015 15:36:56 +0000
Message-Id: <E1ZrpG4-0004gK-Sh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] net: don't leak
	an fd after an error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1b6594ba444ce418fd183bedeed179ace42dab1
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:31:06 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    net: don't leak an fd after an error
    
    fd will be leaked if launch_script failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055925
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index 720027c..f3887a7 100644
--- a/net.c
+++ b/net.c
@@ -1049,8 +1049,10 @@ static int net_tap_init(VLANState *vlan, const char *model,
     if (!setup_script || !strcmp(setup_script, "no"))
         setup_script = "";
     if (setup_script[0] != '\0') {
-	if (launch_script(setup_script, ifname, script_arg, fd))
+	if (launch_script(setup_script, ifname, script_arg, fd)) {
+	    close(fd);
 	    return -1;
+	}
     }
     s = net_tap_fd_init(vlan, model, name, fd);
     if (!s)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:37: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 1ZrpG8-0000vG-CO; Thu, 29 Oct 2015 15:37: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 1ZrpG7-0000un-2Y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:59 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	F9/D9-16870-A1D32365; Thu, 29 Oct 2015 15:36:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446133017!40763608!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5367 invoked from network); 29 Oct 2015 15:36:57 -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 Oct 2015 15:36:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpG4-000873-VN
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpG4-0004gK-Sh
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:36:56 +0000
Date: Thu, 29 Oct 2015 15:36:56 +0000
Message-Id: <E1ZrpG4-0004gK-Sh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] net: don't leak
	an fd after an error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1b6594ba444ce418fd183bedeed179ace42dab1
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:31:06 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    net: don't leak an fd after an error
    
    fd will be leaked if launch_script failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055925
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index 720027c..f3887a7 100644
--- a/net.c
+++ b/net.c
@@ -1049,8 +1049,10 @@ static int net_tap_init(VLANState *vlan, const char *model,
     if (!setup_script || !strcmp(setup_script, "no"))
         setup_script = "";
     if (setup_script[0] != '\0') {
-	if (launch_script(setup_script, ifname, script_arg, fd))
+	if (launch_script(setup_script, ifname, script_arg, fd)) {
+	    close(fd);
 	    return -1;
+	}
     }
     s = net_tap_fd_init(vlan, model, name, fd);
     if (!s)
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpGJ-0000y4-Ew; Thu, 29 Oct 2015 15: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 1ZrpGH-0000xP-NP
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:09 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	A0/6B-16618-52D32365; Thu, 29 Oct 2015 15:37:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1446133027!17771711!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4619 invoked from network); 29 Oct 2015 15:37:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 15:37:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGF-00087e-98
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGF-0004hE-7R
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:07 +0000
Date: Thu, 29 Oct 2015 15:37:07 +0000
Message-Id: <E1ZrpGF-0004hE-7R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] net: Fix
	memory/handle leaks in net_socket_listen_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b2a35d239b2462ac1bea07b74f4c88ec20e233a
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Tue Apr 22 07:38:24 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    net: Fix memory/handle leaks in net_socket_listen_init()
    
    fd and s could be leaked in case bind/listen failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055923 1055924
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/net.c b/net.c
index f3887a7..33460d8 100644
--- a/net.c
+++ b/net.c
@@ -1460,6 +1460,7 @@ static int net_socket_listen_init(VLANState *vlan,
     fd = socket(PF_INET, SOCK_STREAM, 0);
     if (fd < 0) {
         perror("socket");
+        qemu_free(s);
         return -1;
     }
     socket_set_nonblock(fd);
@@ -1471,11 +1472,15 @@ static int net_socket_listen_init(VLANState *vlan,
     ret = bind(fd, (struct sockaddr *)&saddr, sizeof(saddr));
     if (ret < 0) {
         perror("bind");
+        closesocket(fd);
+        qemu_free(s);
         return -1;
     }
     ret = listen(fd, 0);
     if (ret < 0) {
         perror("listen");
+        closesocket(fd);
+        qemu_free(s);
         return -1;
     }
     s->vlan = vlan;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpGJ-0000y4-Ew; Thu, 29 Oct 2015 15: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 1ZrpGH-0000xP-NP
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:09 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	A0/6B-16618-52D32365; Thu, 29 Oct 2015 15:37:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1446133027!17771711!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4619 invoked from network); 29 Oct 2015 15:37:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 15:37:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGF-00087e-98
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGF-0004hE-7R
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:07 +0000
Date: Thu, 29 Oct 2015 15:37:07 +0000
Message-Id: <E1ZrpGF-0004hE-7R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] net: Fix
	memory/handle leaks in net_socket_listen_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b2a35d239b2462ac1bea07b74f4c88ec20e233a
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Tue Apr 22 07:38:24 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    net: Fix memory/handle leaks in net_socket_listen_init()
    
    fd and s could be leaked in case bind/listen failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055923 1055924
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/net.c b/net.c
index f3887a7..33460d8 100644
--- a/net.c
+++ b/net.c
@@ -1460,6 +1460,7 @@ static int net_socket_listen_init(VLANState *vlan,
     fd = socket(PF_INET, SOCK_STREAM, 0);
     if (fd < 0) {
         perror("socket");
+        qemu_free(s);
         return -1;
     }
     socket_set_nonblock(fd);
@@ -1471,11 +1472,15 @@ static int net_socket_listen_init(VLANState *vlan,
     ret = bind(fd, (struct sockaddr *)&saddr, sizeof(saddr));
     if (ret < 0) {
         perror("bind");
+        closesocket(fd);
+        qemu_free(s);
         return -1;
     }
     ret = listen(fd, 0);
     if (ret < 0) {
         perror("listen");
+        closesocket(fd);
+        qemu_free(s);
         return -1;
     }
     s->vlan = vlan;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpGT-00010C-I5; Thu, 29 Oct 2015 15:37: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 1ZrpGS-0000zv-4X
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:20 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	9C/83-18744-F2D32365; Thu, 29 Oct 2015 15:37:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1446133037!23804924!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18491 invoked from network); 29 Oct 2015 15:37:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 15:37:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGP-00087m-Mi
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGP-0004hq-HC
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:17 +0000
Date: Thu, 29 Oct 2015 15:37:17 +0000
Message-Id: <E1ZrpGP-0004hq-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-vvfat: fix
	memory/handle leaks in commit_one_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 b8b1c0d888c16ca2130c543122c69e9de5ef53c6
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:44:33 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-vvfat: fix memory/handle leaks in commit_one_file()
    
    Some handles and memory in commit_one_file are going to be leaked if
    certain function calls failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055918 1055919
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 345d7be..ec3363c 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -2229,11 +2229,15 @@ static int commit_one_file(BDRVVVFATState* s,
     if (fd < 0) {
 	fprintf(stderr, "Could not open %s... (%s, %d)\n", mapping->path,
 		strerror(errno), errno);
+	qemu_free(cluster);
 	return fd;
     }
     if (offset > 0)
-	if (lseek(fd, offset, SEEK_SET) != offset)
+	if (lseek(fd, offset, SEEK_SET) != offset) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return -3;
+	}
 
     while (offset < size) {
 	uint32_t c1;
@@ -2249,11 +2253,17 @@ static int commit_one_file(BDRVVVFATState* s,
 	ret = vvfat_read(s->bs, cluster2sector(s, c),
 	    (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200);
 
-	if (ret < 0)
+	if (ret < 0) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return ret;
+	}
 
-	if (qemu_write_ok(fd, cluster, rest_size) < 0)
+	if (qemu_write_ok(fd, cluster, rest_size) < 0) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return -2;
+	}
 
 	offset += rest_size;
 	c = c1;
@@ -2261,6 +2271,7 @@ static int commit_one_file(BDRVVVFATState* s,
 
     ftruncate(fd, size);
     close(fd);
+    qemu_free(cluster);
 
     return commit_mappings(s, first_cluster, dir_index);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpGT-00010C-I5; Thu, 29 Oct 2015 15:37: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 1ZrpGS-0000zv-4X
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:20 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	9C/83-18744-F2D32365; Thu, 29 Oct 2015 15:37:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1446133037!23804924!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18491 invoked from network); 29 Oct 2015 15:37:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2015 15:37:18 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGP-00087m-Mi
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGP-0004hq-HC
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:17 +0000
Date: Thu, 29 Oct 2015 15:37:17 +0000
Message-Id: <E1ZrpGP-0004hq-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-vvfat: fix
	memory/handle leaks in commit_one_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 b8b1c0d888c16ca2130c543122c69e9de5ef53c6
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:44:33 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:06 2015 +0100

    block-vvfat: fix memory/handle leaks in commit_one_file()
    
    Some handles and memory in commit_one_file are going to be leaked if
    certain function calls failed.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-IDs: 1055918 1055919
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 345d7be..ec3363c 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -2229,11 +2229,15 @@ static int commit_one_file(BDRVVVFATState* s,
     if (fd < 0) {
 	fprintf(stderr, "Could not open %s... (%s, %d)\n", mapping->path,
 		strerror(errno), errno);
+	qemu_free(cluster);
 	return fd;
     }
     if (offset > 0)
-	if (lseek(fd, offset, SEEK_SET) != offset)
+	if (lseek(fd, offset, SEEK_SET) != offset) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return -3;
+	}
 
     while (offset < size) {
 	uint32_t c1;
@@ -2249,11 +2253,17 @@ static int commit_one_file(BDRVVVFATState* s,
 	ret = vvfat_read(s->bs, cluster2sector(s, c),
 	    (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200);
 
-	if (ret < 0)
+	if (ret < 0) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return ret;
+	}
 
-	if (qemu_write_ok(fd, cluster, rest_size) < 0)
+	if (qemu_write_ok(fd, cluster, rest_size) < 0) {
+	    close(fd);
+	    qemu_free(cluster);
 	    return -2;
+	}
 
 	offset += rest_size;
 	c = c1;
@@ -2261,6 +2271,7 @@ static int commit_one_file(BDRVVVFATState* s,
 
     ftruncate(fd, size);
     close(fd);
+    qemu_free(cluster);
 
     return commit_mappings(s, first_cluster, dir_index);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:37: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 1ZrpGc-00013D-Mo; Thu, 29 Oct 2015 15:37: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 1ZrpGc-00012y-8o
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:30 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	89/96-30270-93D32365; Thu, 29 Oct 2015 15:37:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1446133048!46158230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23934 invoked from network); 29 Oct 2015 15:37:28 -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;
	29 Oct 2015 15:37:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGa-00087u-0K
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGZ-0004iY-US
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:27 +0000
Date: Thu, 29 Oct 2015 15:37:27 +0000
Message-Id: <E1ZrpGZ-0004iY-US@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-vvfat: fix
	memory leak in check_directory_consistency()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f9e474fca9b15b27f8f97220d165cd9f83a1fb0
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:52:47 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix memory leak in check_directory_consistency()
    
    Memory pointed by cluster leaks in error handling code.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055917
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index ec3363c..6cd57a2 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -1769,7 +1769,7 @@ static int check_directory_consistency(BDRVVVFATState *s,
 
 	if (s->used_clusters[cluster_num] & USED_ANY) {
 	    fprintf(stderr, "cluster %d used more than once\n", (int)cluster_num);
-	    return 0;
+	    goto fail;
 	}
 	s->used_clusters[cluster_num] = USED_DIRECTORY;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:37: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 1ZrpGc-00013D-Mo; Thu, 29 Oct 2015 15:37: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 1ZrpGc-00012y-8o
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:30 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	89/96-30270-93D32365; Thu, 29 Oct 2015 15:37:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1446133048!46158230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23934 invoked from network); 29 Oct 2015 15:37:28 -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;
	29 Oct 2015 15:37:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGa-00087u-0K
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGZ-0004iY-US
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:27 +0000
Date: Thu, 29 Oct 2015 15:37:27 +0000
Message-Id: <E1ZrpGZ-0004iY-US@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-vvfat: fix
	memory leak in check_directory_consistency()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f9e474fca9b15b27f8f97220d165cd9f83a1fb0
Author:     Kaifeng Zhu <kaifeng.zhu@citrix.com>
AuthorDate: Fri Mar 7 16:52:47 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix memory leak in check_directory_consistency()
    
    Memory pointed by cluster leaks in error handling code.
    
    Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
    Coverity-ID: 1055917
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index ec3363c..6cd57a2 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -1769,7 +1769,7 @@ static int check_directory_consistency(BDRVVVFATState *s,
 
 	if (s->used_clusters[cluster_num] & USED_ANY) {
 	    fprintf(stderr, "cluster %d used more than once\n", (int)cluster_num);
-	    return 0;
+	    goto fail;
 	}
 	s->used_clusters[cluster_num] = USED_DIRECTORY;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:37: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 1ZrpGm-00015o-PK; Thu, 29 Oct 2015 15:37: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 1ZrpGm-00015e-C0
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:40 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	E7/A2-31450-34D32365; Thu, 29 Oct 2015 15:37:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446133058!42055383!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11666 invoked from network); 29 Oct 2015 15:37:39 -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 Oct 2015 15:37:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGk-000887-9b
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGk-0004j9-7Q
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:38 +0000
Date: Thu, 29 Oct 2015 15:37:38 +0000
Message-Id: <E1ZrpGk-0004j9-7Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] virtio-blk:
	correctly link new request in virtio_blk_load()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fd8feea11eca12e370d9ada03c8d1bf81541a9a
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 09:49:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    virtio-blk: correctly link new request in virtio_blk_load()
    
    s->rq should be set with req instead of req-next.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055910
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/virtio-blk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index fcf893a..f3a81e3 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -288,7 +288,7 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)
         VirtIOBlockReq *req = virtio_blk_alloc_request(s);
         qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));
         req->next = s->rq;
-        s->rq = req->next;
+        s->rq = req;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:37: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 1ZrpGm-00015o-PK; Thu, 29 Oct 2015 15:37: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 1ZrpGm-00015e-C0
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:40 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	E7/A2-31450-34D32365; Thu, 29 Oct 2015 15:37:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446133058!42055383!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11666 invoked from network); 29 Oct 2015 15:37:39 -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 Oct 2015 15:37:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGk-000887-9b
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGk-0004j9-7Q
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:38 +0000
Date: Thu, 29 Oct 2015 15:37:38 +0000
Message-Id: <E1ZrpGk-0004j9-7Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] virtio-blk:
	correctly link new request in virtio_blk_load()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fd8feea11eca12e370d9ada03c8d1bf81541a9a
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 09:49:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    virtio-blk: correctly link new request in virtio_blk_load()
    
    s->rq should be set with req instead of req-next.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055910
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/virtio-blk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index fcf893a..f3a81e3 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -288,7 +288,7 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)
         VirtIOBlockReq *req = virtio_blk_alloc_request(s);
         qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));
         req->next = s->rq;
-        s->rq = req->next;
+        s->rq = req;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpGy-00018k-Ru; Thu, 29 Oct 2015 15:37: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 1ZrpGx-00018R-KZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:51 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	83/94-04752-F4D32365; Thu, 29 Oct 2015 15:37:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1446133068!25879085!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8806 invoked from network); 29 Oct 2015 15:37:50 -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;
	29 Oct 2015 15:37:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGu-00088F-KG
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGu-0004jh-Ib
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:48 +0000
Date: Thu, 29 Oct 2015 15:37:48 +0000
Message-Id: <E1ZrpGu-0004jh-Ib@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] net: initialize
	parameters before use in net_socket_fd_init_dgram()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9da9f80538c8ff891886cfe3d987ca17bd240d19
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 09:55:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    net: initialize parameters before use in net_socket_fd_init_dgram()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1005339 1005340
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index 33460d8..8aba3c2 100644
--- a/net.c
+++ b/net.c
@@ -1316,9 +1316,11 @@ static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan,
 {
     struct sockaddr_in saddr;
     int newfd;
-    socklen_t saddr_len;
+    socklen_t saddr_len = sizeof(saddr);
     NetSocketState *s;
 
+    memset(&saddr, 0, sizeof(saddr));
+
     /* fd passed: multicast: "learn" dgram_dst address from bound address and save it
      * Because this may be "shared" socket from a "master" process, datagrams would be recv()
      * by ONLY ONE process: we must "clone" this dgram socket --jjo
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:37:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpGy-00018k-Ru; Thu, 29 Oct 2015 15:37: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 1ZrpGx-00018R-KZ
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:51 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	83/94-04752-F4D32365; Thu, 29 Oct 2015 15:37:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1446133068!25879085!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8806 invoked from network); 29 Oct 2015 15:37:50 -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;
	29 Oct 2015 15:37:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGu-00088F-KG
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpGu-0004jh-Ib
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:48 +0000
Date: Thu, 29 Oct 2015 15:37:48 +0000
Message-Id: <E1ZrpGu-0004jh-Ib@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] net: initialize
	parameters before use in net_socket_fd_init_dgram()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9da9f80538c8ff891886cfe3d987ca17bd240d19
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 09:55:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    net: initialize parameters before use in net_socket_fd_init_dgram()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1005339 1005340
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index 33460d8..8aba3c2 100644
--- a/net.c
+++ b/net.c
@@ -1316,9 +1316,11 @@ static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan,
 {
     struct sockaddr_in saddr;
     int newfd;
-    socklen_t saddr_len;
+    socklen_t saddr_len = sizeof(saddr);
     NetSocketState *s;
 
+    memset(&saddr, 0, sizeof(saddr));
+
     /* fd passed: multicast: "learn" dgram_dst address from bound address and save it
      * Because this may be "shared" socket from a "master" process, datagrams would be recv()
      * by ONLY ONE process: we must "clone" this dgram socket --jjo
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:38:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:38: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 1ZrpH8-0001BH-UP; Thu, 29 Oct 2015 15:38:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpH7-0001Ay-70
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:01 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	7F/1D-16870-85D32365; Thu, 29 Oct 2015 15:38:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446133079!40884232!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19514 invoked from network); 29 Oct 2015 15:37:59 -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;
	29 Oct 2015 15:37:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpH5-00088K-1D
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpH4-0004ks-UG
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:58 +0000
Date: Thu, 29 Oct 2015 15:37:58 +0000
Message-Id: <E1ZrpH4-0004ks-UG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] ide: don't leak
	irq array in pci_cmd646_ide_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a979f2dcfab505ca77e5fd5f644bb0a705bae724
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:11:30 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    ide: don't leak irq array in pci_cmd646_ide_init()
    
    Call qemu_allocate_irq() twice instead of qemu_allocate_irqs to
    allocate memory.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 4c30edd..e4ad360 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3676,7 +3676,6 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
     PCIIDEState *d;
     uint8_t *pci_conf;
     int i;
-    qemu_irq *irq;
 
     d = (PCIIDEState *)pci_register_device(bus, "CMD646 IDE",
                                            sizeof(PCIIDEState),
@@ -3718,9 +3717,8 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
     for(i = 0; i < 4; i++)
         d->ide_if[i].pci_dev = (PCIDevice *)d;
 
-    irq = qemu_allocate_irqs(cmd646_set_irq, d, 2);
-    ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], irq[0]);
-    ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], irq[1]);
+    ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], qemu_allocate_irq(cmd646_set_irq, d));
+    ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], qemu_allocate_irq(cmd646_set_irq, d));
 
     register_savevm("ide", 0, 3, pci_ide_save, pci_ide_load, d);
     qemu_register_reset(cmd646_reset, d);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:38:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:38: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 1ZrpH8-0001BH-UP; Thu, 29 Oct 2015 15:38:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpH7-0001Ay-70
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:01 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	7F/1D-16870-85D32365; Thu, 29 Oct 2015 15:38:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446133079!40884232!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19514 invoked from network); 29 Oct 2015 15:37:59 -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;
	29 Oct 2015 15:37:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpH5-00088K-1D
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpH4-0004ks-UG
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:37:58 +0000
Date: Thu, 29 Oct 2015 15:37:58 +0000
Message-Id: <E1ZrpH4-0004ks-UG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] ide: don't leak
	irq array in pci_cmd646_ide_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a979f2dcfab505ca77e5fd5f644bb0a705bae724
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:11:30 2014 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    ide: don't leak irq array in pci_cmd646_ide_init()
    
    Call qemu_allocate_irq() twice instead of qemu_allocate_irqs to
    allocate memory.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    (defects not identified by Coverity Scan)
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 hw/ide.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/ide.c b/hw/ide.c
index 4c30edd..e4ad360 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3676,7 +3676,6 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
     PCIIDEState *d;
     uint8_t *pci_conf;
     int i;
-    qemu_irq *irq;
 
     d = (PCIIDEState *)pci_register_device(bus, "CMD646 IDE",
                                            sizeof(PCIIDEState),
@@ -3718,9 +3717,8 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
     for(i = 0; i < 4; i++)
         d->ide_if[i].pci_dev = (PCIDevice *)d;
 
-    irq = qemu_allocate_irqs(cmd646_set_irq, d, 2);
-    ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], irq[0]);
-    ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], irq[1]);
+    ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], qemu_allocate_irq(cmd646_set_irq, d));
+    ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], qemu_allocate_irq(cmd646_set_irq, d));
 
     register_savevm("ide", 0, 3, pci_ide_save, pci_ide_load, d);
     qemu_register_reset(cmd646_reset, d);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:38:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:38: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 1ZrpHJ-0001DE-0f; Thu, 29 Oct 2015 15:38:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHH-0001Ct-KX
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:11 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	65/75-22142-26D32365; Thu, 29 Oct 2015 15:38:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1446133089!21818690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27176 invoked from network); 29 Oct 2015 15:38:10 -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;
	29 Oct 2015 15:38:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHF-00088y-Eh
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHF-0004lf-9b
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:09 +0000
Date: Thu, 29 Oct 2015 15:38:09 +0000
Message-Id: <E1ZrpHF-0004lf-9b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-nbd: close
	sock in nbd_open() error 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 50c84619ea9aa6c24dd1c1215b25dfb73fbcc3c4
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:12:01 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-nbd: close sock in nbd_open() error path
    
    Close sock handle before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055914
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-nbd.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-nbd.c b/block-nbd.c
index dc63183..e2c90eb 100644
--- a/block-nbd.c
+++ b/block-nbd.c
@@ -88,7 +88,10 @@ static int nbd_open(BlockDriverState *bs, const char* filename, int flags)
 
     ret = nbd_receive_negotiate(sock, &size, &blocksize);
     if (ret == -1)
+    {
+        close(sock);
         return -errno;
+    }
 
     s->sock = sock;
     s->size = size;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:38:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:38: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 1ZrpHJ-0001DE-0f; Thu, 29 Oct 2015 15:38:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHH-0001Ct-KX
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:11 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	65/75-22142-26D32365; Thu, 29 Oct 2015 15:38:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1446133089!21818690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27176 invoked from network); 29 Oct 2015 15:38:10 -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;
	29 Oct 2015 15:38:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHF-00088y-Eh
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHF-0004lf-9b
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:09 +0000
Date: Thu, 29 Oct 2015 15:38:09 +0000
Message-Id: <E1ZrpHF-0004lf-9b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-nbd: close
	sock in nbd_open() error 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 50c84619ea9aa6c24dd1c1215b25dfb73fbcc3c4
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:12:01 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-nbd: close sock in nbd_open() error path
    
    Close sock handle before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055914
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-nbd.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-nbd.c b/block-nbd.c
index dc63183..e2c90eb 100644
--- a/block-nbd.c
+++ b/block-nbd.c
@@ -88,7 +88,10 @@ static int nbd_open(BlockDriverState *bs, const char* filename, int flags)
 
     ret = nbd_receive_negotiate(sock, &size, &blocksize);
     if (ret == -1)
+    {
+        close(sock);
         return -errno;
+    }
 
     s->sock = sock;
     s->size = size;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:38:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:38: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 1ZrpHT-0001FW-3S; Thu, 29 Oct 2015 15:38:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHS-0001FE-55
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:22 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	45/ED-16870-D6D32365; Thu, 29 Oct 2015 15:38:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446133100!40764045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16986 invoked from network); 29 Oct 2015 15:38:21 -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 Oct 2015 15:38:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHP-00089B-V1
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHP-0004mM-QV
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:19 +0000
Date: Thu, 29 Oct 2015 15:38:19 +0000
Message-Id: <E1ZrpHP-0004mM-QV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-raw-posix:
	Fix memory leak in posix_aio_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 734b9a8f05418c6cdb21b4c3d24b9d35960595eb
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:14:56 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-raw-posix: Fix memory leak in posix_aio_init()
    
    Free allocated memory s before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055915
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-raw-posix.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/block-raw-posix.c b/block-raw-posix.c
index 795cd5b..8a1baa8 100644
--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -602,6 +602,7 @@ static int posix_aio_init(void)
     s->first_aio = NULL;
     if (pipe(fds) == -1) {
         fprintf(stderr, "failed to create pipe\n");
+        qemu_free(s);
         return -errno;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:38:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15:38: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 1ZrpHT-0001FW-3S; Thu, 29 Oct 2015 15:38:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHS-0001FE-55
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:22 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	45/ED-16870-D6D32365; Thu, 29 Oct 2015 15:38:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446133100!40764045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16986 invoked from network); 29 Oct 2015 15:38:21 -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 Oct 2015 15:38:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHP-00089B-V1
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHP-0004mM-QV
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:19 +0000
Date: Thu, 29 Oct 2015 15:38:19 +0000
Message-Id: <E1ZrpHP-0004mM-QV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-raw-posix:
	Fix memory leak in posix_aio_init()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 734b9a8f05418c6cdb21b4c3d24b9d35960595eb
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:14:56 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-raw-posix: Fix memory leak in posix_aio_init()
    
    Free allocated memory s before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-ID: 1055915
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-raw-posix.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/block-raw-posix.c b/block-raw-posix.c
index 795cd5b..8a1baa8 100644
--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -602,6 +602,7 @@ static int posix_aio_init(void)
     s->first_aio = NULL;
     if (pipe(fds) == -1) {
         fprintf(stderr, "failed to create pipe\n");
+        qemu_free(s);
         return -errno;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:38:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpHd-0001Hh-5q; Thu, 29 Oct 2015 15:38:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHc-0001HV-Fu
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:32 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	FE/35-31450-77D32365; Thu, 29 Oct 2015 15:38:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446133110!16281675!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7667 invoked from network); 29 Oct 2015 15:38:31 -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;
	29 Oct 2015 15:38:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHa-00089N-9r
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHa-0004mr-7y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:30 +0000
Date: Thu, 29 Oct 2015 15:38:30 +0000
Message-Id: <E1ZrpHa-0004mr-7y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-vvfat: fix
	resource leaks in read_directory()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc00cad75d8bcc3ba696992bec219c21db8406aa
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:19:23 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix resource leaks in read_directory()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1055920 1055921
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 6cd57a2..ff5c8bf 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -760,6 +760,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
         if (st.st_size > 0x7fffffff) {
 	    fprintf(stderr, "File %s is larger than 2GB\n", buffer);
 	    free(buffer);
+            closedir(dir);
 	    return -2;
         }
 	direntry->size=cpu_to_le32(S_ISDIR(st.st_mode)?0:st.st_size);
@@ -787,6 +788,8 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
 	    s->current_mapping->read_only =
 		(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) == 0;
 	}
+        else
+            qemu_free(buffer);
     }
     closedir(dir);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Oct 29 15:38:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2015 15: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 1ZrpHd-0001Hh-5q; Thu, 29 Oct 2015 15:38:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHc-0001HV-Fu
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:32 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	FE/35-31450-77D32365; Thu, 29 Oct 2015 15:38:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446133110!16281675!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7667 invoked from network); 29 Oct 2015 15:38:31 -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;
	29 Oct 2015 15:38:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHa-00089N-9r
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZrpHa-0004mr-7y
	for xen-changelog@lists.xensource.com; Thu, 29 Oct 2015 15:38:30 +0000
Date: Thu, 29 Oct 2015 15:38:30 +0000
Message-Id: <E1ZrpHa-0004mr-7y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] block-vvfat: fix
	resource leaks in read_directory()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc00cad75d8bcc3ba696992bec219c21db8406aa
Author:     Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Tue Mar 11 10:19:23 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-vvfat: fix resource leaks in read_directory()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
    Coverity-IDs: 1055920 1055921
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 block-vvfat.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index 6cd57a2..ff5c8bf 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -760,6 +760,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
         if (st.st_size > 0x7fffffff) {
 	    fprintf(stderr, "File %s is larger than 2GB\n", buffer);
 	    free(buffer);
+            closedir(dir);
 	    return -2;
         }
 	direntry->size=cpu_to_le32(S_ISDIR(st.st_mode)?0:st.st_size);
@@ -787,6 +788,8 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
 	    s->current_mapping->read_only =
 		(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) == 0;
 	}
+        else
+            qemu_free(buffer);
     }
     closedir(dir);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 07:55:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 07:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zs4Wn-0001rD-69; Fri, 30 Oct 2015 07:55: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 1Zs4Wm-0001r8-BM
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 07:55:12 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	EB/9C-10715-F5223365; Fri, 30 Oct 2015 07:55:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1446191708!26032734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 907 invoked from network); 30 Oct 2015 07:55:09 -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;
	30 Oct 2015 07:55:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zs4Wg-0000tV-DT
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 07:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zs4Wg-0006kB-5d
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 07:55:06 +0000
Date: Fri, 30 Oct 2015 07:55:06 +0000
Message-Id: <E1Zs4Wg-0006kB-5d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/python: Further pruning of the
	defuct xl bindings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b261366f10eb150458d28aa728d399d0a781997e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 28 15:55:43 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 28 17:08:21 2015 +0000

    tools/python: Further pruning of the defuct xl bindings
    
    No need to generate xen/lowlevel/xl/_pyxl_types.{h,c}, following c/s
    598e97f "tools/python: remove broken xl binding"
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/python/Makefile   |    7 +-
 tools/python/genwrap.py |  332 -----------------------------------------------
 2 files changed, 1 insertions(+), 338 deletions(-)

diff --git a/tools/python/Makefile b/tools/python/Makefile
index 0395e50..2363537 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -7,12 +7,7 @@ all: build
 PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)
 
 .PHONY: build
-build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
-		$(XEN_ROOT)/tools/libxl/idl.py
-	PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
-		$(XEN_ROOT)/tools/libxl/libxl_types.idl \
-		xen/lowlevel/xl/_pyxl_types.h \
-		xen/lowlevel/xl/_pyxl_types.c
+build:
 	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
diff --git a/tools/python/genwrap.py b/tools/python/genwrap.py
deleted file mode 100644
index 56fb7a4..0000000
--- a/tools/python/genwrap.py
+++ /dev/null
@@ -1,332 +0,0 @@
-#!/usr/bin/python
-
-import sys,os
-
-import idl
-
-(TYPE_DEFBOOL, TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_ARRAY, TYPE_AGGREGATE) = range(7)
-
-def py_type(ty):
-    if ty == idl.bool:
-        return TYPE_BOOL
-    if ty.typename == "libxl_defbool":
-        return TYPE_DEFBOOL
-    if isinstance(ty, idl.Enumeration):
-        return TYPE_UINT
-    if isinstance(ty, idl.Number):
-        if ty.signed:
-            return TYPE_INT
-        else:
-            return TYPE_UINT
-    if isinstance(ty, idl.Array):
-        return TYPE_ARRAY
-    if isinstance(ty, idl.Aggregate):
-        return TYPE_AGGREGATE
-    if ty == idl.string:
-        return TYPE_STRING
-    return None
-
-def py_wrapstruct(ty):
-    l = []
-    l.append('typedef struct {')
-    l.append('    PyObject_HEAD;')
-    l.append('    %s obj;'%ty.typename);
-    l.append('}Py_%s;'%ty.rawname)
-    l.append('')
-    return "\n".join(l) + "\n"
-
-def fsanitize(name):
-    "Sanitise a function name given a C type"
-    ret = '_'.join(name.split())
-    return ret.replace('*', 'ptr')
-
-def py_decls(ty):
-    l = []
-    if isinstance(ty, idl.Aggregate):
-        l.append('_hidden Py_%s *Py%s_New(void);\n'%(ty.rawname, ty.rawname))
-        l.append('_hidden int Py%s_Check(PyObject *self);\n'%ty.rawname)
-        for f in ty.fields:
-            if py_type(f.type) is not None:
-                continue
-            if py_type(f.type) == TYPE_DEFBOOL:
-                continue
-            if ty.marshal_out():
-                l.append('_hidden PyObject *attrib__%s_get(%s *%s);'%(\
-                    fsanitize(f.type.typename), f.type.typename, f.name))
-            if ty.marshal_in():
-                l.append('_hidden int attrib__%s_set(PyObject *v, %s *%s);'%(\
-                    fsanitize(f.type.typename), f.type.typename, f.name))
-    return '\n'.join(l) + "\n"
-
-def py_attrib_get(ty, f):
-    t = py_type(f.type)
-    l = []
-    l.append('static PyObject *py_%s_%s_get(Py_%s *self, void *priv)'%(ty.rawname, f.name, ty.rawname))
-    l.append('{')
-    if t == TYPE_BOOL:
-        l.append('    PyObject *ret;')
-        l.append('    ret = (self->obj.%s) ? Py_True : Py_False;'%f.name)
-        l.append('    Py_INCREF(ret);')
-        l.append('    return ret;')
-    elif t == TYPE_DEFBOOL:
-        l.append('    return genwrap__defbool_get(&self->obj.%s);'%f.name)
-    elif t == TYPE_INT:
-        l.append('    return genwrap__ll_get(self->obj.%s);'%f.name)
-    elif t == TYPE_UINT:
-        l.append('    return genwrap__ull_get(self->obj.%s);'%f.name)
-    elif t == TYPE_STRING:
-        l.append('    return genwrap__string_get(&self->obj.%s);'%f.name)
-    elif t == TYPE_AGGREGATE or t == TYPE_ARRAY:
-        l.append('    PyErr_SetString(PyExc_NotImplementedError, "Getting %s");'%ty.typename)
-        l.append('    return NULL;')
-    else:
-        tn = f.type.typename
-        l.append('    return attrib__%s_get((%s *)&self->obj.%s);'%(fsanitize(tn), tn, f.name))
-    l.append('}')
-    return '\n'.join(l) + "\n\n"
-
-def py_attrib_set(ty, f):
-    t = py_type(f.type)
-    l = []
-    l.append('static int py_%s_%s_set(Py_%s *self, PyObject *v, void *priv)'%(ty.rawname, f.name, ty.rawname))
-    l.append('{')
-    if t == TYPE_BOOL:
-        l.append('    self->obj.%s = (NULL == v || Py_None == v || Py_False == v) ? 0 : 1;'%f.name)
-        l.append('    return 0;')
-    elif t == TYPE_DEFBOOL:
-        l.append('    return genwrap__defbool_set(v, &self->obj.%s);'%f.name)
-    elif t == TYPE_UINT or t == TYPE_INT:
-        l.append('    %slong long tmp;'%(t == TYPE_UINT and 'unsigned ' or ''))
-        l.append('    int ret;')
-        if t == TYPE_UINT:
-            l.append('    ret = genwrap__ull_set(v, &tmp, (%s)~0);'%f.type.typename)
-        else:
-            l.append('    ret = genwrap__ll_set(v, &tmp, (%s)~0);'%f.type.typename)
-        l.append('    if ( ret >= 0 )')
-        l.append('        self->obj.%s = tmp;'%f.name)
-        l.append('    return ret;')
-    elif t == TYPE_STRING:
-        l.append('    return genwrap__string_set(v, &self->obj.%s);'%f.name)
-    elif t == TYPE_AGGREGATE or t == TYPE_ARRAY:
-        l.append('    PyErr_SetString(PyExc_NotImplementedError, "Setting %s");'%ty.typename)
-        l.append('    return -1;')
-    else:
-        tn = f.type.typename
-        l.append('    return attrib__%s_set(v, (%s *)&self->obj.%s);'%(fsanitize(tn), tn, f.name))
-    l.append('}')
-    return '\n'.join(l) + "\n\n"
-
-def py_object_def(ty):
-    l = []
-    if ty.dispose_fn is not None:
-        dtor = '    %s(&self->obj);\n'%ty.dispose_fn
-    else:
-        dtor = ''
-
-    funcs="""static void Py%(rawname)s_dealloc(Py_%(rawname)s *self)
-{
-%(dtor)s    self->ob_type->tp_free((PyObject *)self);
-}
-
-static int Py%(rawname)s_init(Py_%(rawname)s *self, PyObject *args, PyObject *kwds)
-{
-    memset(&self->obj, 0, sizeof(self->obj));
-    return genwrap__obj_init((PyObject *)self, args, kwds);
-}
-
-static PyObject *Py%(rawname)s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
-    Py_%(rawname)s *self = (Py_%(rawname)s *)type->tp_alloc(type, 0);
-    if (self == NULL)
-        return NULL;
-    memset(&self->obj, 0, sizeof(self->obj));
-    return (PyObject *)self;
-}
-
-"""%{'rawname': ty.rawname, 'dtor': dtor}
-
-    l.append('static PyGetSetDef Py%s_getset[] = {'%ty.rawname)
-    for f in ty.fields:
-        if f.type.private:
-            continue
-        l.append('    { .name = "%s", '%f.name)
-        if ty.marshal_out():
-            l.append('      .get = (getter)py_%s_%s_get, '%(ty.rawname, f.name))
-        else:
-            l.append('      .get = (getter)NULL, ')
-        if ty.marshal_in():
-            l.append('      .set = (setter)py_%s_%s_set,'%(ty.rawname, f.name))
-        else:
-            l.append('      .set = (setter)NULL,')
-        l.append('    },')
-    l.append('    { .name = NULL }')
-    l.append('};')
-    struct="""
-static PyTypeObject Py%s_Type= {
-    PyObject_HEAD_INIT(NULL)
-    0,
-    PKG ".%s",
-    sizeof(Py_%s),
-    0,
-    (destructor)Py%s_dealloc,     /* tp_dealloc        */
-    NULL,                         /* tp_print          */
-    NULL,                         /* tp_getattr        */
-    NULL,                         /* tp_setattr        */
-    NULL,                         /* tp_compare        */
-    NULL,                         /* tp_repr           */
-    NULL,                         /* tp_as_number      */
-    NULL,                         /* tp_as_sequence    */
-    NULL,                         /* tp_as_mapping     */
-    NULL,                         /* tp_hash           */
-    NULL,                         /* tp_call           */
-    NULL,                         /* tp_str            */
-    NULL,                         /* tp_getattro       */
-    NULL,                         /* tp_setattro       */
-    NULL,                         /* tp_as_buffer      */
-    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags          */
-    "%s",                         /* tp_doc            */
-    NULL,                         /* tp_traverse       */
-    NULL,                         /* tp_clear          */
-    NULL,                         /* tp_richcompare    */
-    0,                            /* tp_weaklistoffset */
-    NULL,                         /* tp_iter           */
-    NULL,                         /* tp_iternext       */
-    NULL,                         /* tp_methods        */
-    NULL,                         /* tp_members        */
-    Py%s_getset,                  /* tp_getset         */
-    NULL,                         /* tp_base           */
-    NULL,                         /* tp_dict           */
-    NULL,                         /* tp_descr_get      */
-    NULL,                         /* tp_descr_set      */
-    0,                            /* tp_dictoffset     */
-    (initproc)Py%s_init,          /* tp_init           */
-    NULL,                         /* tp_alloc          */
-    Py%s_new,                     /* tp_new            */
-};
-
-Py_%s *Py%s_New(void)
-{
-    return (Py_%s *)Py%s_new(&Py%s_Type, NULL, NULL);
-}
-
-int Py%s_Check(PyObject *self)
-{
-    return (self->ob_type == &Py%s_Type);
-}
-"""%tuple(ty.rawname for x in range(15))
-    return funcs + '\n'.join(l) + "\n" + struct
-
-def py_initfuncs(types):
-    l = []
-    l.append('void genwrap__init(PyObject *m)')
-    l.append('{')
-    for ty in types:
-        if isinstance(ty, idl.Enumeration):
-            for v in ty.values:
-                l.append('    PyModule_AddIntConstant(m, "%s", %s);' % (v.rawname, v.name))
-        elif isinstance(ty, idl.Aggregate):
-            l.append('    if (PyType_Ready(&Py%s_Type) >= 0) {'%ty.rawname)
-            l.append('        Py_INCREF(&Py%s_Type);'%ty.rawname)
-            l.append('        PyModule_AddObject(m, "%s", (PyObject *)&Py%s_Type);'%(ty.rawname, ty.rawname))
-            l.append('    }')
-        else:
-            raise NotImplementedError("unknown type %s (%s)" % (ty.typename, type(ty)))        
-
-    l.append('}')
-    return '\n'.join(l) + "\n\n"
-
-def tree_frob(types):
-    ret = types[:]
-    for ty in [ty for ty in ret if isinstance(ty, idl.Aggregate)]:
-        ty.fields = filter(lambda f:f.name is not None and f.type.typename is not None, ty.fields)
-    return ret
-
-if __name__ == '__main__':
-    if len(sys.argv) < 4:
-        print >>sys.stderr, "Usage: genwrap.py <idl> <decls> <defns>"
-        sys.exit(1)
-
-    (_,types) = idl.parse(sys.argv[1])
-
-    types = tree_frob(types)
-
-    decls = sys.argv[2]
-    f = open(decls, 'w')
-    f.write("""#ifndef __PYXL_TYPES_H
-#define __PYXL_TYPES_H
-
-/*
- * DO NOT EDIT.
- *
- * This file is autogenerated by
- * "%s"
- */
-
-#define PKG "xen.lowlevel.xl"
-
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-#define _hidden __attribute__((visibility("hidden")))
-#define _protected __attribute__((visibility("protected")))
-#else
-#define _hidden
-#define _protected
-#endif
-
-/* Initialise all types */
-_hidden void genwrap__init(PyObject *m);
-
-/* Generic type initialiser */
-_hidden int genwrap__obj_init(PyObject *self, PyObject *args, PyObject *kwds);
-
-/* Auto-generated get/set functions for simple data-types */
-_hidden int genwrap__string_set(PyObject *v, char **str);
-_hidden PyObject *genwrap__string_get(char **str);
-_hidden PyObject *genwrap__ull_get(unsigned long long val);
-_hidden int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask);
-_hidden PyObject *genwrap__ll_get(long long val);
-_hidden int genwrap__ll_set(PyObject *v, long long *val, long long mask);
-_hidden PyObject *genwrap__defbool_get(libxl_defbool *db);
-_hidden int genwrap__defbool_set(PyObject *v, libxl_defbool *db);
-
-""" % " ".join(sys.argv))
-    for ty in [ty for ty in types if isinstance(ty, idl.Aggregate)]:
-        f.write('/* Internal API for %s wrapper */\n'%ty.typename)
-        f.write(py_wrapstruct(ty))
-        f.write(py_decls(ty))
-        f.write('\n')
-    f.write('#endif /* __PYXL_TYPES_H */\n')
-    f.close()
- 
-    defns = sys.argv[3]
-    f = open(defns, 'w')
-    f.write("""/*
- * DO NOT EDIT.
- *
- * This file is autogenerated by
- * "%s"
- */
-
-#include <Python.h>
-#include <string.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "libxl.h" /* gah */
-#include "%s"
-
-""" % tuple((' '.join(sys.argv),) + (os.path.split(decls)[-1:]),))
-    for ty in types:
-        if ty.private:
-            continue
-        if isinstance(ty, idl.Aggregate):
-            f.write('/* Attribute get/set functions for %s */\n'%ty.typename)
-            for a in ty.fields:
-                if a.type.private:
-                    continue
-                if ty.marshal_out():
-                    f.write(py_attrib_get(ty,a))
-                if ty.marshal_in():
-                    f.write(py_attrib_set(ty,a))
-            f.write(py_object_def(ty))
-    f.write(py_initfuncs(types))
-    f.close()
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 07:55:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 07:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zs4Wn-0001rD-69; Fri, 30 Oct 2015 07:55: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 1Zs4Wm-0001r8-BM
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 07:55:12 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	EB/9C-10715-F5223365; Fri, 30 Oct 2015 07:55:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1446191708!26032734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 907 invoked from network); 30 Oct 2015 07:55:09 -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;
	30 Oct 2015 07:55:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zs4Wg-0000tV-DT
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 07:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zs4Wg-0006kB-5d
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 07:55:06 +0000
Date: Fri, 30 Oct 2015 07:55:06 +0000
Message-Id: <E1Zs4Wg-0006kB-5d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/python: Further pruning of the
	defuct xl bindings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b261366f10eb150458d28aa728d399d0a781997e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 28 15:55:43 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 28 17:08:21 2015 +0000

    tools/python: Further pruning of the defuct xl bindings
    
    No need to generate xen/lowlevel/xl/_pyxl_types.{h,c}, following c/s
    598e97f "tools/python: remove broken xl binding"
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/python/Makefile   |    7 +-
 tools/python/genwrap.py |  332 -----------------------------------------------
 2 files changed, 1 insertions(+), 338 deletions(-)

diff --git a/tools/python/Makefile b/tools/python/Makefile
index 0395e50..2363537 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -7,12 +7,7 @@ all: build
 PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)
 
 .PHONY: build
-build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
-		$(XEN_ROOT)/tools/libxl/idl.py
-	PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
-		$(XEN_ROOT)/tools/libxl/libxl_types.idl \
-		xen/lowlevel/xl/_pyxl_types.h \
-		xen/lowlevel/xl/_pyxl_types.c
+build:
 	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
diff --git a/tools/python/genwrap.py b/tools/python/genwrap.py
deleted file mode 100644
index 56fb7a4..0000000
--- a/tools/python/genwrap.py
+++ /dev/null
@@ -1,332 +0,0 @@
-#!/usr/bin/python
-
-import sys,os
-
-import idl
-
-(TYPE_DEFBOOL, TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_ARRAY, TYPE_AGGREGATE) = range(7)
-
-def py_type(ty):
-    if ty == idl.bool:
-        return TYPE_BOOL
-    if ty.typename == "libxl_defbool":
-        return TYPE_DEFBOOL
-    if isinstance(ty, idl.Enumeration):
-        return TYPE_UINT
-    if isinstance(ty, idl.Number):
-        if ty.signed:
-            return TYPE_INT
-        else:
-            return TYPE_UINT
-    if isinstance(ty, idl.Array):
-        return TYPE_ARRAY
-    if isinstance(ty, idl.Aggregate):
-        return TYPE_AGGREGATE
-    if ty == idl.string:
-        return TYPE_STRING
-    return None
-
-def py_wrapstruct(ty):
-    l = []
-    l.append('typedef struct {')
-    l.append('    PyObject_HEAD;')
-    l.append('    %s obj;'%ty.typename);
-    l.append('}Py_%s;'%ty.rawname)
-    l.append('')
-    return "\n".join(l) + "\n"
-
-def fsanitize(name):
-    "Sanitise a function name given a C type"
-    ret = '_'.join(name.split())
-    return ret.replace('*', 'ptr')
-
-def py_decls(ty):
-    l = []
-    if isinstance(ty, idl.Aggregate):
-        l.append('_hidden Py_%s *Py%s_New(void);\n'%(ty.rawname, ty.rawname))
-        l.append('_hidden int Py%s_Check(PyObject *self);\n'%ty.rawname)
-        for f in ty.fields:
-            if py_type(f.type) is not None:
-                continue
-            if py_type(f.type) == TYPE_DEFBOOL:
-                continue
-            if ty.marshal_out():
-                l.append('_hidden PyObject *attrib__%s_get(%s *%s);'%(\
-                    fsanitize(f.type.typename), f.type.typename, f.name))
-            if ty.marshal_in():
-                l.append('_hidden int attrib__%s_set(PyObject *v, %s *%s);'%(\
-                    fsanitize(f.type.typename), f.type.typename, f.name))
-    return '\n'.join(l) + "\n"
-
-def py_attrib_get(ty, f):
-    t = py_type(f.type)
-    l = []
-    l.append('static PyObject *py_%s_%s_get(Py_%s *self, void *priv)'%(ty.rawname, f.name, ty.rawname))
-    l.append('{')
-    if t == TYPE_BOOL:
-        l.append('    PyObject *ret;')
-        l.append('    ret = (self->obj.%s) ? Py_True : Py_False;'%f.name)
-        l.append('    Py_INCREF(ret);')
-        l.append('    return ret;')
-    elif t == TYPE_DEFBOOL:
-        l.append('    return genwrap__defbool_get(&self->obj.%s);'%f.name)
-    elif t == TYPE_INT:
-        l.append('    return genwrap__ll_get(self->obj.%s);'%f.name)
-    elif t == TYPE_UINT:
-        l.append('    return genwrap__ull_get(self->obj.%s);'%f.name)
-    elif t == TYPE_STRING:
-        l.append('    return genwrap__string_get(&self->obj.%s);'%f.name)
-    elif t == TYPE_AGGREGATE or t == TYPE_ARRAY:
-        l.append('    PyErr_SetString(PyExc_NotImplementedError, "Getting %s");'%ty.typename)
-        l.append('    return NULL;')
-    else:
-        tn = f.type.typename
-        l.append('    return attrib__%s_get((%s *)&self->obj.%s);'%(fsanitize(tn), tn, f.name))
-    l.append('}')
-    return '\n'.join(l) + "\n\n"
-
-def py_attrib_set(ty, f):
-    t = py_type(f.type)
-    l = []
-    l.append('static int py_%s_%s_set(Py_%s *self, PyObject *v, void *priv)'%(ty.rawname, f.name, ty.rawname))
-    l.append('{')
-    if t == TYPE_BOOL:
-        l.append('    self->obj.%s = (NULL == v || Py_None == v || Py_False == v) ? 0 : 1;'%f.name)
-        l.append('    return 0;')
-    elif t == TYPE_DEFBOOL:
-        l.append('    return genwrap__defbool_set(v, &self->obj.%s);'%f.name)
-    elif t == TYPE_UINT or t == TYPE_INT:
-        l.append('    %slong long tmp;'%(t == TYPE_UINT and 'unsigned ' or ''))
-        l.append('    int ret;')
-        if t == TYPE_UINT:
-            l.append('    ret = genwrap__ull_set(v, &tmp, (%s)~0);'%f.type.typename)
-        else:
-            l.append('    ret = genwrap__ll_set(v, &tmp, (%s)~0);'%f.type.typename)
-        l.append('    if ( ret >= 0 )')
-        l.append('        self->obj.%s = tmp;'%f.name)
-        l.append('    return ret;')
-    elif t == TYPE_STRING:
-        l.append('    return genwrap__string_set(v, &self->obj.%s);'%f.name)
-    elif t == TYPE_AGGREGATE or t == TYPE_ARRAY:
-        l.append('    PyErr_SetString(PyExc_NotImplementedError, "Setting %s");'%ty.typename)
-        l.append('    return -1;')
-    else:
-        tn = f.type.typename
-        l.append('    return attrib__%s_set(v, (%s *)&self->obj.%s);'%(fsanitize(tn), tn, f.name))
-    l.append('}')
-    return '\n'.join(l) + "\n\n"
-
-def py_object_def(ty):
-    l = []
-    if ty.dispose_fn is not None:
-        dtor = '    %s(&self->obj);\n'%ty.dispose_fn
-    else:
-        dtor = ''
-
-    funcs="""static void Py%(rawname)s_dealloc(Py_%(rawname)s *self)
-{
-%(dtor)s    self->ob_type->tp_free((PyObject *)self);
-}
-
-static int Py%(rawname)s_init(Py_%(rawname)s *self, PyObject *args, PyObject *kwds)
-{
-    memset(&self->obj, 0, sizeof(self->obj));
-    return genwrap__obj_init((PyObject *)self, args, kwds);
-}
-
-static PyObject *Py%(rawname)s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
-    Py_%(rawname)s *self = (Py_%(rawname)s *)type->tp_alloc(type, 0);
-    if (self == NULL)
-        return NULL;
-    memset(&self->obj, 0, sizeof(self->obj));
-    return (PyObject *)self;
-}
-
-"""%{'rawname': ty.rawname, 'dtor': dtor}
-
-    l.append('static PyGetSetDef Py%s_getset[] = {'%ty.rawname)
-    for f in ty.fields:
-        if f.type.private:
-            continue
-        l.append('    { .name = "%s", '%f.name)
-        if ty.marshal_out():
-            l.append('      .get = (getter)py_%s_%s_get, '%(ty.rawname, f.name))
-        else:
-            l.append('      .get = (getter)NULL, ')
-        if ty.marshal_in():
-            l.append('      .set = (setter)py_%s_%s_set,'%(ty.rawname, f.name))
-        else:
-            l.append('      .set = (setter)NULL,')
-        l.append('    },')
-    l.append('    { .name = NULL }')
-    l.append('};')
-    struct="""
-static PyTypeObject Py%s_Type= {
-    PyObject_HEAD_INIT(NULL)
-    0,
-    PKG ".%s",
-    sizeof(Py_%s),
-    0,
-    (destructor)Py%s_dealloc,     /* tp_dealloc        */
-    NULL,                         /* tp_print          */
-    NULL,                         /* tp_getattr        */
-    NULL,                         /* tp_setattr        */
-    NULL,                         /* tp_compare        */
-    NULL,                         /* tp_repr           */
-    NULL,                         /* tp_as_number      */
-    NULL,                         /* tp_as_sequence    */
-    NULL,                         /* tp_as_mapping     */
-    NULL,                         /* tp_hash           */
-    NULL,                         /* tp_call           */
-    NULL,                         /* tp_str            */
-    NULL,                         /* tp_getattro       */
-    NULL,                         /* tp_setattro       */
-    NULL,                         /* tp_as_buffer      */
-    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags          */
-    "%s",                         /* tp_doc            */
-    NULL,                         /* tp_traverse       */
-    NULL,                         /* tp_clear          */
-    NULL,                         /* tp_richcompare    */
-    0,                            /* tp_weaklistoffset */
-    NULL,                         /* tp_iter           */
-    NULL,                         /* tp_iternext       */
-    NULL,                         /* tp_methods        */
-    NULL,                         /* tp_members        */
-    Py%s_getset,                  /* tp_getset         */
-    NULL,                         /* tp_base           */
-    NULL,                         /* tp_dict           */
-    NULL,                         /* tp_descr_get      */
-    NULL,                         /* tp_descr_set      */
-    0,                            /* tp_dictoffset     */
-    (initproc)Py%s_init,          /* tp_init           */
-    NULL,                         /* tp_alloc          */
-    Py%s_new,                     /* tp_new            */
-};
-
-Py_%s *Py%s_New(void)
-{
-    return (Py_%s *)Py%s_new(&Py%s_Type, NULL, NULL);
-}
-
-int Py%s_Check(PyObject *self)
-{
-    return (self->ob_type == &Py%s_Type);
-}
-"""%tuple(ty.rawname for x in range(15))
-    return funcs + '\n'.join(l) + "\n" + struct
-
-def py_initfuncs(types):
-    l = []
-    l.append('void genwrap__init(PyObject *m)')
-    l.append('{')
-    for ty in types:
-        if isinstance(ty, idl.Enumeration):
-            for v in ty.values:
-                l.append('    PyModule_AddIntConstant(m, "%s", %s);' % (v.rawname, v.name))
-        elif isinstance(ty, idl.Aggregate):
-            l.append('    if (PyType_Ready(&Py%s_Type) >= 0) {'%ty.rawname)
-            l.append('        Py_INCREF(&Py%s_Type);'%ty.rawname)
-            l.append('        PyModule_AddObject(m, "%s", (PyObject *)&Py%s_Type);'%(ty.rawname, ty.rawname))
-            l.append('    }')
-        else:
-            raise NotImplementedError("unknown type %s (%s)" % (ty.typename, type(ty)))        
-
-    l.append('}')
-    return '\n'.join(l) + "\n\n"
-
-def tree_frob(types):
-    ret = types[:]
-    for ty in [ty for ty in ret if isinstance(ty, idl.Aggregate)]:
-        ty.fields = filter(lambda f:f.name is not None and f.type.typename is not None, ty.fields)
-    return ret
-
-if __name__ == '__main__':
-    if len(sys.argv) < 4:
-        print >>sys.stderr, "Usage: genwrap.py <idl> <decls> <defns>"
-        sys.exit(1)
-
-    (_,types) = idl.parse(sys.argv[1])
-
-    types = tree_frob(types)
-
-    decls = sys.argv[2]
-    f = open(decls, 'w')
-    f.write("""#ifndef __PYXL_TYPES_H
-#define __PYXL_TYPES_H
-
-/*
- * DO NOT EDIT.
- *
- * This file is autogenerated by
- * "%s"
- */
-
-#define PKG "xen.lowlevel.xl"
-
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-#define _hidden __attribute__((visibility("hidden")))
-#define _protected __attribute__((visibility("protected")))
-#else
-#define _hidden
-#define _protected
-#endif
-
-/* Initialise all types */
-_hidden void genwrap__init(PyObject *m);
-
-/* Generic type initialiser */
-_hidden int genwrap__obj_init(PyObject *self, PyObject *args, PyObject *kwds);
-
-/* Auto-generated get/set functions for simple data-types */
-_hidden int genwrap__string_set(PyObject *v, char **str);
-_hidden PyObject *genwrap__string_get(char **str);
-_hidden PyObject *genwrap__ull_get(unsigned long long val);
-_hidden int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask);
-_hidden PyObject *genwrap__ll_get(long long val);
-_hidden int genwrap__ll_set(PyObject *v, long long *val, long long mask);
-_hidden PyObject *genwrap__defbool_get(libxl_defbool *db);
-_hidden int genwrap__defbool_set(PyObject *v, libxl_defbool *db);
-
-""" % " ".join(sys.argv))
-    for ty in [ty for ty in types if isinstance(ty, idl.Aggregate)]:
-        f.write('/* Internal API for %s wrapper */\n'%ty.typename)
-        f.write(py_wrapstruct(ty))
-        f.write(py_decls(ty))
-        f.write('\n')
-    f.write('#endif /* __PYXL_TYPES_H */\n')
-    f.close()
- 
-    defns = sys.argv[3]
-    f = open(defns, 'w')
-    f.write("""/*
- * DO NOT EDIT.
- *
- * This file is autogenerated by
- * "%s"
- */
-
-#include <Python.h>
-#include <string.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "libxl.h" /* gah */
-#include "%s"
-
-""" % tuple((' '.join(sys.argv),) + (os.path.split(decls)[-1:]),))
-    for ty in types:
-        if ty.private:
-            continue
-        if isinstance(ty, idl.Aggregate):
-            f.write('/* Attribute get/set functions for %s */\n'%ty.typename)
-            for a in ty.fields:
-                if a.type.private:
-                    continue
-                if ty.marshal_out():
-                    f.write(py_attrib_get(ty,a))
-                if ty.marshal_in():
-                    f.write(py_attrib_set(ty,a))
-            f.write(py_object_def(ty))
-    f.write(py_initfuncs(types))
-    f.close()
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14: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 1ZsAOb-0000bV-Aq; Fri, 30 Oct 2015 14:11:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOZ-0000bO-KZ
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:07 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	A2/A6-18107-A7A73365; Fri, 30 Oct 2015 14:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446214265!41039390!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7156 invoked from network); 30 Oct 2015 14:11:06 -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;
	30 Oct 2015 14:11:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOX-000599-AH
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOW-0006r2-9K
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:04 +0000
Date: Fri, 30 Oct 2015 14:11:04 +0000
Message-Id: <E1ZsAOW-0006r2-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] arm: Support
	hypercall_create_continuation for multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41dd3b8e73deafa0b05289d0430731ce2937d386
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 13:57:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:57:48 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14: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 1ZsAOb-0000bV-Aq; Fri, 30 Oct 2015 14:11:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOZ-0000bO-KZ
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:07 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	A2/A6-18107-A7A73365; Fri, 30 Oct 2015 14:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446214265!41039390!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7156 invoked from network); 30 Oct 2015 14:11:06 -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;
	30 Oct 2015 14:11:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOX-000599-AH
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOW-0006r2-9K
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:04 +0000
Date: Fri, 30 Oct 2015 14:11:04 +0000
Message-Id: <E1ZsAOW-0006r2-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] arm: Support
	hypercall_create_continuation for multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41dd3b8e73deafa0b05289d0430731ce2937d386
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 13:57:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:57:48 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsAOm-0000cR-DH; Fri, 30 Oct 2015 14:11: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 1ZsAOl-0000cI-06
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:19 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	FA/FD-14900-68A73365; Fri, 30 Oct 2015 14:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1446214276!21497959!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21276 invoked from network); 30 Oct 2015 14:11:17 -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;
	30 Oct 2015 14:11:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOi-00059E-FF
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOh-0006sU-Fv
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:15 +0000
Date: Fri, 30 Oct 2015 14:11:15 +0000
Message-Id: <E1ZsAOh-0006sU-Fv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] arm: rate-limit logging from
	unimplemented PHYSDEVOP and HVMOP.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 659e934fb0bf3a040ffa529ebf379a9140e8beab
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 13:58:15 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:58:15 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsAOm-0000cR-DH; Fri, 30 Oct 2015 14:11: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 1ZsAOl-0000cI-06
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:19 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	FA/FD-14900-68A73365; Fri, 30 Oct 2015 14:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1446214276!21497959!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21276 invoked from network); 30 Oct 2015 14:11:17 -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;
	30 Oct 2015 14:11:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOi-00059E-FF
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOh-0006sU-Fv
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:15 +0000
Date: Fri, 30 Oct 2015 14:11:15 +0000
Message-Id: <E1ZsAOh-0006sU-Fv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] arm: rate-limit logging from
	unimplemented PHYSDEVOP and HVMOP.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 659e934fb0bf3a040ffa529ebf379a9140e8beab
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 13:58:15 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:58:15 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsAOx-0000do-Fu; Fri, 30 Oct 2015 14:11: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 1ZsAOv-0000dd-Pt
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:29 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	74/74-16618-09A73365; Fri, 30 Oct 2015 14:11:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446214287!36408714!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29532 invoked from network); 30 Oct 2015 14:11:28 -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;
	30 Oct 2015 14:11:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOs-00059P-ML
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOs-0006tK-KR
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:26 +0000
Date: Fri, 30 Oct 2015 14:11:26 +0000
Message-Id: <E1ZsAOs-0006tK-KR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] arm: handle races between
	relinquish_memory and free_domheap_pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsAOx-0000do-Fu; Fri, 30 Oct 2015 14:11: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 1ZsAOv-0000dd-Pt
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:29 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	74/74-16618-09A73365; Fri, 30 Oct 2015 14:11:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446214287!36408714!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29532 invoked from network); 30 Oct 2015 14:11:28 -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;
	30 Oct 2015 14:11:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOs-00059P-ML
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAOs-0006tK-KR
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:26 +0000
Date: Fri, 30 Oct 2015 14:11:26 +0000
Message-Id: <E1ZsAOs-0006tK-KR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] arm: handle races between
	relinquish_memory and free_domheap_pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14: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 1ZsAP6-0000fK-Ia; Fri, 30 Oct 2015 14:11: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 1ZsAP5-0000f0-Cw
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:39 +0000
Content-Length: 2859
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	B2/BB-00536-A9A73365; Fri, 30 Oct 2015 14:11:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1446214297!23773043!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13384 invoked from network); 30 Oct 2015 14:11:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2015 14:11:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAP2-00059X-T4
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAP2-0006ty-RU
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:36 +0000
Date: Fri, 30 Oct 2015 14:11:36 +0000
Message-Id: <E1ZsAP2-0006ty-RU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: guard against undue super
	page PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7476087237887736391=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7476087237887736391==
Content-Length: 2462
Content-Transfer-Encoding: quoted-printable

commit d2fa0eeaba32fab85db9046acc2021a9c112051a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:59:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:59:03 2015 +0100

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

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


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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14: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 1ZsAP6-0000fK-Ia; Fri, 30 Oct 2015 14:11: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 1ZsAP5-0000f0-Cw
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:39 +0000
Content-Length: 2859
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	B2/BB-00536-A9A73365; Fri, 30 Oct 2015 14:11:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1446214297!23773043!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13384 invoked from network); 30 Oct 2015 14:11:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2015 14:11:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAP2-00059X-T4
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAP2-0006ty-RU
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:36 +0000
Date: Fri, 30 Oct 2015 14:11:36 +0000
Message-Id: <E1ZsAP2-0006ty-RU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: guard against undue super
	page PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7476087237887736391=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7476087237887736391==
Content-Length: 2462
Content-Transfer-Encoding: quoted-printable

commit d2fa0eeaba32fab85db9046acc2021a9c112051a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:59:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:59:03 2015 +0100

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

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


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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:11: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 1ZsAPG-0000gs-L8; Fri, 30 Oct 2015 14:11: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 1ZsAPF-0000ge-Bi
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:49 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	B9/FA-24494-4AA73365; Fri, 30 Oct 2015 14:11:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1446214307!46423845!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5671 invoked from network); 30 Oct 2015 14:11:48 -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;
	30 Oct 2015 14:11:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPD-00059c-3D
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPD-0006uN-0Z
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:47 +0000
Date: Fri, 30 Oct 2015 14:11:47 +0000
Message-Id: <E1ZsAPD-0006uN-0Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd4d3cfd513ccbc2df795b6da374f2686543f121
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:00:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:00:50 2015 +0100

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

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 336e9ea..6c53046 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -831,6 +831,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:11:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:11: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 1ZsAPG-0000gs-L8; Fri, 30 Oct 2015 14:11: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 1ZsAPF-0000ge-Bi
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:49 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	B9/FA-24494-4AA73365; Fri, 30 Oct 2015 14:11:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1446214307!46423845!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5671 invoked from network); 30 Oct 2015 14:11:48 -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;
	30 Oct 2015 14:11:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPD-00059c-3D
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPD-0006uN-0Z
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:47 +0000
Date: Fri, 30 Oct 2015 14:11:47 +0000
Message-Id: <E1ZsAPD-0006uN-0Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd4d3cfd513ccbc2df795b6da374f2686543f121
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:00:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:00:50 2015 +0100

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

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 336e9ea..6c53046 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -831,6 +831,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:12:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14: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 1ZsAPR-0000ib-Nq; Fri, 30 Oct 2015 14:12:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPQ-0000iL-8z
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:00 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	FE/B2-01748-FAA73365; Fri, 30 Oct 2015 14:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446214317!58459165!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4417 invoked from network); 30 Oct 2015 14:11:58 -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;
	30 Oct 2015 14:11:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPN-00059s-CU
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPN-0006um-AP
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:57 +0000
Date: Fri, 30 Oct 2015 14:11:57 +0000
Message-Id: <E1ZsAPN-0006um-AP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/PoD: Eager sweep for zeroed
	pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b12f70dfc28b76f7fcfe96116c0760b374ac574
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 14:01:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:01:47 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:12:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14: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 1ZsAPR-0000ib-Nq; Fri, 30 Oct 2015 14:12:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPQ-0000iL-8z
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:00 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	FE/B2-01748-FAA73365; Fri, 30 Oct 2015 14:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446214317!58459165!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4417 invoked from network); 30 Oct 2015 14:11:58 -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;
	30 Oct 2015 14:11:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPN-00059s-CU
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPN-0006um-AP
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:11:57 +0000
Date: Fri, 30 Oct 2015 14:11:57 +0000
Message-Id: <E1ZsAPN-0006um-AP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/PoD: Eager sweep for zeroed
	pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b12f70dfc28b76f7fcfe96116c0760b374ac574
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 14:01:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:01:47 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:12:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:12: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 1ZsAPb-0000kY-TB; Fri, 30 Oct 2015 14:12:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPa-0000kE-8c
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:10 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	71/C0-15765-9BA73365; Fri, 30 Oct 2015 14:12:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1446214327!62985205!1
X-Originating-IP: [50.57.168.107]
X-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); 30 Oct 2015 14:12:08 -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;
	30 Oct 2015 14:12:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPX-0005AY-LG
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPX-0006vN-Hi
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:07 +0000
Date: Fri, 30 Oct 2015 14:12:07 +0000
Message-Id: <E1ZsAPX-0006vN-Hi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:12:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:12: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 1ZsAPb-0000kY-TB; Fri, 30 Oct 2015 14:12:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPa-0000kE-8c
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:10 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	71/C0-15765-9BA73365; Fri, 30 Oct 2015 14:12:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1446214327!62985205!1
X-Originating-IP: [50.57.168.107]
X-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); 30 Oct 2015 14:12:08 -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;
	30 Oct 2015 14:12:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPX-0005AY-LG
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPX-0006vN-Hi
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:07 +0000
Date: Fri, 30 Oct 2015 14:12:07 +0000
Message-Id: <E1ZsAPX-0006vN-Hi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:12:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:12: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 1ZsAPn-0000m8-Vj; Fri, 30 Oct 2015 14:12: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 1ZsAPm-0000lu-3S
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:22 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	CB/81-09570-5CA73365; Fri, 30 Oct 2015 14:12:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1446214338!25612172!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28669 invoked from network); 30 Oct 2015 14:12:19 -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;
	30 Oct 2015 14:12:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPh-0005Ag-Sb
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPh-0006wI-QR
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:17 +0000
Date: Fri, 30 Oct 2015 14:12:17 +0000
Message-Id: <E1ZsAPh-0006wI-QR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: rate-limit logging in
	do_xen{oprof, pmu}_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 14:12:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 14:12: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 1ZsAPn-0000m8-Vj; Fri, 30 Oct 2015 14:12: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 1ZsAPm-0000lu-3S
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:22 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	CB/81-09570-5CA73365; Fri, 30 Oct 2015 14:12:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1446214338!25612172!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28669 invoked from network); 30 Oct 2015 14:12:19 -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;
	30 Oct 2015 14:12:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPh-0005Ag-Sb
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsAPh-0006wI-QR
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 14:12:17 +0000
Date: Fri, 30 Oct 2015 14:12:17 +0000
Message-Id: <E1ZsAPh-0006wI-QR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: rate-limit logging in
	do_xen{oprof, pmu}_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:00:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:00:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD2J-0004pP-JN; Fri, 30 Oct 2015 17:00:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2I-0004pK-W7
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:19 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	53/30-32615-222A3365; Fri, 30 Oct 2015 17:00:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446224416!42376579!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4163 invoked from network); 30 Oct 2015 17:00:17 -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;
	30 Oct 2015 17:00:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD24-0007GO-2x
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD23-00069i-WD
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:04 +0000
Date: Fri, 30 Oct 2015 17:00:03 +0000
Message-Id: <E1ZsD23-00069i-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/PV: don't zero-map LDT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 566bfb1a00b3e3f6ed6610fe34a5b9ef42bcb81e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:45:05 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:45:05 2015 +0100

    x86/PV: don't zero-map LDT
    
    This effectvely reverts the LDT related part of commit cf6d39f819
    ("x86/PV: properly populate descriptor tables"), which broke demand
    paged LDT handling in guests.
    
    Reported-by: David Vrabel <david.vrabel@citrix.com>
    Diagnosed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 61031e64d3dafd2fb1953436444bf02eccb9b146
    master date: 2015-10-27 14:46:12 +0100
---
 xen/arch/x86/mm.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 327b837..8763414 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -508,7 +508,6 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 {
     l1_pgentry_t *pl1e;
     unsigned int i;
-    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
     struct page_info *page;
 
     BUG_ON(unlikely(in_irq()));
@@ -523,11 +522,10 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 
     for ( i = 16; i < 32; i++ )
     {
-        pfn = l1e_get_pfn(pl1e[i]);
-        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn )
+        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) )
             continue;
-        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
-        page = mfn_to_page(pfn);
+        page = l1e_get_page(pl1e[i]);
+        l1e_write(&pl1e[i], l1e_empty());
         ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
         ASSERT_PAGE_IS_DOMAIN(page, v->domain);
         put_page_and_type(page);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:00:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:00:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD2J-0004pP-JN; Fri, 30 Oct 2015 17:00:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2I-0004pK-W7
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:19 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	53/30-32615-222A3365; Fri, 30 Oct 2015 17:00:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446224416!42376579!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4163 invoked from network); 30 Oct 2015 17:00:17 -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;
	30 Oct 2015 17:00:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD24-0007GO-2x
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD23-00069i-WD
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:04 +0000
Date: Fri, 30 Oct 2015 17:00:03 +0000
Message-Id: <E1ZsD23-00069i-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/PV: don't zero-map LDT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 566bfb1a00b3e3f6ed6610fe34a5b9ef42bcb81e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:45:05 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:45:05 2015 +0100

    x86/PV: don't zero-map LDT
    
    This effectvely reverts the LDT related part of commit cf6d39f819
    ("x86/PV: properly populate descriptor tables"), which broke demand
    paged LDT handling in guests.
    
    Reported-by: David Vrabel <david.vrabel@citrix.com>
    Diagnosed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 61031e64d3dafd2fb1953436444bf02eccb9b146
    master date: 2015-10-27 14:46:12 +0100
---
 xen/arch/x86/mm.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 327b837..8763414 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -508,7 +508,6 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 {
     l1_pgentry_t *pl1e;
     unsigned int i;
-    unsigned long pfn, zero_pfn = PFN_DOWN(__pa(zero_page));
     struct page_info *page;
 
     BUG_ON(unlikely(in_irq()));
@@ -523,11 +522,10 @@ static void invalidate_shadow_ldt(struct vcpu *v, int flush)
 
     for ( i = 16; i < 32; i++ )
     {
-        pfn = l1e_get_pfn(pl1e[i]);
-        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) || pfn == zero_pfn )
+        if ( !(l1e_get_flags(pl1e[i]) & _PAGE_PRESENT) )
             continue;
-        l1e_write(&pl1e[i], l1e_from_pfn(zero_pfn, __PAGE_HYPERVISOR_RO));
-        page = mfn_to_page(pfn);
+        page = l1e_get_page(pl1e[i]);
+        l1e_write(&pl1e[i], l1e_empty());
         ASSERT_PAGE_IS_TYPE(page, PGT_seg_desc_page);
         ASSERT_PAGE_IS_DOMAIN(page, v->domain);
         put_page_and_type(page);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:00:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:00:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD2U-0004qC-Lp; Fri, 30 Oct 2015 17:00: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 1ZsD2T-0004q1-CA
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:29 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	3F/9C-03819-C22A3365; Fri, 30 Oct 2015 17:00:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446224427!42376628!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5490 invoked from network); 30 Oct 2015 17:00:28 -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;
	30 Oct 2015 17:00:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2R-0007IN-4f
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2Q-0006An-SR
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:27 +0000
Date: Fri, 30 Oct 2015 17:00:26 +0000
Message-Id: <E1ZsD2Q-0006An-SR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] arm: Support
	hypercall_create_continuation for multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:00:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:00:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD2U-0004qC-Lp; Fri, 30 Oct 2015 17:00: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 1ZsD2T-0004q1-CA
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:29 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	3F/9C-03819-C22A3365; Fri, 30 Oct 2015 17:00:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446224427!42376628!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5490 invoked from network); 30 Oct 2015 17:00:28 -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;
	30 Oct 2015 17:00:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2R-0007IN-4f
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2Q-0006An-SR
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:27 +0000
Date: Fri, 30 Oct 2015 17:00:26 +0000
Message-Id: <E1ZsD2Q-0006An-SR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] arm: Support
	hypercall_create_continuation for multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:00:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:00:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD2f-0004ri-3f; Fri, 30 Oct 2015 17:00:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2d-0004rW-Jm
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:39 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	4A/94-06179-632A3365; Fri, 30 Oct 2015 17:00:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446224437!41205002!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14269 invoked from network); 30 Oct 2015 17:00:38 -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;
	30 Oct 2015 17:00:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2b-0007IW-DD
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2b-0006Bi-9t
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:37 +0000
Date: Fri, 30 Oct 2015 17:00:37 +0000
Message-Id: <E1ZsD2b-0006Bi-9t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] arm: rate-limit logging from
	unimplemented PHYSDEVOP and HVMOP.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b18d995ca341d07a38fec04aa137e9ef85ee4dd0
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 13:47:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:47:10 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:00:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:00:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD2f-0004ri-3f; Fri, 30 Oct 2015 17:00:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2d-0004rW-Jm
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:39 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	4A/94-06179-632A3365; Fri, 30 Oct 2015 17:00:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446224437!41205002!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14269 invoked from network); 30 Oct 2015 17:00:38 -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;
	30 Oct 2015 17:00:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2b-0007IW-DD
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2b-0006Bi-9t
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:37 +0000
Date: Fri, 30 Oct 2015 17:00:37 +0000
Message-Id: <E1ZsD2b-0006Bi-9t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] arm: rate-limit logging from
	unimplemented PHYSDEVOP and HVMOP.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b18d995ca341d07a38fec04aa137e9ef85ee4dd0
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 13:47:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:47:10 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:00:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:00: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 1ZsD2p-0004td-69; Fri, 30 Oct 2015 17:00:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2o-0004tP-9a
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:50 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	0D/BA-05979-142A3365; Fri, 30 Oct 2015 17:00:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446224447!12403159!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32578 invoked from network); 30 Oct 2015 17:00:48 -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;
	30 Oct 2015 17:00:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2l-0007Ii-K2
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2l-0006CB-I3
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:47 +0000
Date: Fri, 30 Oct 2015 17:00:47 +0000
Message-Id: <E1ZsD2l-0006CB-I3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] arm: handle races between
	relinquish_memory and free_domheap_pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:00:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:00: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 1ZsD2p-0004td-69; Fri, 30 Oct 2015 17:00:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2o-0004tP-9a
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:50 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	0D/BA-05979-142A3365; Fri, 30 Oct 2015 17:00:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446224447!12403159!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32578 invoked from network); 30 Oct 2015 17:00:48 -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;
	30 Oct 2015 17:00:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2l-0007Ii-K2
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2l-0006CB-I3
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:47 +0000
Date: Fri, 30 Oct 2015 17:00:47 +0000
Message-Id: <E1ZsD2l-0006CB-I3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] arm: handle races between
	relinquish_memory and free_domheap_pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01: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 1ZsD34-0004vo-AI; Fri, 30 Oct 2015 17:01: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 1ZsD33-0004vX-6T
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:05 +0000
Content-Length: 2862
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	88/9C-26043-052A3365; Fri, 30 Oct 2015 17:01:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1446224458!30083472!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16091 invoked from network); 30 Oct 2015 17:00:59 -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;
	30 Oct 2015 17:00:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2v-0007Iq-Um
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2v-0006D2-Pf
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:57 +0000
Date: Fri, 30 Oct 2015 17:00:57 +0000
Message-Id: <E1ZsD2v-0006D2-Pf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: guard against undue super
	page PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3653404880737781445=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3653404880737781445==
Content-Length: 2465
Content-Transfer-Encoding: quoted-printable

commit 2d094bd87072e26ac29b07917d31fcbf13892288
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:48:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:48:09 2015 +0100

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

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


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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01: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 1ZsD34-0004vo-AI; Fri, 30 Oct 2015 17:01: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 1ZsD33-0004vX-6T
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:05 +0000
Content-Length: 2862
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	88/9C-26043-052A3365; Fri, 30 Oct 2015 17:01:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1446224458!30083472!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16091 invoked from network); 30 Oct 2015 17:00:59 -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;
	30 Oct 2015 17:00:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2v-0007Iq-Um
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD2v-0006D2-Pf
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:00:57 +0000
Date: Fri, 30 Oct 2015 17:00:57 +0000
Message-Id: <E1ZsD2v-0006D2-Pf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: guard against undue super
	page PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3653404880737781445=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3653404880737781445==
Content-Length: 2465
Content-Transfer-Encoding: quoted-printable

commit 2d094bd87072e26ac29b07917d31fcbf13892288
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:48:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:48:09 2015 +0100

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

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


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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD3A-0004x5-Cg; Fri, 30 Oct 2015 17:01:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD38-0004wo-QM
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:10 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	11/63-16965-652A3365; Fri, 30 Oct 2015 17:01:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1446224468!25669096!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3633 invoked from network); 30 Oct 2015 17:01:09 -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;
	30 Oct 2015 17:01:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD36-0007JM-6G
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD36-0006Dg-47
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:08 +0000
Date: Fri, 30 Oct 2015 17:01:08 +0000
Message-Id: <E1ZsD36-0006Dg-47@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c57108c36eaa10885b7d0daad534348717e4f9d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:49:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:49:56 2015 +0100

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

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 1b9fcfc..796c492 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -833,6 +833,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD3A-0004x5-Cg; Fri, 30 Oct 2015 17:01:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD38-0004wo-QM
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:10 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	11/63-16965-652A3365; Fri, 30 Oct 2015 17:01:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1446224468!25669096!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3633 invoked from network); 30 Oct 2015 17:01:09 -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;
	30 Oct 2015 17:01:09 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD36-0007JM-6G
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD36-0006Dg-47
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:08 +0000
Date: Fri, 30 Oct 2015 17:01:08 +0000
Message-Id: <E1ZsD36-0006Dg-47@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c57108c36eaa10885b7d0daad534348717e4f9d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:49:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:49:56 2015 +0100

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

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 1b9fcfc..796c492 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -833,6 +833,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD3K-0004zW-I4; Fri, 30 Oct 2015 17:01:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3J-0004zJ-2S
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:21 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	07/E6-19110-062A3365; Fri, 30 Oct 2015 17:01:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446224478!36458222!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19840 invoked from network); 30 Oct 2015 17:01:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2015 17:01:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3G-0007JY-G1
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3G-0006E2-Bm
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:18 +0000
Date: Fri, 30 Oct 2015 17:01:18 +0000
Message-Id: <E1ZsD3G-0006E2-Bm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/PoD: Eager sweep for zeroed
	pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4a32fbd95af6503ea1314ff2aa9a0b0a473d46c0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 13:50:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:50:59 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD3K-0004zW-I4; Fri, 30 Oct 2015 17:01:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3J-0004zJ-2S
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:21 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	07/E6-19110-062A3365; Fri, 30 Oct 2015 17:01:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1446224478!36458222!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19840 invoked from network); 30 Oct 2015 17:01:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2015 17:01:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3G-0007JY-G1
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3G-0006E2-Bm
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:18 +0000
Date: Fri, 30 Oct 2015 17:01:18 +0000
Message-Id: <E1ZsD3G-0006E2-Bm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/PoD: Eager sweep for zeroed
	pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4a32fbd95af6503ea1314ff2aa9a0b0a473d46c0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 13:50:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:50:59 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD3U-00051W-Kh; Fri, 30 Oct 2015 17:01:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3T-00051K-GY
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:31 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	85/D8-15765-A62A3365; Fri, 30 Oct 2015 17:01:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446224488!62978606!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2748 invoked from network); 30 Oct 2015 17:01:29 -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;
	30 Oct 2015 17:01:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3Q-0007Jk-O1
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3Q-0006ES-La
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:28 +0000
Date: Fri, 30 Oct 2015 17:01:28 +0000
Message-Id: <E1ZsD3Q-0006ES-La@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 429f0cd270851462783fc6d56d6bae9cbb40bdca
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:51:24 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:51:24 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD3U-00051W-Kh; Fri, 30 Oct 2015 17:01:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3T-00051K-GY
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:31 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	85/D8-15765-A62A3365; Fri, 30 Oct 2015 17:01:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446224488!62978606!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2748 invoked from network); 30 Oct 2015 17:01:29 -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;
	30 Oct 2015 17:01:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3Q-0007Jk-O1
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3Q-0006ES-La
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:28 +0000
Date: Fri, 30 Oct 2015 17:01:28 +0000
Message-Id: <E1ZsD3Q-0006ES-La@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 429f0cd270851462783fc6d56d6bae9cbb40bdca
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:51:24 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:51:24 2015 +0100

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD3e-00053L-N9; Fri, 30 Oct 2015 17:01:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3d-000537-Eu
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:41 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	A8/9E-29649-472A3365; Fri, 30 Oct 2015 17:01:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446224499!58315435!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 12500 invoked from network); 30 Oct 2015 17:01:40 -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;
	30 Oct 2015 17:01:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3b-0007Js-1D
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3a-0006Fa-UF
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:38 +0000
Date: Fri, 30 Oct 2015 17:01:38 +0000
Message-Id: <E1ZsD3a-0006Fa-UF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: rate-limit logging in
	do_xen{oprof, pmu}_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Oct 30 17:01:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2015 17:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZsD3e-00053L-N9; Fri, 30 Oct 2015 17:01:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3d-000537-Eu
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:41 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	A8/9E-29649-472A3365; Fri, 30 Oct 2015 17:01:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446224499!58315435!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 12500 invoked from network); 30 Oct 2015 17:01:40 -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;
	30 Oct 2015 17:01:40 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3b-0007Js-1D
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsD3a-0006Fa-UF
	for xen-changelog@lists.xensource.com; Fri, 30 Oct 2015 17:01:38 +0000
Date: Fri, 30 Oct 2015 17:01:38 +0000
Message-Id: <E1ZsD3a-0006Fa-UF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: rate-limit logging in
	do_xen{oprof, pmu}_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

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

